Controlling Breadcrumb NavXT Settings From the Network Settings Page

Update 2015-10-30: Updated to reflect the default behavior change in Breadcrumb NavXT 5.3.

Starting with Breadcrumb NavXT 5.0, the oft-requested feature for a Network Settings Page for controlling the setting on all subsites in a WordPress multisite setup is now available. Since now there will be a combination of Network Settings and sub site settings, some extra intelligence is needed to pick settings appropriately. Given that the desired behavior will vary depending on use case, a few new globals have been added to switch between settings behavior modes.

Force Network Settings on All Sites (default behavior for 5.0-5.2)

Versions 5.0 through 5.2 used this mode as the default behavior for settings. In this mode, rather than default to the individual site settings (as they were the only ones that existed in WordPress multisite setups prior to Breadcrumb NavXT 5.0). Note, for 5.0 through 5.2, that all other BCN_* defines must be either not set or set to false to select this mode. Note that in 5.0.1 and later you should manually specify this mode:

define('BCN_SETTINGS_USE_NETWORK', true);

Force Individual Site Settings Only (pre-5.0 behavior, default behavior for 5.3+)

In 5.3 the default behavior was reverted to the pre-5.0 behavior of using only the individual sub site settings for Breadcrumb NavXT in a WordPress Multisite setup. Note, for 5.3 and later, that all other BCN_* defines must be either not set or set to false to select this mode. The following must be placed in your wp-config.php (or site specific plugin):

define('BCN_SETTINGS_USE_LOCAL', true);

Favor Individual Site Settings Over Network Settings

In Breadcrumb NavXT 5.0 this settings will merge the local (individual site’s) settings into the network settings (network settings are the ‘defaults’ for the wp_parse_args function). Use the following to enable this mode:

define('BCN_SETTINGS_FAVOR_LOCAL', true);

Note that the behavior of this mode is subtle and likely will look more like the local (individual site’s) settings than the network settings. In the future this mode may change slightly.

Favor Network Settings Over Individual Site Settings

In Breadcrumb NavXT 5.0 this settings will merge the network settings into the local (individual site’s) settings (local site settings are the ‘defaults’ for the wp_parse_args function). Use the following to enable this mode:

define('BCN_SETTINGS_FAVOR_NETWORK', true);

Note that the behavior of this mode is subtle and likely will look more like the network settings than the local (individual site’s) settings. In the future this mode may change slightly.

-John Havlik

[end of transmission, stay tuned]

Trackbacks/Pingbacks

  1. Pingback: Changes to Note Before Upgrading to Breadcrumb NavXT 5.0 | mtekk's Crib

  2. Pingback: Breadcrumb NavXT 5.0.0 | mtekk's Crib

10 thoughts on “Controlling Breadcrumb NavXT Settings From the Network Settings Page

  1. I’m trying the define('BCN_SETTINGS_USE_LOCAL', true); but it doesn’t seams to work.

    I placed to wp-config.php and no no change. I’m using latest 4.4 version. Any toughs ?

    • Martin,

      What are you trying to accomplish/fix by using that code? The code mentioned in this article is only applicable to Breadcrumb NavXT 5.0 (which has not been released yet). Thus the behavior you should observe should not change by setting that define (not only does Breadcrumb NavXT 4.x not know of that define, the specific one you are tying to use is the default behavior in Breadcrumb NavXT 4.x).

      -John Havlik

  2. I’m already using Version 5.0.0
    WITH PARAM:
    define(‘BCN_SETTINGS_USE_LOCAL’, true);

    and still breadcrumbs starts with a link to main domain of network (local homepage is only second)
    for example:
    GlobeCore: Liquids Processing Equipment / Home / Products / Fuel, oil cleaning systems

    How to del first link from there?

    • This define does not control that breadcrumb, it only controls where the settings are pulled from. Use local will pull settings from the subsite (so step 1 in what you need to do). If you don’t want the mainsite breadcrumb to be in the breadcrumb trail for a subsite, you will need to make sure the checkbox next to “Main Site Breadcrumb” is unchecked. This setting is found under the General tab in the Breadcrumb NavXT settings page, it should be near the bottom of the page.

      -John Havlik

  3. Is there a way to force individual site settings but without modifying the wp-config file?

    In our multisite install, I do not have access to that file. I can modify only the theme or plugin files.

    • In theory, you could create a site specific plugin that has a function that hooks into the plugins_loaded action and defines the appropriate constant. Just be sure to hook in at a level 10 or lower (9, 8, etc.) to ensure it runs before Breadcrumb NavXT.

      -John Havlik

  4. Thanks for the info. This was super helpful for me today when trying to get this plugin to work properly on a site that was just imported to our multisite installation. I added define(‘BCN_SETTINGS_USE_LOCAL’, true); to the wp-config, but the local settings were still not being used for the breadcrumbs. I finally realized that the checks in the code (in breadcrumb-navxt.php, as well as for the messaging in the 2 class admin files) use

    if(defined(‘MULTISITE’) && MULTISITE)

    which I had to change to just

    if(MULTISITE)

    in order to get the local settings to be used. Our WordPress installation is pretty old; it started out as WPMU years ago and then when multisite functionality became part of core we went through the upgrade process. During that process, defining MULTISITE doesn’t ever actually get added to wp-config like it does with more modern installation/activation instructions. Since that’s not something that you can just add to the config when a multisite network already exists, it was necessary for me to hack the plugin in order for it work. I just wanted to pass that info along; I hope it’s helpful.

  5. How do I set “starging page” for taxonomies? I can find this dropdown for post types tab but no in the taxonomy tab.

    So what I need is:

    (HOME PAGE) -> (CUSTOM PAGE) -> TAXONOMY TERM -> SUB-TERM -> SUB->TERM etc…

Comments are closed.