I’m trying to markup our website to take into consideration Google Structured Data so that we can create a better presence in the search engine results pages.
The first thing I’ve tried to have a stab at is implementing breadcrumb structured data, but I’m not having much joy.
The code Squiz recommends to use is this:
<mysource_area id_name="breadcrumb" design_area="asset_lineage" cache="1" print="no">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 tw_no_padding">
<mysource_set name="prefix_with_divider" value="false" />
<mysource_set name="suffix_with_divider" value="true" />
<mysource_set name="prefix_with_home_link" value="false" />
<mysource_set name="suffix_with_current_link" value="false" />
<mysource_set name="show_hidden_links" value="false" />
<mysource_set name="unwanted_asset_types" value="folder" />
<mysource_divider></mysource_divider>
<div class="startbreadcrumb">
<ol class="breadcrumb">
<mysource_asset>
<li>
<mysource_print var="asset_short_name_linked"/>
</li>
</mysource_asset>
<li class="active">
<mysource_print var="asset_short_name"/>
</li>
</ol>
So we’ve implemented that and the breadcrumbs display fine on the site.
Google recommends using this code for the structured data side of things:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Books",
"item": "https://example.com/books"
},{
"@type": "ListItem",
"position": 2,
"name": "Authors",
"item": "https://example.com/books/authors"
},{
"@type": "ListItem",
"position": 3,
"name": "Ann Leckie",
"item": "https://example.com/books/authors/annleckie"
},{
"@type": "ListItem",
"position": 4,
"name": "Ancillary Justice",
"item": "https://example.com/books/authors/ancillaryjustice"
}]
}
</script>
I have no idea how to combine the Google code with the Squiz code so that I have a breadcrumb menu that displays on the site, which also shows up on the search results pages like the examples on the breadcrumb link above (I’d put the link again but I can only include two links in the post!)
I’ve tried putting Squiz keyword replacement into the Google code and bodging it together like this:
<mysource_area id_name="breadcrumb" design_area="asset_lineage" cache="1" print="no">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 tw_no_padding">
<mysource_set name="prefix_with_divider" value="false" />
<mysource_set name="suffix_with_divider" value="true" />
<mysource_set name="prefix_with_home_link" value="false" />
<mysource_set name="suffix_with_current_link" value="false" />
<mysource_set name="show_hidden_links" value="false" />
<mysource_set name="unwanted_asset_types" value="folder" />
<mysource_divider></mysource_divider>
<div class="startbreadcrumb">
<!--Google Structured data breadcrumb markup-->
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "asset_short_name_linked",
"item": "asset_url_linked"
},{
"@type": "ListItem",
"position": 2,
"name": "asset_short_name_linked",
"item": "asset_url_linked"
},{
"@type": "ListItem",
"position": 3,
"name": "asset_short_name_linked",
"item": "asset_url_linked"
},{
"@type": "ListItem",
"position": 4,
"name": "asset_short_name",
"item": "asset_url"
}]
}
</script>
<!-- END Google Structured data breadcrumb markup-->
<ol class="breadcrumb">
<mysource_asset>
<li>
<mysource_print var="asset_short_name_linked"/>
</li>
</mysource_asset>
<li class="active">
<mysource_print var="asset_short_name"/>
</li>
</ol> <!--.breadcrumb-->
</div>
</div>
</mysource_area>
… But I have an overwhelmingly strong feeling that this just won’t work.
For 1, Squiz dynamically populates the preceeding pages based on asset linking (it looks at the current asset, then looks back up the tree to figure out the preceeding pages and builds the breadcrumbs out of that). I have no idea how to fashion this code to take this dynamically generated content into consideration.
Has anyone implemented Google Structured Data on their sites? And can anyone help us out here?
Many thanks
Kane