We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30596
    • 19 Posts
    Quote from: jaredc at May 22, 2008, 08:32 AM

    That works.

    Another solution would be to create a web link in MODx pointing to your home page. It could be in an out of the way place (not in the browse-able hierarchy) and then set the home crumb to this link. The advantage to this technique would be all breadcrumb links would be handled by the Breadcrumbs snippet. This is of interest when considering styling because the first crumb will get the first_crumb class assigned to it. If you were to just add that crumb in your template, then the second crumb would have the class first_crumb - which may not matter to you, but then again it might. Or it might in the future.

    Just a thought.

    Thank you. That is a good idea. Hadn’t thought of that and that would be an easy solution. I appreciate your time responding.
      • 5091
      • 332 Posts
      In the ’defaultList’ template, the code shows:
      ’defaultList’ => array(
              ’crumb’ => ’<li>[+crumb+]</li>’,
              ’separator’ => ’’,
              ’crumbContainer’ => ’<ul class="[+crumbBoxClass+]">[+crumbs+]</ul>’,
              ’lastCrumbWrapper’ => ’<span class="[+lastCrumbClass+]">[+lastCrumbSpanA+]</span>’,
              ’firstCrumbWrapper’ => ’<span class="[+firstCrumbClass+]">[+firstCrumbSpanA+]</span>’
          ),                       


      and I get this output
      <ul class="B_crumbBox"><li><span class="B_lastCrumb"><span class="B_firstCrumb"><span class="B_currentCrumb">Memberships</span></span></span></li></ul>

      Not very semantical eh?!

      I changed the span to ’li’ but it gives me this:
      <ul class="B_crumbBox"><li><li class="B_lastCrumb"><li class="B_firstCrumb"><span class="B_currentCrumb">Memberships</span></li></li></li></ul>


      If I remove this:
      ’lastCrumbWrapper’ => ’<li class="[+lastCrumbClass+]">[+lastCrumbSpanA+]</li>’,
              //        ’firstCrumbWrapper’ => ’<li class="[+firstCrumbClass+]">[+firstCrumbSpanA+]</li>

      the markup is correct but nothing shows up
      <ul class="B_crumbBox"><li></li></ul>

      I need it to show only this:
      Page
      <ul class="B_crumbBox">
       
      <li>page</li>
      </ul>

      and If the Home is showed and the page is a subpage from a container, it looks like this:
      Home > Container > Subpage
      <ul class="B_crumbBox">
        <li>Home</li>
      <li>Container</li>
      <li>Subpage</li>
      </ul>

      I see Magento and a Menu script from PVll are able to produce a markup like above and they both use javascript, so it must be possible to do it with the Breadcrumb script, but I don’t know how to make my template. huh embarrassed

      Can anyone shows me how?

      Thanks!
        • 13577
        • 302 Posts
        Quote from: chinesedream at May 25, 2008, 06:09 AM

        ...
        and I get this output
        <ul class="B_crumbBox"><li><span class="B_lastCrumb"><span class="B_firstCrumb"><span class="B_currentCrumb">Memberships</span></span></span></li></ul>
        Not very semantical eh?!
        Actually, since you only have one crumb in your list, yes it is. It is the first and last and current crumb. I don’t remember ever specifically testing the one crumb scenario, but it makes sense that that’s what the output would be.

        If you don’t want the first/last/current spans to be in there - then you might try something like this (note you can add this as a NEW template set, so the default remains):

        'plainList' => array(
                'crumb' => '<li>[+crumb+]</li>',
                'separator' => '',
                'crumbContainer' => '<ul class="[+crumbBoxClass+]">[+crumbs+]</ul>',
                'lastCrumbWrapper' => '[+lastCrumbSpanA+]',
                'firstCrumbWrapper' => '[+firstCrumbSpanA+]'
        ),
        

        If you don’t want your crumbs to be links, as in your example, then turn them off with the $showCrumbsAsLinks parameter:
        &showCrumbsAsLinks=`0`

        Even so you’ll still be left with a span around each crumb that isn’t a link. Looks like I left that un-template-able, so I’ll add that to the list of things to do for the next release. But it really shouldn’t hurt you - just don’t write styles for them and they should act like they’re not there. Actually that would be true of the first/last/current spans as well.

        Feature request: (Note to self)
        Make span/link around each crumb template-able
          Standard Disclaimer
          I could be totally wrong.
          • 5091
          • 332 Posts
          Quote from: jaredc at May 28, 2008, 07:51 AM


          Actually, since you only have one crumb in your list, yes it is. It is the first and last and current crumb. I don’t remember ever specifically testing the one crumb scenario, but it makes sense that that’s what the output would be.


          Jaredc, thank you so much! That was a bad example laugh I do need more than one crumb. It was the first test and I didn’t bother to turn on the ’Home’.

          Will test it again!
            • 5091
            • 332 Posts
            Quote from: jaredc at May 28, 2008, 07:51 AM


            ...
            and I get this output
            <ul class="B_crumbBox"><li><span class="B_lastCrumb"><span class="B_firstCrumb"><span class="B_currentCrumb">Memberships</span></span></span></li></ul>
            Not very semantical eh?!
            Actually, since you only have one crumb in your list, yes it is. It is the first and last and current crumb. I don’t remember ever specifically testing the one crumb scenario, but it makes sense that that’s what the output would be.

            If you don’t want the first/last/current spans to be in there - then you might try something like this (note you can add this as a NEW template set, so the default remains):

            'plainList' => array(
                    'crumb' => '<li>[+crumb+]</li>',
                    'separator' => '',
                    'crumbContainer' => '<ul class="[+crumbBoxClass+]">[+crumbs+]</ul>',
                    'lastCrumbWrapper' => '[+lastCrumbSpanA+]',
                    'firstCrumbWrapper' => '[+firstCrumbSpanA+]'
            ),
            

            Hi Jaredc,

            OK, now the output is
            <ul class="B_crumbBox">
            <li><a class="B_homeCrumb" href="/home.html" title="title text">Home</a></li>
            <li><a class="B_crumb" href="/club_benefits.html" title="tttt">Club Benefits</a></li>
            <li><span class="B_currentCrumb">Personal Training</span></li>
            </ul


            When I said it wasn’t very semantical, I meant the nested span classes. Now this new plainList does produce semantical output, I am curious, is it possible to modify it to insert the ’currentCrumb’ directly in the last <li>like so:
            <li  class="B_currentCrumb">Personal Training</li>

            It looks a lot cleaner to me smiley, also there is an incentive to place the class directly in the <li>, for example, if you use background image or border (right) as seperator, there is no way to ’border-right:none’ for the last <li> right now.

              • 28033
              • 925 Posts
              In my website, I have this kind of setup (CAPS = unpublished folders)...

              MERCHANDISE > XBOX360 > Tales of Vesperia

              Is there any way to include the unpublished folders, but bold them (like w/ the current page, if it’s set to not include a link attached to it)? I like to use unpublished folders for organizing, so a fix for this would be very helpful. smiley
                My Snippets
                -> PopUpChunk v1.0
                • 13577
                • 302 Posts
                No. There is currently no way to do that. The problem with unpublished documents is that it would be very difficult for Breadcrumbs to determine if it were an "important" unpublished document (to be shown) or not. The general assumption is that if your document is unpublished, you don’t want it seen.
                  Standard Disclaimer
                  I could be totally wrong.
                  • 32645
                  • 377 Posts
                  Hi, I have a problem.

                  I use [[Breadcrumbs]] and its working fine, however on deeper pages the phrase/link "Home" shows twice in breadcrumb.

                  I am using friendly alias path on.
                    • 7923
                    • 4,213 Posts
                    Don’t know what the problem is in your case, but just as a hint if you didn’t know Wayfinder can also be used to create breadcrumb links.. I believe there’s ready made config for that floating in these forums or in the Wayfinder package... or in it’s demo site.


                      "He can have a lollipop any time he wants to. That's what it means to be a programmer."
                      • 32645
                      • 377 Posts
                      OK, I’ll just use wayfinder.