Am late to this party but am wondering why Wayfinder’s
&rowIdPrefix parameter shouldn’t work in this case? Am I missing something? I tried the following and it worked fine (see screenshot)
I want the
&rowIdPrefix to be applied to the top level items only so I created both a
&rowTpl and an
&innerRowTpl
Here are the chunks:
The
&rowTpl - notice the
[+wf.id+] placeholder. This will ensure the
&rowIdPrefix will be output to row items, in my case, only first level row items since I also have a row template for my submenus (the
&innerRowTpl)
<li [+wf.id+] [+wf.classes+] >
<a href="[+wf.link+]" title="[+wf.title+]" [+wf.attributes+]>[+wf.linktext+]</a>
[+wf.wrapper+]
</li>
The
&innerRowTpl - notice that I didn’t include the
[+wf.id+] so that no
id="" will be output. I don’t need ids for these items.
<li[+wf.classes+]>
<a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>
[+wf.wrapper+]
</li>
My Wayfinder call: Of course yours might be different. For instance, I am using
&cssTpl just for this particular example, etc.
[[Wayfinder? &startId=`0` &outerTpl=`testMenuContainer` &rowTpl=`testMenuRows` &innerRowTpl=`testSubmenuRows` &level=`2` &cssTpl=`testcsstpl` &excludeDocs=`3,7,16` &rowIdPrefix=`test`]]
Now Wayfinder will give my top row menu items nice
ids prefixed with "
test" just before the relevant doc id.
Here’s the CSS
ul#test li {list-style-type:none; margin: 0; padding: 0; width: 12em; float: left; }
ul#test li ul {list-style-type:none; margin: 0; padding: 0;}
ul#test li a {text-decoration: none; font-size: 1.5em;}
ul#test li ul a{ text-decoration: none; font-size: 1.2em;}
li#test1 a {color: green;}
li#test2 a {color: blue;}
li#test3 a {color: red;}
li#test4 a {color: white;}
li#test5 a {color: yellow;}
li#test6 a {color: orange;}
It worked fine for me. So, no need for TVs, etc. But then again, this is MODx....there’s always another way....
And below’s a screenshot.
cheers/k