We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32756
    • 25 Posts
    I’m having an odd problem with the breadcrumbs snippet, specifically with regards to weblinks. If I have "home >> services >> print >> samples" where the "print" page is a weblink to a documentID within the site, the link URL for "print" is completely wrong. Instead of taking me to the correct link, as in the menu (which is generated with wayfinder), Breadcrumbs takes the visitor to a non-existent URL which ends up at my site’s error page.

    To explain further, instead of going to the weblink that the "print" weblink goes to, which would be documentID #12 and therefore "www.example.com/services/print/printindex.html", Breadcrumbs goes to a URL based on what the friendly URL might be, ie. "www.example.com/services/print.html".

    Is there a workaround for this, or a quick patch I can do to the Breadcrumbs snippet to change this behaviour?

    Thanks. huh
      • 28042 ☆ A M B ☆
      • 24,524 Posts
        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
        • 32756
        • 25 Posts
        Interesting article. After reading it, I had another look through the php code for the Breadcrumbs snippet. The only reference I see to where Breadcrumbs is getting a URL is this line:
        $pretemplateCrumb .= '<a class="'.$crumbClass.'" href="'.$modx->makeUrl($c['id']).'" title="'.$title.'">'.$text.'</a>';

        Based on this, it appears that Breadcrumbs is already getting the reference through ’$modx->makeUrl()’, or am I misunderstanding something?
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I’m not familiar with that snippet; I use Wayfinder to generate breadcrumb trails.
          http://wiki.modxcms.com/index.php/Breadcrumb_navigation_with_Wayfinder
            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
            • 32756
            • 25 Posts
            OK, following the instructions at the link you gave, but having a strange problem there. Must be the way the planets are lined up or something.

            Wayfinder is generating <li> items for every document on the site. Useful for a sitemap, but not so much for breadcrumbs.

            So, now I’m seeing something that looks like so:

            Home >>

            * Home
            * Our Team
            * Contact Us

            Services >> Print

            * Services
            * Print
            * Item 1
            * Item 2

            Samples

            etc.

            I’m not intimately familiar with Wayfinder. Is there a parameter or something I should put in that would hide all of these other links?

            I followed the HowTo as close as possible.
              • 8643
              • 271 Posts
              Try this
              [[Wayfinder? &startId=`0` &config=`breadcrumb` ]]
                • 32756
                • 25 Posts
                Perfect! Thank you.