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

    I am new to ModX. I working on my first webpage and i am getting along quite well.

    I have a question regarding the snippet breadcrumbs: I use it to do the normal navigation line above the content. It works fine on every page exept the homepage, where it displays a double entry of this homepage, like

    Home —» Home

    The call is in a junk, the code reads

    <div id="Navzeile">
    <base href="[(site_url)]" />
    [!Breadcrumbs? &templateSet=`myString` &homePageId=`1` &showCrumbsAtHome=`1`!]
    </div>

    template myString is a copy of defaultString with just the seperator changed.

    Does anybody understand, why I get this double Home->Home on the Homepage and - more importent - what I can do to prevent this?

    Thank you for any comments!




      • 33337
      • 3,975 Posts
      Quote from: rscha at Sep 01, 2009, 03:06 AM

      Hi everybody,

      I am new to ModX. I working on my first webpage and i am getting along quite well.

      I have a question regarding the snippet breadcrumbs: I use it to do the normal navigation line above the content. It works fine on every page exept the homepage, where it displays a double entry of this homepage, like

      Home —» Home

      The call is in a junk, the code reads

      <div id="Navzeile">
      <base href="[(site_url)]" />
      [!Breadcrumbs? &templateSet=`myString` &homePageId=`1` &showCrumbsAtHome=`1`!]
      </div>

      template myString is a copy of defaultString with just the seperator changed.

      Does anybody understand, why I get this double Home->Home on the Homepage and - more importent - what I can do to prevent this?

      Thank you for any comments!

      Remove &showCrumbsAtHome=`1` from the call.

      And, its "chunk" ... not "junk" tongue
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 25630
        • 22 Posts
        Sorry for the junk - as you might have guessed, I am not of english mother tongue - but in the meantime I got the difference embarrassed!

        If I do as you suggest, there is no Breadcrumbs entry on the Homepage at all. But I would prefer it to read "Home" - in line with all the other pages, where the last entry is the currently viewed page. How can I achieve that?



          • 24359
          • 1 Posts
          how about this?
          [[Breadcrumbs? &showCurrentCrumb=`1` &showHomeCrumb=`0` &showCrumbsAtHome=`1`]]
          so when user is in "home", it will shows "current crumb" that is "home".
          Hope it solve the problems..
            now smiley redefine smile
            • 25630
            • 22 Posts
            Thanks for your answer.

            If I do as you propose, I get indeed a single "Home" on the Homepage, but then there is no Homelink on all other pages, which is still not exactly what I would prefer.

            Any more suggestions? Nobody came across this problem yet?
              • 33337
              • 3,975 Posts
              This is not a problem, but a special use case in your development.

              You need 2 different calls for the output of 2 different set of breadcrumbs. Either you can do it via creating 2 templates, 1 for homepage and other for the rest. Put the "without Home" call in the homepage template and put "with Home" call in the other template. Then assign appropriate template to the documents.

              Other way is to use PHx plugin which provides a layer of conditionals in easy to understand manners and can be handy on things like this. Using PHx you wont have to use the 2 different templates. But relying too much on PHx could be a bad habbit.

              3rd way is to do same thing, is to write simple snippet which determines the current page and outputs the appropriate breadcrumb call.

              Choose 1 of them and you are good. smiley

              All the best.
                Zaigham R - MODX Professional | Skype | Email | Twitter

                Digging the interwebs for #MODX gems and bringing it to you. modx.link
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                Or even a TV with the default value being the regular snippet call, then on the home page edit it to be the home-page specific call.
                  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
                  • 33337
                  • 3,975 Posts
                  Quote from: sottwell at Sep 03, 2009, 05:11 AM

                  Or even a TV with the default value being the regular snippet call, then on the home page edit it to be the home-page specific call.
                  4 ways to implement the same thing in MODx! ... I am sure there must be more. Just choose what you like. wink
                    Zaigham R - MODX Professional | Skype | Email | Twitter

                    Digging the interwebs for #MODX gems and bringing it to you. modx.link
                    • 25630
                    • 22 Posts
                    I implemented the idea of Susan. Works pefectly - exactly what I had in mind!

                    Many thanks to all of you!