Breadcrumb nav and integrating schema.org/BreadcrumbList


(Heath Nicholson) #1

Hiya,

 

I'm trying to implement the schema.org breadcrumb mark-up but I run into a problem with asset iterations in the middle of the lineage.

The problem is to do with the content attribute in the <meta itemprop="position" content="2" /> tag.

Since the top level parent and final crumbs are static and the assets in between these are dynamic, I was wondering if there was any way to get the content value to increase incrementally with the addition of extra breadcrumbs.

 

Here's what the breadcrumb nav currently looks like with the schema.org markup included:

<ul class="breadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList">     <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
        <a href="#" title="title" itemprop="item"> <span itemprop="name">Home</span></a> &nbsp; <span class="icon-angle-right"> </span>
        <meta itemprop="position" content="1" />
    </li>
    <MySource_AREA id_name="page_lineage" design_area="asset_lineage">
        <MySource_SET name="prefix_with_home_link" value="true" />
        <MySource_SET name="suffix_with_current_link" value="false" />
        <MySource_SET name="prefix_with_divider" value="true" />
        <MySource_SET name="suffix_with_divider" value="true" />
        <MySource_SET name="show_hidden_links" value="false" />
        <MySource_SET name="unwanted_asset_types" value="folder" />
        <MySource_ASSET>
            <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><aitemprop="item" href="<MySource_PRINT var=" asset_link " />">
                <span itemprop="name"><MySource_PRINT var="asset_short_name" /></span></a> &nbsp; <span class="icon-angle-right"> </span>
                <meta itemprop="position" content="2" />
            </li>
        </MySource_ASSET>
        <MySource_DIVIDER></MySource_DIVIDER>
    </MySource_AREA>
    <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
        <span itemprop="name"><MySource_PRINT id_name="__global__" var="asset_name"/></MySource_PRINT></span>
        <meta itemprop="position" content="3" />
    </li>
</ul>

 

Any suggestions appreaciated

Thanks


(Bart Banda) #2

Hmm, the only way I can think of doing this is with a replace keyword modifier, possibly regex required as well. Basically you would count the number of forward slashes in the %asset_url% value of the asset and then print the number based off that.

 

But not sure if your structure is setup in such a way that that's always consistent?