We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 46950
    • 86 Posts
    At last my call of getResources began working pretty well yesterday. But today I encountered the fact that my Wayfinder bagan showing the list of links as a vertical list (ul). I deleted all getResources calls and all styles for it, nevertheless I still see the list of links as a vertical list. What can be the source of this trouble?

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

      • 42802
      • 96 Posts
      Sebastian Zahn | ingroove.uy Reply #2, 11 years, 10 months ago
      getResources and Wayfinder work independently, on both you can control the output with templates ( chunks of code ).
      Both have specific defaults templates to output the data. Yor can assign your own templates to customize.

      I think wayfinder, by default, output results inside the <ul> tag, that´s because it´s a navigation solution, and navigate menús should be listed inside a ul tag.
      Wayfinder's primary purpose is to generate navigational menus that automatically update to reflect changes made to the document tree, but it can be used for other purposes as well.

      Check this.

      Wayfinder, check Template Parameters http://rtfm.modx.com/extras/revo/wayfinder

      Get Resources: http://rtfm.modx.com/extras/revo/getresources

      Cheers. [ed. note: zzseba last edited this post 11 years, 10 months ago.]
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        By default, Wayfinder generates a nested unordered list, using several default tpls. I believe the default tpls are actually hard-coded into the core Wayfinder code, and any defined custom tpls override these defaults.

        getResources generates a flat list, and requires a tpl to use for structuring each item. By itself, it just dumps a flat unordered list debug view of everything it does.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 3749
          • 24,544 Posts
          The most likely cause is a missing or misspelled Tpl chunk.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 46950
            • 86 Posts
            Quote from: BobRay at Nov 13, 2014, 03:27 PM
            The most likely cause is a missing or misspelled Tpl chunk.
            Initialy I took this paramrters from a lesson and did't change them. Here they are:

            [[!Wayfinder?
            &startId=`0`
            &outerTpl=`menuOuter`
            &rowTpl=`menuRow`
            &innerTpl=`menuInner`
            &innerRowTpl=`menuInnerRow`
            &hereClass=``
            &firstClass=``
            &lastClass =`` &debug=`1` &textOfLinks=`longtitle` &sortBy=`menutitle` ]]
            


            And this is what they contain (taken from the debugger screen):

            outerTpl	<ul id='nav' class="hr">[[+wf.wrapper]]</ul>
            
            rowTpl	<li><a [[+wf.classes]] href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]</li>
            
            innerTpl	<ul>[[+wf.wrapper]]</ul>
            
            innerRowTpl	<li [[+wf.classes]]><a href="[[+wf.link]]" title="[[+wf.title]]" [[+wf.attributes]]><span>[[+wf.linktext]]</span></a>[[+wf.wrapper]]</li>
            
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              And are you getting an HTML nested unordered list? The positioning and styling are done with CSS.

              You might be interested in this http://sottwell.com/links/wayfinder/wayfinder-book.pdf It's getting a little old, but still applies.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 42802
                • 96 Posts
                Sebastian Zahn | ingroove.uy Reply #7, 11 years, 10 months ago
                If your html menú looks right, and when you made your dinamic modx menu don´t look right, you should check the output html structre, css classes or id´s. If you want your menú looks the same, have to be the same structure.

                Please copy and paste the code to see.

                [ed. note: zzseba last edited this post 11 years, 10 months ago.]
                • discuss.answer
                  • 46950
                  • 86 Posts
                  Quote from: zzseba at Nov 14, 2014, 08:50 AM
                  If your html menú looks right, and when you made your dinamic modx menu don´t look right, you should check the output html structre, css classes or id´s. If you want your menú looks the same, have to be the same structure.

                  Please copy and paste the code to see.
                  At last I managed to get what I want (well, more or less). I had decided not to try to return to the initial variant but to make myself what I want -- to make my menu in-line. This is what I have now:

                  1)
                  [[!Wayfinder?
                  &startId=`0`
                  &outerTpl=`menuOuter`
                  &rowTpl=`menuRow`
                  &innerTpl=`menuInner`
                  &innerRowTpl=`menuInnerRow`
                  &rowClass=`inline` 
                  &debug=`1` &textOfLinks=`longtitle` &sortBy=`menutitle` ]]
                  


                  2) menuRow:
                  <li [[+wf.classes]]><a [[+wf.classes]] href="[[+wf.link]]"  title="[[+wf.title]]" [[+wf.attributes]]>[[+wf.linktext]]</a>[[+wf.wrapper]]</li>
                  


                  (Maybe doubling [[+wf.classes]] both after LI and after A is not the best variant but at least it allows me in one style both to make my UL to be shown in-line and to remove underlining.

                  3)
                  <STYLE>
                   .inline {display:inline;text-decoration:none}
                  </STYLE>
                  


                  Why the initial variant suddenly refused showing me the menu in-line is still a mystery for me.

                    • 42802
                    • 96 Posts
                    Sebastian Zahn | ingroove.uy Reply #9, 11 years, 10 months ago
                    Glad to see you make it!
                    Just one thing, don´t call the wayfinder snippet uncached!!!

                    Remove the "!", [[Wayfinder?

                    For performance reasons.

                    Check this: https://www.markhamstra.com/modx/2011/10/caching-guidelines-for-modx-revolution

                    Go to Common Errors , item 2, but it´s good to read the full article.

                    Cheers.
                      • 28042 ☆ A M B ☆
                      • 24,524 Posts
                      If you are using Login, then the Wayfinder snippet must be called uncached. The menu has to be generated differently for logged-in users to show the pages they can access, and you don't want that menu cached so that anonymous users see those pages in the menu.
                        Studying MODX in the desert - http://sottwell.com
                        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                        Join the Slack Community - http://modx.org