How to Implement RDFa Breadcrumbs with Breadcrumb NavXT

Update 2015-10-04: Beginning with Breadcrumb NavXT 5.3.0, RDFa Breadcrumbs are deprecated in favor of Schema.org BreadcrumbsList, which Google now prefers. Please see the new article on implementing BreadcrumbsList with Breadcrumb NavXT.

While the Google microformats for Breadcrumbs are verbose, ugly, and deprecated, to date, Google still doesn’t support Schema.org breadcrumbs. Thus, we’re going to have to live with the ugly RDFa format for the time being. While there is no ‘one click’ configuration for RDFa breadcrumbs within Breadcrumb NavXT, support for them is not too difficult to configure.

Calling Code Modifications

To begin, the wrapping div for the calling code needs to have xmlns:v="http://rdf.data-vocabulary.org/#" added to it. Below is an example calling code block for users of the regular bcn_display(); function.




<div class="breadcrumbs" xmlns:v="http://rdf.data-vocabulary.org/#">
    <?php if(function_exists('bcn_display')) { bcn_display(); }?>
</div>




Settings Modifications

In general, you need a

<span typeof="v:Breadcrumb">

wrapping around every breadcrumb, and an inner element containing property="v.title" and rel="v:url" if the breadcrumb contains a link. For the most part this will result in two replacements need to be made to all of the breadcrumb templates. For the linked breadcrumb templates, replace:

<a title="Go to %title%." href="%link%">%htitle%</a>

with:

<span typeof="v:Breadcrumb"><a rel="v:url" property="v:title" title="Go to %title%." href="%link%" class="%type%">%htitle%</a></span>

Note the extra span containing the typeof declaration. This is necessary for Google to pick up on the breadcrumb objects (even though the tag is redundant as the property should work on the anchor).

For the unlinked breadcrumb templates, replace:

%htitle%

with:

<span typeof="v:Breadcrumb"><span property="v:title">%htitle%</span></span>

To jumpstart this replacement process, you can import the following Breadcrumb NavXT settings XML file. Breadcrumb NavXT RDFa Breadcrumbs settings file (Right click and select “Save As”).

One Last Thing

Depending on the version of Breadcrumb NavXT, the typeof attribute may not be accepted in the settings (it will get automatically stripped out). To fix this follow the process outlined in How to Add li and Other Tags to Breadcrumb Templates to add the typeof attribute to the span HTML tag. Otherwise, wait for Breadcrumb NavXT 5.1 (or 5.0.2) to be released.

-John Havlik

[end of transmission, stay tuned]

2 thoughts on “How to Implement RDFa Breadcrumbs with Breadcrumb NavXT

    • Akshat,

      I would not worry about it right now. The next release of Breadcrumb NavXT supports the new Schema.org BreadcrumbList RDFa syntax, which Google’s tool has less problems parsing.

      -John Havlik

Comments are closed.