Announcement

Collapse
No announcement yet.

Odd Breadcrumb Behavior

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Odd Breadcrumb Behavior

    I have a site using the Iron and Wool ReadyTheme where the breadcrumbs are behaving very oddly on the category page.

    Code:
        <mvt:if expr="NOT (l.settings:page:code CIN g.screenCheck) AND l.settings:page:code NE 'SFNT'">
            <div class="row breadcrumbs">
                <nav class="column whole wrap float-none large-np">
                    <ul>
                        <li><a href="https://&mvt:global:domain:name;" title="Home" class="breadcrumb-home">Home</a><span class="breadcrumb-border">&#47;</span></li>
                        <mvt:foreach iterator="cats" array="breadcrumbs:links">
                            <mvt:item name="customfields" param="Read_Category_Code(l.settings:cats:code,'no_crumb',g.exclude_ctgy)" />
                            <mvt:if expr="NOT(g.exclude_ctgy EQ 'yes')">
                                <mvt:if expr="l.settings:cats:name EQ '...'">
                                    <li><span class="cats-hidden">&mvt:cats:name;</span><span class="breadcrumb-border">&#47;</span></li>
                                <mvt:elseif expr="l.settings:cats:code EQ l.settings:breadcrumbs:current_item:code">
                                    <li><span class="current-item">&mvt:cats:name;</span></li>
                                <mvt:else>
                                    <li><a href="/ctgy/&mvt:cats:code;" title="&mvt:cats:name;">&mvt:cats:name;</a><span class="breadcrumb-border">&#47;</span></li>
                                </mvt:if>
                            </mvt:if>
                        </mvt:foreach> <!-- &mvt:breadcrumbs:current_item:name; -->
                    </ul>
                </nav>
            </div>
            <!-- end breadcrumbs -->
        </mvt:if>

    HTML Output onto CTGY page:


    Code:
    <div class="row breadcrumbs">
        <nav class="column whole wrap float-none large-np">
            <ul>
                <li><a href="domain.com" title="Home" class="breadcrumb-home">Home</a><span class="breadcrumb-border">&#47;</span></li>
                <li><span class="current-item">Parent Category</span></li>
                <li><a href="/ctgy/category" title="Current Category">Current Category</a><span class="breadcrumb-border">&#47;</span></li>
                <!-- Parent Category -->
            </ul>
        </nav>
    </div>
    <!-- end breadcrumbs -->
    So instead of linking to the parent category, it is treating the parent cat as though it is the currently active cat. The toolkit was used to get around this on the alternate display pages, but I'm trying to clean up old toolkit code where possible and would prefer to use the built in code. Any ideas what could be causing this?


    #2
    Hi Leanne,

    Which Tool Kit function were you using/are you trying to replace and can you post a link to the site?
    Matt Zimmermann

    Miva Web Developer
    Alchemy Web Development
    https://www.alchemywebdev.com
    Site Development - Maintenance - Consultation

    Miva Certified Developer
    Miva Professional Developer

    https://www.dev4web.net | Twitter

    Comment


      #3
      This is the tool kit code that is currently working:

      Code:
          <div class="row breadcrumbs">
              <nav class="column whole wrap float-none large-np">
                  <ul>
                      <mvt:item name="toolkit" param="breadcrumb|b_count|g.Category_Code" />
                      <mvt:if expr="b_count GT 2">
                          <li><a href="https://&mvt:global:domain:name;" title="Home" class="breadcrumb-home">Home</a><span class="breadcrumb-border">&#47;</span></li>
                          <mvt:foreach iterator="breadcrumb" array="breadcrumbs">
                              <mvt:item name="customfields" param="Read_Category_Code(l.settings:breadcrumb:code,'no_crumb',g.exclude_ctgy)" />
                              <mvt:if expr="NOT(g.exclude_ctgy EQ 'yes')">
                                  <mvt:if expr="g.Category_Code EQ l.settings:breadcrumb:code">
                                      <li><span class="current-item">&mvt:breadcrumb:name;</span></li>
                                  <mvt:else>
                                      <li><a href="/ctgy/&mvt:breadcrumb:code;" title="&mvt:breadcrumb:name;">&mvt:breadcrumb:name;</a><span class="breadcrumb-border">&#47;</span></li>
                                  </mvt:if>
                              </mvt:if>
                          </mvt:foreach>
                      </mvt:if>
                  </ul>
              </nav>
          </div>
      I'll PM you a link to a page that has the incorrect behavior.

      Comment


        #4
        Hi Leanne,

        From looking at this code, you are checking if there are more than two breadcrumbs before listing them. Then, if the category is not set to be excluded, you are displaying the results and checking if you are on the current category. Correct?
        Matt Zimmermann

        Miva Web Developer
        Alchemy Web Development
        https://www.alchemywebdev.com
        Site Development - Maintenance - Consultation

        Miva Certified Developer
        Miva Professional Developer

        https://www.dev4web.net | Twitter

        Comment


          #5
          Yes, that is correct.

          Comment


            #6
            Hi Leanne,

            Although this won't cover the "if more than two" scenario, see if this corrects the other issue:
            Code:
            <mvt:if expr="NOT (l.settings:page:code CIN g.screenCheck) AND l.settings:page:code NE 'SFNT'">
                <div class="row breadcrumbs">
                    <nav class="column whole wrap float-none large-np">
                        <ul>
                            <li><a href="https://&mvt:global:domain:name;" title="Home" class="breadcrumb-home">Home</a><span class="breadcrumb-border">&#47;</span></li>
                            <mvt:foreach iterator="cats" array="breadcrumbs:links">
                                <mvt:item name="customfields" param="Read_Category_Code(l.settings:cats:code,'no_crumb',g.exclude_ctgy)" />
                                <mvt:if expr="g.exclude_ctgy EQ 'yes'">
                                <mvt:elseif expr="l.settings:cats:name EQ '...'">
                                    <li><span class="cats-hidden">&mvt:cats:name;</span><span class="breadcrumb-border">&#47;</span></li>
                                <mvt:elseif expr="l.settings:cats:code EQ l.settings:breadcrumbs:current_item:code">
                                    <li><span class="current-item">&mvt:cats:name;</span></li>
                                <mvt:else>
                                    <li><a href="/ctgy/&mvt:cats:code;" title="&mvt:cats:name;">&mvt:cats:name;</a><span class="breadcrumb-border">&#47;</span></li>
                                </mvt:if>
                            </mvt:foreach>
                        </ul>
                    </nav>
                </div>
                <!-- end breadcrumbs -->
            </mvt:if>
            Matt Zimmermann

            Miva Web Developer
            Alchemy Web Development
            https://www.alchemywebdev.com
            Site Development - Maintenance - Consultation

            Miva Certified Developer
            Miva Professional Developer

            https://www.dev4web.net | Twitter

            Comment


              #7
              Unfortunately, that didn't resolve the problem.

              Comment


                #8
                Hi Leanne,

                Unfortunately, it looks like we cannot modify Smart Breadcrumbs to work like this particular Tool Kit function. You will probably have to create some custom logic through some MVT:DO functions to get what you had with Tool Kit.
                Matt Zimmermann

                Miva Web Developer
                Alchemy Web Development
                https://www.alchemywebdev.com
                Site Development - Maintenance - Consultation

                Miva Certified Developer
                Miva Professional Developer

                https://www.dev4web.net | Twitter

                Comment


                  #9
                  Thanks for trying! I'll see what I can figure out.

                  Comment

                  Working...
                  X