Announcement

Collapse
No announcement yet.

Modifying the behavior of the smart breadcrumbs

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

    Modifying the behavior of the smart breadcrumbs

    Has anyone done much to customize the behavior of the smart breadcrumbs?

    I'm looking at two things at the moment:
    1. Looking for how the "breadcrumb:links" array is generated.
    2. How to make the link pattern go to a url instead of a category
    For #1 I found this snippet of code in the "User Interface > Settings" area
    Code:
    <mvt:foreach iterator="cats" array="breadcrumbs:links">
    <li itemprop="itemListElement" itemscope itemtype="https://schema.org/ListItem">
    <mvt:if expr="l.settings:cats:name EQ '...'">
    <span itemprop="item" class="cats-hidden"><span itemprop="name">&mvt:cats:name;</span></span><span class="breadcrumb-border">&#47;</span>
    <mvt:elseif expr="l.settings:cats:code EQ l.settings:breadcrumbs:current_item:code">
    <span itemprop="item" class="current-item"><span itemprop="name">&mvt:cats:name;</span></span>
    <mvt:else>
    <a itemprop="item" href="&mvt:cats:link;"><span itemprop="name">&mvt:cats:name;</span></a><span class="breadcrumb-border">&#47;</span>
    </mvt:if> <meta itemprop="position" content="<mvt:eval expr="POS1"/>" />
    </li> </mvt:foreach>
    I can see that it's looping over the information but I can't tell if it's generating the array or iterating over the array.

    Then for #2 I want to adjust the way it dynamically adds the links, that way I can divert the crumbs where I want them to go. As it stands if there's a page in the list, it won't be read by the breadcumbs.

    >> EDIT 20210303_1024 <<

    I found this in the Code Samples, it seems (on the face of it) like it might help. It looks like it's setting the current category and then setting the parent category. Am I reading this right?

    https://docs.miva.com/code-samples/p...tegory-childof
    Last edited by cpp-dev; 03-03-21, 10:26 AM.

    #2
    I think I found a slightly simpler temporary solution; a scripted redirect. -- https://docs.miva.com/code-samples/m...t-to-canonical

    Comment

    Working...
    X