We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22840
    • 1,572 Posts
    Hi All,

    Hoping someone can help with a bit of support on using the ListIndexer built into modx.

    I want / need to pull a few articles into the left hand side of my template so they display on every page.

    I have the articles created under the news page and the ListIndexer code in the correct place in the template.

    Now....

    If I goto the news page the news is there on the left as it should be, however it doesn’t display on any other page, so I think I’m right in thinking that the ListIndexer will only display on the parent page of the articles.

    Is there a way to get it to display across every page of the site huh

    Thanks
      • 3707
      • 241 Posts
      This is from the configuration settings:
      // $rootFolder [ NULL | string (comma separated page id’s) ]
      // Decide which folder to pull recent documents from.
      // If you want to specify a few folders, comma separate them.
      // The default NULL will set current page as root. Using 0
      // would search site wide. Can be set with snippet parameter
      // $LIn_root like:
      // [[listIndexer?LIn_root=3,6,88]]
      $rootFolder = NULL;
      Are you setting the root folder when you call ListIndexer by using the id of your news page? Otherwise it sets the current page as default which means it won’t work on other pages as you are experiencing.
        • 22840
        • 1,572 Posts
        Hi and thanks for the response.

        I have set the root folder as described in the config but as stated it doesn’t show site wide.

        [[ListIndexer?LIn_seeShowInMenu=1 LIn_mode=full LIn_root=13]]


        Thanks
          • 22840
          • 1,572 Posts
          I have just noticed that it is working on another page that has children under it.

          My products page displays the 3 children under that, so for some reason it isn’t sticking to 13 and only displays something if there are children under the parent page.
            • 3707
            • 241 Posts
            Try this instead
            [[ListIndexer?LIn_seeShowInMenu=1 &LIn_mode=full &LIn_root=13]]

            Notice the & before each parameter.
              • 22840
              • 1,572 Posts
              Brilliant.

              I tried yours and it worked site wide but dropped the content so I just removed 1 & and it works great

              for referance

              [[ListIndexer?LIn_seeShowInMenu=1 LIn_mode=full &LIn_root=13]]


              Thank you very much for your time on this grin

                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Snippet parameters must begin with a &, except for the first one which may follow the ? after the snippet name with no space.
                [[SnippetName? &param1=`value1` &param2=`value2` &param3=`value3`]]
                

                or
                [[SnippetName?param1=`value1` &param2=`value2` &param3=`value3`]]
                
                  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