mmcglynn
mmcglynn

Reputation: 7672

How do I include the parent in MODx Wayfinder menu?

I am trying to do something conceptually quite simple with a MODX Revolution 2.2.0-rc3 menu, without success.

I want to display an unordered list of children but include the parent. This is not possible using getResources without additional add ons.

Using Wayfinder, I have the following call:

[[!Wayfinder? &level=`1` &startId=`[[*parent]]` &displayStart=`true` &startItemTpl=`LinkedListItemTpl`!]]

The idea is that by creating a custom template chunk, I override the default, which displays the start page wrapped in an H2 tag.

The custom chunk looks like this:

<li[+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>[+wf.wrapper+]</li>

The issue is that it is not recognized, and the start page is still rendered inan H2 tag.

I've spent three hours on this issue and look forward to input.

Upvotes: 0

Views: 1955

Answers (1)

Sean Kimball
Sean Kimball

Reputation: 4494

3 hours eh? I hate that, hopefully you just needed a fresh set of eyes, you are using the evo markup in your startItemTpl

<li[+wf.classes+]><a href="[+wf.link+]" title="[+wf.title+]">[+wf.linktext+]</a>[+wf.wrapper+]</li>

should be

<li[[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]">[[+wf.linktext]]</a>[[+wf.wrapper]]</li>

if that's not it, you have checked the custom chunk name 'LinkedListItemTpl'? [also I don't know if that ! at the end of the wayfinder declaration does anything for you, I've never used it]

If none of that works, a trick I've used with wayfinder is to use a symlink type resource [linked to your first item] in the document tree.

-good luck!

Upvotes: 2

Related Questions