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]

Help! I Can’t Save My Settings After Upgrading Breadcrumb NavXT

After upgrading from a version of Breadcrumb NavXT older than 4.2, you may see the following message when attempting to save your Breadcrumb NavXT settings:

Value must be greater than or equal to 1.

This message is caused by the value of “Max Title Length” being less than 1. Some modern web browsers, such as Chrome will display this warning (and in some cases it may appear to come from the admin bar as in the leading screenshot). While, others, such as Firefox, will not (and will not prevent you from saving your settings).

To fix this issue, change the value of “Max Title Length” to be greater than 0. If you do not want your breadcrumb titles to be restricted in length, make sure “Limit the length of the breadcrumb title.” remains unchecked. You should now be able to save your settings.

Some Background

Back in Breadcrumb NavXT 4.2, the breadcrumb “Max Title Length” setting was split into an enable switch for restricting the length of breadcrumb title and a second option for specifying the maximum length. Previously, setting the max breadcrumb title length to 0 was interpreted as disabling the title length trim feature. This was not entire intuitive hence the switch.

When this switch was made, the new “Max Title Length” was changed to the HTML5 number form input element, with a minimum value set to 1. Additionally, Breadcrumb NavXT started shipping with 20 being the default “Max Title Length” value, with the title trim feature turned off by default. Thus, new users of the plugin will never see this issue. Additionally, the next release of Breadcrumb NavXT will have a modification which will not allow Max Title Length to be 0 when a user upgrades versions (will automatically correct it to the new default of 20).

-John Havlik

[end of transmission, stay tuned]

Breadcrumb NavXT 5.0.1

This is the first bug fix release of the 5.0 branch of Breadcrumb NavXT. There were several issues reported with the 5.0.0 release and most have been fixed in this release. An issue where the bcn_display_list() produced duplicate code attributes in the output. The settings page tabs’ style has been adjusted to fit better with WordPress 3.8’s reskinned admin area. Additionally, users will be warned if their settings will be overridden by a BCN_SETTINGS_* define. Finally, a few issues in the uninstaller caused by the change in plugin structure were fixed.

As always, you can grab the latest version of Breadcrumb NavXT from the Breadcrumb NavXT page. If you experience any issues with this version of Breadcrumb NavXT, please leave a comment on this post detailing the issue.

-John Havlik

[end of transmission, stay tuned]

Help! I’m Getting an Error Message After Upgrading Breadcrumb NavXT to 5.0.1

Starting with Breadcrumb NavXT 5.0.1 (and running through the 5.1.x releases) the message below may appear when you update the plugin from a pre 5.0 version (e.g. 4.4):

Breadcrumb NavXT was just updated from a pre-5.0 version, please go to your plugins page and activate “Breadcrumb NavXT”. Also, deactivate “Breadcrumb NavXT 5.0 Migration Compatibility Layer” to make this message disappear.

To make this message disappear, navigate to the Plugins section of the WordPress admin. First, you will notice “Breadcrumb NavXT” in the list of plugins is not active, at this time you will want to activate it. Next, you will see a plugin named “Breadcrumb NavXT 5.0 Migration Compatibility Layer DO NOT ACTIVATE” deactivate this plugin.

Why is this Necessary?

In version 5.0, the file layout of Breadcrumb NavXT was reorganized. Due to this reorganization the plugin header information moved from breadcrumb_navxt_admin.php to breadcrumb-navxt.php. Additionally, breadcrumb_navxt_admin.php was removed from 5.0. Unfortunately, WordPress does not handle the change in plugin header location very nicely. Starting with 5.0.1, breadcrumb_navxt_admin.php was added back to the plugin, with a plugin header. However, this file now only exists to serve the notice to users about activating the plugin. Additionally, in Breadcrumb NavXT 5.2 this file will no longer be included with the release.

No, Really, Why is this Necessary?

Yes, the breadcrumb_navxt_admin.php file could automatically activate the new plugin file, and then deactivate itself. However, that sort of behavior is something plugins probably should not be doing, especially ones that are distributed from WordPress.org. So instead, the end user will have to intervene.

-John Havlik

[end of transmission, stay tuned]

Breadcrumb NavXT 5.0.0

Holy Network Admin settings page Batman! As mentioned earlier, starting with 5.0, Breadcrumb NavXT now includes a Network Admin settings page and several settings modes to set the flow down of settings in multisite WordPress installs. The details on the changes in the flow of settings is covered in Controlling Breadcrumb NavXT Settings From the Network Settings Page.

In addition to the new Network Admin settings page, a major refactoring of the plugin has taken place. File organization has changed, with each class residing in its own file. A new top level loader class now exists so that the settings pages are only loaded when necessary. For more on the organizational changes in 5.0 please read Changes to Note Before Upgrading to Breadcrumb NavXT 5.0.

Three new filters were added in 5.0 these are:

  • bcn_breadcrumb_trail_object
  • bcn_li_attributes
  • bcn_breadcrumb_types

Please see the Breadcrumb NavXT Documentation for more information on these and other filters.

Additionally, xmlns:v and property were added as valid HTML tag attributes to aid in support of microformat breadcrumb standards. A few bugs were fixed, including a bug where the current item could have the wrong protocol (HTTP instead of HTTPS) in search result pages. Finally, you may need to reactivate Breadcrumb NavXT since the file containing the plugin header changed in 5.0.

The Translation Team:

[glot-translators=breadcrumb-navxt]

As always, you can grab the latest version of Breadcrumb NavXT from the Breadcrumb NavXT page. If you experience any issues with this version of Breadcrumb NavXT, please leave a comment on this post detailing the issue.

-John Havlik

[end of transmission, stay tuned]