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

    I'm hoping someone can help. I would like to use the breadcrumb snippet to show the trail of pages the user has visited. At the moment it is working (sort of) however instead of showing the trail of resources the user has visited it shows the folder structure. For example:

    I have a list of product pages in the parent folder 'product pages'. In a different parent folder called 'products' I have product category pages. The user clicks on the category page, selects a category which then links to the product page.

    When in the product page I want the user to see main page>>category>>sub category>>product page. At the moment is user sees main page>>product page.

    Here is the code.

    [!Breadcrumbs? &showCurrentCrumb=`1`&showHomeCrumb=`0` &respectHidemenu=`1` &maxCrumbs=`10` &homePageId=`1`!]


    Hope that all makes sense. Any help appreciated.

    Lisa
      • 3749
      • 24,544 Posts
      Breadcrumbs will always show the path to the current page from the root, regardless of the route the user took to get there.

      If you think about it, Breadcrumbs has no way of knowing how the user got to the current page except for the previous page being available in the $_SERVER array (and that's not always reliable on some servers).

      To show the user's actual route, you'd have to do something like creating a $_SESSION variable and appending the current page's alias to it on every page visit. It's not very practical because you can end up with a very long list with (potentially) a lot of repetition as the user wanders around the site.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting