• Hello,
    I’m using this snippet to add new link to the breadcrumb trail.

    $magazine_item = new bcn_breadcrumb();
            $magazine_item->set_title('Media');
            $magazine_item->set_url(site_url().'/media');

    It worked until the last version of the plugin, now set_url seems not working.
    How can I set a link for an item?

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author John Havlik

    (@mtekk)

    If you are expecting it to cause the breadcrumb to be linked, you need to now call the set_linked() method as well as setting the URL (passing in true to link the breadcrumb). In 6.4.0 the linked state was split out of the URL setting in order to use the unlinked template but still have the URL available for those that want to use the %link% template tag in the unlinked templates (for Schema.org BreadcrubList markup of unlinked items).

    Also, given that you already know the title and URL at creation, you may want to take advantage of the default constructor. That is, something like:
    $magazine_item = new bcn_breadcrumb('Media', null, array(), site_url() . '/media', null, true);

    Thread Starter FoxMulder84

    (@foxmulder84)

    Hello John!
    Thank you for the reply!
    It works perfectly. However can you please explain me the attributes of the constructor new bcn_breadcrumb ? Is there a part of the documentation about it?

    Thank you very much!

    Plugin Author John Havlik

    (@mtekk)

    At the moment, the best reference for core components of Breadcrumb NavXT is the source code itself. There are comments in the code, including PHPDoc blocks for almost all functions.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add link to newly added breadcrumb item’ is closed to new replies.