We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8931
    • 5 Posts
    I’m facing the same problem! Items which are unchecked at the ’Show in menu’ option, will not show listed in the call. I don’t know what else to do! Can anyone that has used this snippet provide a proper call for it?
      • 5091
      • 332 Posts
      Quote from: craigbeck at May 04, 2008, 03:38 PM


      [!ListSiteMap?LSM_root=0!]  with cacheable  and uncacheable

      [[listSiteMap]]  with cacheable  and uncacheable

      [!ListSiteMap!]  with cacheable  and uncacheable

      Have you tried setting the levels with the snippet,

      [tt][[listSiteMap?LSM_levels=2]][/tt]

      Changing "2" to the number of levels you want the children documents to show



      Hi craigbeck, thanks for the tips.
      I  finally got back to working on this snippet for a site just now, and yes I tried t[tt][[listSiteMap?LSM_levels=2]][/tt], still it doesn’t work even with levels=3 (my document structure is  3 levels  deep)

      However I found a way for it to show up now, but is curious if this is actually a bug or it’s something I still don’t understand how this snippet works.

      First it’s still the same site that I tried to implement the menu. Initially client wanted drop-down menu but with two levels only, so I have the ’Show in Menu’ unchecked for third level page in the document.

      Client changed her mind with drop-down menu, but I still kept the  ’Show in Menu’ unchecked for third level (published) but  keep the second level unpublish.

      After trying all combination I was still not able to bring the third level shows up; the 2nd level (just served as a container with no content for the page) shows up when I do this : $showUnpubs = 1;  
      but with ’$showUnpubs, whether I set it to ’0’ or ’1’, it’s still now working.

      So I thought perhaps I should have the  ’Show in Menu’  checked in the document. As soon as I did that, the third level shows up.

      So now it solved my problem, but it still remains for future sites that want to use drop-down menu with level controls.


      update: I took a closer look at the code, is this what is causing it?
      if ((!$su && !$child[’published’]) || ($child[’deleted’]) || (!$showNotInMenu && $child[’hidemenu’])) continue;

        • 4971
        • 964 Posts
        Two things:

        1) I am getting a long list of all my documents, not alphabetically ordered, no id ordered, just all of them in one list (no identations or anything). It says it shows a nested sitemap, what is wrong?

        2) somebody added $showSelf parameter, isnt it the same as the existing $selfAsLink parameter?
          Website: www.mercologia.com
          MODX Revo Tutorials:  www.modxperience.com

          MODX Professional Partner
          • 13577
          • 302 Posts
          Quote from: charliez at Jun 30, 2008, 08:36 PM

          1) I am getting a long list of all my documents, not alphabetically ordered, no id ordered, just all of them in one list (no identations or anything). It says it shows a nested sitemap, what is wrong?
          Hard to say without seeing your generated code - do you have a URL to share so we can look at it? Which version of the snippet are you using etc. etc. etc.

          Quote from: charliez

          2) somebody added $showSelf parameter, isnt it the same as the existing $selfAsLink parameter?
          No:
          $selfAsLink determines if the current page will show as a link or plain text. The thinking being that you probably don’t need a link to the page you’re on.
          $showSelf determines if the current page will show up AT ALL or not.
            Standard Disclaimer
            I could be totally wrong.
            • 4971
            • 964 Posts
            Thanks for the responses....

            1) it was version 0.9.7 and the extra </li>’s (I think it inserts two of them) that was causing the problem.
            I downgraded to 0.9 and it works fine now...

            2) Thanks for clarifying... the default in 0.9 shows sitemap as text, as you are in the sitemap...
            so good if somebody wants a link instead using $selfAsLink....,
            good to get rid of it in the sitemap too using $showSelf
              Website: www.mercologia.com
              MODX Revo Tutorials:  www.modxperience.com

              MODX Professional Partner
              • 11460
              • 10 Posts
              Quote from: chinesedream at Mar 01, 2008, 07:10 PM

              I like this snippet very much and have tried it out today, however I am unable to make the (published) documents that are not in the menu show up, the children documents of the menu also not showing up.

              ....

              I am still using v0.9.6 Modx and the snippet is v0.9.7. I first tried it about month ago with v0.9.6, was getting the same result.


              Hi,
              there is a bug in the versions later 0.9.0 - $showSelf $showUnpubs $showNotInMenu don´t work because this variables are not defined in the function.

              But all works fine in v0.9.7 with bugfix as follow:

              Search following lines:
              function MakeSiteMap($funcModx, $listParent, $listLevel, $description, $titleOfLinks,$maxLevels,$su,$selfAsLink){
              MakeSiteMap($funcModx,$child['id'],$listLevel+1,$description,$titleOfLinks,$maxLevels,$su,$selfAsLink);
              return MakeSiteMap($modx, $siteMapRoot, 0, $showDescription, $titleOfLinks,$maxLevels,$showUnpubs,$selfAsLink);
              

              and replace with:
              function MakeSiteMap($funcModx, $listParent, $listLevel, $description, $titleOfLinks,$maxLevels,$su,$selfAsLink,$showSelf,$showUnpubs,$showNotInMenu){
              MakeSiteMap($funcModx,$child['id'],$listLevel+1,$description,$titleOfLinks,$maxLevels,$su,$selfAsLink,$showSelf,$showUnpubs,$showNotInMenu);
              return MakeSiteMap($modx, $siteMapRoot, 0, $showDescription, $titleOfLinks,$maxLevels,$showUnpubs,$selfAsLink,$showSelf,$showUnpubs,$showNotInMenu);
              


              That´s all!

                • 22448
                • 241 Posts
                Hi all,

                i i’m trying to get the ListSite Map to show a folder that is not in a menu and it’s children. the showNotInMenu is set to 1 but nothing shows up. When i check "Show in Menu" on the folder everything shows up. But the problem is that it shows up in the Wayfinder navigation as well, which is not desirable.

                For now i fixed the situation by using the excludeDocs on the wayfinder.

                I’m running MODx 0.9.6.2 on a Lamp server.

                Please let me know if i’m missing something.

                Here’s the call:
                [!ListSiteMap? &showDescription=`0` &titleOfLinks=`longtitle` &showNotInMenu=`1` !]