Wayfinder closing tags

85 views Asked by At

When I inserting Wayfinder "tag" inside HTML tag, eg. <a>[[!Wayfinder? &startId=1&level=1]]</a> it closes leading tags and then inserting code generated by Wayfinder, eg. <a></a><ul><li></li></ul> Ye, I know, that making menus this way (nesting uls in a) is not good, but I was learning how to use bootstrap and now I don't have time to change it :(

2

There are 2 answers

0
OptimusCrime On

How about just changing the outer template?

[[!Wayfinder? &startId=`1` &level=`1` &outerTpl=`@INLINE <a><ul[[+wf.classes]]>[[+wf.wrapper]]</ul></a>`]]

Btw: I find it kind of odd that this happens, it should not.

Btw2: You should not call Wayfinder uncached (e.g. remove the !)

0
Kristian Sandström On

HTML5 allows block elements inside anchors, but you cannot have anchors within anchors. It's very odd that the wayfinder snippet would output an ending , it sounds more likely that it's your browser parsing it that way, and that probably happens as soon as it encounters another anchor within your UL. the normal wayfinder row snippet is something like <li><a class="..." href="...">[[+wf.linkname]].....