We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21056
    • 327 Posts
    It’s not quite so easy, as this page isn’t called from within the Modx framework, so we don’t immediately have access to the $modx object. We’ll have to think about this a bit! I’ve put it in as a config setting at the top.

    @raum -- I’ve implemented something along the lines of what you’ve suggested -- there is now a config setting for "mode" which can be "tree" (new) or "breadcrumbs" (as before).

    Code at the top of this thread is updated.
      Author: ManagerManager plugin - customise your ModX manager interface

      Rckt - web development, Sheffield, UK
      • 19889
      • 616 Posts
      Quote from: ncrossland at Jul 13, 2007, 06:00 AM

      It’s not quite so easy, as this page isn’t called from within the Modx framework, so we don’t immediately have access to the $modx object. We’ll have to think about this a bit! I’ve put it in as a config setting at the top.

      @raum -- I’ve implemented something along the lines of what you’ve suggested -- there is now a config setting for "mode" which can be "tree" (new) or "breadcrumbs" (as before).

      Code at the top of this thread is updated.

      get’s better and better - how about sorting the tree for instance by menuindex?
        • 24530
        • 100 Posts
        @raum -- I've implemented something along the lines of what you've suggested -- there is now a config setting for "mode" which can be "tree" (new) or "breadcrumbs" (as before).


        Great!
          my newest webpage [url=http://gitarren.zucali.at]Meisterwerkstatt f
          • 24530
          • 100 Posts
          I was just playing around with unicode ... just to make the tree view look nicer ;-)
          Just replace line 53 with something like
          $caption .= '┖─ ';

          or
          $caption .= ' ▹ '; 


          ... and you could change line 52 to
          $caption = str_repeat(' ', ($bc_count-2)*4);
            my newest webpage [url=http://gitarren.zucali.at]Meisterwerkstatt f
            • 21056
            • 327 Posts
            I’ve updated again to 1.0.3 which offers the following improvements:


            • Offers different styles for the tree indicator (I prefer the original, but the others raum suggested are there to choose from)
            • Filter out unpublished documents better. This isn’t perfect yet -- it only uses the "published" tick box, rather than publish and unpublish dates. If we were using the modx api this would be much better
            • Sort by menuindex rather than title. This isn’t foolproof -- if two items with the same parent have the same menuindex, it can get confused. The secret is to make sure menuindexes are unique. Again this would be better using the modx api rather than reinventing the wheel
              Author: ManagerManager plugin - customise your ModX manager interface

              Rckt - web development, Sheffield, UK
              • 19889
              • 616 Posts
              Quote from: ncrossland at Jul 13, 2007, 11:00 AM

              I’ve updated again to 1.0.3 which offers the following improvements:


              • Offers different styles for the tree indicator (I prefer the original, but the others raum suggested are there to choose from)
              • Filter out unpublished documents better. This isn’t perfect yet -- it only uses the "published" tick box, rather than publish and unpublish dates. If we were using the modx api this would be much better
              • Sort by menuindex rather than title. This isn’t foolproof -- if two items with the same parent have the same menuindex, it can get confused. The secret is to make sure menuindexes are unique. Again this would be better using the modx api rather than reinventing the wheel

              I think you need to add something like this: $caption = html_entity_decode($caption, ENT_QUOTES); - otherwise I was just getting what I was added here: $tree_styles
                • 24530
                • 100 Posts
                Version 1.0.3 screwed the unicode up:
                $tree_styles = array("|--", "┖─ ", "▹  ", "L  ");

                ... doesn´t show symbols instead of the code. I changed it to
                $tree_styles = array("|--", "┖─ ", "▹  ", "L  ");
                  my newest webpage [url=http://gitarren.zucali.at]Meisterwerkstatt f
                  • 19889
                  • 616 Posts
                  Quote from: raum at Jul 13, 2007, 01:17 PM

                  Version 1.0.3 screwed the unicode up:
                  $tree_styles = array("|--", "┖─ ", "▹  ", "L  ");

                  ... doesn´t show symbols instead of the code. I changed it to
                  $tree_styles = array("|--", "┖─ ", "▹  ", "L  ");


                  see my previous post - that would work as well
                    • 24530
                    • 100 Posts
                    where did you add $caption = html_entity_decode($caption, ENT_QUOTES);? I tried it too ...
                      my newest webpage [url=http://gitarren.zucali.at]Meisterwerkstatt f
                      • 19889
                      • 616 Posts
                      Quote from: raum at Jul 13, 2007, 02:11 PM

                      where did you add $caption = html_entity_decode($caption, ENT_QUOTES);? I tried it too ...

                      around line 79:
                      					$caption = str_repeat(' ', ($bc_count-1)*3);
                      					$caption .= $tree_styles[$tree_style-1];
                      					$caption = html_entity_decode($caption, ENT_QUOTES);
                      					$caption .= $breadcrumbs[$bc_count-1];