We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 11927
    • 105 Posts
    I’m not sure where to put this. Should I report it in the modx bug tracker?

    When I create a menu in wayfinder and the last item in the menu is a category, it doesn’t use the &categoryFoldersTpl template.

    This is my &categoryFoldersTpl template:
    <li class="category [[+wf.classnames]]">[[+wf.linktext]][[+wf.wrapper]]</li>


    So here is my menu example.
    -One
    -Two
    -Three
    -Four
    ---subOne
    ---subTwo

    When I set the menu item Four to be a category, it uses some other template, not the &categoryFoldersTpl template I would think it should.

    Instead I think it uses the default template. I don’t know if this is supposed to happen this way. I would think that it should use the &categoryFoldersTpl template and just insert the classname last into the classes.

    I just did a test and it has the same gliche when I try to make the firt item a category.


    I would like to suggest that there be a &categoryClass, too.


    Also, is there a way to add a class name or id to just one specific item in the menu. So using the same example above, could I make item Two have another class or add an id that is only on item Two? That way any time document Two is in a menu it would be a different color or different font-size?
      You may or may not want to use the code I write. It&#39;s probably all against the syntax rules of php and MODx. smiley

      Carpet Cleaning
      • 11927
      • 105 Posts
      Okay, so it acts like I mentioned above, until I create a document under it. So that makes sense, even though I would think it would still just use the &categoryFoldersTpl template.

      When I create a document that is not the first or last in the menu and doesn’t have any children, it works like I would think.


      But I still am wondering about my last question. Do I create a TV or something that will be added to [[+wf.classes]]?

      (I’m most interested in adding a class to specific menu items.)
        You may or may not want to use the code I write. It&#39;s probably all against the syntax rules of php and MODx. smiley

        Carpet Cleaning
        • 11927
        • 105 Posts
        Okay I get it.

        So I saw this in the docs and thought how do I use that?
        [[+wf.id]]


        If you want an id for a row item, you need to set this to something. (Below the id would look like this: id="id_123")
        &rowIdPrefix=`id_`


        The basic snippet call for a unique id would be:
        [[Wayfinder? &startId=`0` &level=`1` &rowIdPrefix=`id_`]]




        Sometimes I’m not thinking. So if you want a class to be added to a specific menu item, use a TV.

        You would need to make a chunk for $rowTpl and put the TV into it. I called my TV unique_item_classnames_tv.

        <li[[+wf.id]] class="[[+wf.classnames]] [[+your_TV_name_here]]">
        	<a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>
        	[[+wf.wrapper]]
        </li>


        And the basic snippet call for this would be (if you don’t want a specific id for each item):
        [[Wayfinder? &startId=`0` &level=`1` &rowTpl=`yourChunkNameHere`]]
          You may or may not want to use the code I write. It&#39;s probably all against the syntax rules of php and MODx. smiley

          Carpet Cleaning