On March 26, 2019 we launched new MODX Forums. Please join us at the new MODX Community Forums.
Subscribe: RSS
  • Hi,

    On some page, Wayfinder only lists 3 of 7 children and, although being a user of MODx for many years, I cannot figure out why.

    The snippet call:
    [!Wayfinder? &outerClass=`menu` &startId=`[*id*]` &level=`1` &outerTpl=`@FILE:assets/snippets/wayfinder/tpl/menu_pastel/outer.tpl` &rowTpl=`@FILE:assets/snippets/wayfinder/tpl/menu_pastel/row.tpl` !]

    The attached picture shows the document tree.
    The call to Wayfinder is in the template of document 98.
    Only the children framed in green show, the ones framed in red don't.

    - all children are published and marked as visible in menu
    - all children use the same template and have the same TV filled
    - all children have a different menuindex, from 0 to 6
    - there is no excludeDoc parameter in the snippet call
    - on the contrary to Wayfinder, Ditto is able to list all items
    - when called from another page, Wayfinder lists all children without problem
    - I cleared MODx cache, as well as the browser cache. I even deleted the content of folder "assets/cache". I refreshed the page.

    The problem remains.

    The webpage is online and I can send the URL by PM if someone wants to have a glance.
    I cannot publish the URL for everybody as the site was not yet delivered to the customer.

    Can someone help?

    This question has been answered by Jul. See the first response.

    [ed. note: Jul last edited this post 5 years, 1 month ago.]
    • Salut (Hi),

      Have you check in the html code to see if there nothing too. I mean maybe CSS hide this menu items.

      • Salut Steeve,
        Oui, bien sûr j'ai regardé et j'aurais dû le préciser.
        Wayfinder ne retourne rien pour les éléments manquants.

        Hello Steeve,
        Yes, I checked and I should have mentioned it.
        Wayfinder doesn't output anything for the missing elements.
        • I even checked with phpMyAdmin that the same columns are filled the same way.
          • Just a guess:

            Have you tried calling Wayfinder cached and uncached

            Have you tried calling Wayfinder in its most basic form, again cached and uncached


            Default uncached:
            [!Wayfinder? &outerClass=`menu` &startId=`[*id*]` &level=`1` &outerTpl=`@FILE:assets/snippets/wayfinder/tpl/menu_pastel/outer.tpl` &rowTpl=`@FILE:assets/snippets/wayfinder/tpl/menu_pastel/row.tpl`!]

            Default cached:
            [[Wayfinder? &outerClass=`menu` &startId=`[*id*]` &level=`1` &outerTpl=`@FILE:assets/snippets/wayfinder/tpl/menu_pastel/outer.tpl` &rowTpl=`@FILE:assets/snippets/wayfinder/tpl/menu_pastel/row.tpl`]]

            Basic uncached:
            [!Wayfinder? &startId=`0`!]

            Basic cached:
            [[Wayfinder? &startId=`0`]]

            Something else:

            Have you tried using the actual ID instead of using [*id*] ?

            This is all guessing, so my apologies if this is basic and has already been tested
            • Have you tried calling Wayfinder cached and uncached
              Yes, I have tried. The snippet was being called uncached, but I also tried calling it cached. Same result.

              Have you tried calling Wayfinder in its most basic form, again cached and uncached
              Yes, with &startId=`0` the snippet returns the whole tree without problem.
              But I want it returning children from node 98.

              Have you tried using the actual ID instead of using [*id*] ?
              Yes, also tried, same result.

              And the cache was manually emptied (i.e. cache documents in the trash)!

              The funniest is that if I duplicate one document that is not listed, the duplicate becomes visible without any problem.

              (N.B. I'm a user of MODx since 2008 and have never seen a so strange thing.)
              • discuss.answer
                Problem identified

                Amongst the ressources (pages / links) listed by a Wayfinder menu, if two or more ressources share the same alias, Wayfinder only lists one of them, even if friendly URLs are not activated.

                In the case mentioned above, I was using "w0, w1, w2, ..." alias values to store classes telling the widths of tabs. Several tabs had the same width and were using the same class.
                The "alias" field had been used for this purpose, as friendly URLs were not used.
                However, I'll have to create a custom TV to store the tab widths.
                Wayfinder is a little bit tyrannical in regards of aliases.
                Checks for alias duplicates should be the role of the manager and not of Wayfinder.
                • I'm glad you found it !
                  • At the end, I used the link attributes field instead of the alias field to store the classes.
                    This avoided me having to create a new TV.
                    As I create the tabs with Ditto, I use the [+link_attributes+] placeholder to retrieve the classes that define their widths.