Hi,
I've been trying to include the "main page" in a side bar sub page navigation. The main page is always the startId of Wayfinder. And the startId is [[UltimateParent? &topLevel=`2`]]
I've tried using the &includeDocs parameter, as this seems like the best approach, but that didn't work (it just removed all list items?).
I've also tried using the &displayStart parameter as descripbed on some blog, but that seems like such a strange approach for this simple task. Just didn't feel "clean and simple" (and messes up the active css class).
Is there a way to simple just make Wayfinder include the "ultimate parent" or "startId" in the list as the first item?
-
☆ A M B ☆
- 24,524 Posts
The only way you can do that is to juggle the startItemTpl and the outerTpl. Wayfinder is designed to work with the children of the startId.
That's what I read on that blog.
Wayfinder seemed powerful enough with all the parameters and options that this simple task should just be simple. Too bad includeDocs doesn't work. That would be such a nice solution.
I'll just use FirstChildRedirect on my main menu items then.
-
☆ A M B ☆
- 1,780 Posts
I noticed this the other day.
Create a new chunk, name it, and specify with &startItemTpl in the Wayfinder call.
It defaults to this.
<h2[[+wf.id]][[+wf.classes]]>[[+wf.linktext]]</h2>[[+wf.wrapper]]
New chunk should be something like this:
<li[[+wf.id]][[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]
If I do this the start item is placed outside of the "<ul>" right? So I would have to modify the outerTpl as well, as Susan said, to make it inside of the <ul>.
But this approach makes the start item class always "active", which is not good.
Or am I missing something?