We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23849
    • 223 Posts
    ottogal,

    Thanks so much! Using ditto worked like a charm (no idea why I was so stuck on using wayfinder). The only thing missing from your ditto call was the ’startID’ parameter, but everything else worked perfectly.

    Thanks again.
      Nick Hoag
      Creative Partner
      The FutureForward

      http://thefutureforward.com
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      the startID parameter has been deprecated for years; use &parents instead.
        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
        • 22427
        • 793 Posts
        Some remarks:

        (1) In the Ditto call I meant &sortDir=`ASC` instead of &sortBy=`ASC`.
        It worked anyway, because you can also write &sortBy=`published ASC`, and omitting published Ditto obviously just defaults to createdon.

        (2) If you would like the output be ordered by the menuindex, you have to choose its values carefully in the sub-containers. Controlling by the client users is not easy in that case.
          • 23849
          • 223 Posts
          Great Tips. Thanks so much guys.
            Nick Hoag
            Creative Partner
            The FutureForward

            http://thefutureforward.com
            • 22427
            • 793 Posts
            In this thread mrhaw posted the link http://www.pogwatch.com/ditto/ditto-sort.html which pointed me to the fact that in Ditto 2.1 you should use &orderBy instead of &sortBy and &sortDir (f.e. &orderBy=`menuindex ASC` - the default value is &orderBy=`createdon DESC` ).
              • 32667
              • 38 Posts
              I found a way to do this in Revolution 2.1.5-pl with Wayfinder 2.3.3 generating my breadcrumbs (this would apply similarly for non-breadcrumb usage too). Basically you need a Wayfinder call with ignoreHidden set and then check for hidemenu in your template:

              [[!Wayfinder? &startId=`0` &config=`breadcrumb` &ignoreHidden=`TRUE` &scheme=`full`]]


              Then in core/components/wayfinder/configs, you will have a breadcrumb.config.php that looks like this:

              <?php
              
              $hideSubMenus = 1;
              
              if ($modx->getOption('site_start') == $modx->resource->get('id')) {
              	$homeLink = '';
              } else {
              	$homeLink = "<li><a href=\"{$modx->getOption('site_url')}\" title=\"home\">home</a> ></li>";
              }
              
              $outerTpl = "@CODE:<ul>
              	{$homeLink}[[+wf.wrapper]]
              </ul>";
              
              $innerTpl = '@CODE:[[+wf.wrapper]]';
              
              $rowTpl = '@CODE: ';
              
              $activeParentRowTpl = '@CODE:[[+wf.hidemenu:equalto=`1`:then=`[[+wf.wrapper]]`:else=`<li><a href="[[+wf.link]]" title="[[+wf.title]]">[[+wf.linktext]]</a> > [[+wf.wrapper]]</li>`]]';
              
              $hereTpl = '@CODE:<li>[[+wf.linktext]]</li>';


              Cheers!

              [ed. note: woundedbeer last edited this post 14 years, 9 months ago.]