Advanced

Last updated: April 6th 2021

This is advance code. Synax is same as basic but it has tag pair.

{exp:super_navigation:breadcrumbs} 
    <!-- MY CODE -->
{/exp:super_navigation:breadcrumbs}.

Parameters

To identify which navigation to call, this is required parameter. (you can also use nav_short_name parameter in place of nav_id)

nav_id="1"

To identify which navigation to call, this is required parameter. (you can also use nav_id parameter in place of nav_short_name)

nav_short_name="header_navigation"

site_id

If you are using MSM and wants to show site 1 menu in site 2, you can use this parameter to tell plugin to bring MSM site menu.

wrap

You can wrap basic navigation with either <ul> or <ol>. Default is <ul>

wrap="ul"
wrap="ol"

prefix

You can pass any prefix to change variables of given loop. So if any of the variable match with any parent loop, You can have unique variable that fetch right data.

prefix="link"

disable

For categories and entries URL patterns, We gives facility to bring categories and entries with category parents. That runs extra queries in backend, If you not wish to run those queries and not wish you to bring parent categories to be added into URL, You can pass this parameter.

disable="parent_uri|custom_fields"
// OLD output
http://example.com/blog/category1/category2/blog-url-title

// New output with disable="parent_uri"
http://example.com/blog/category2/blog-url-title

include_self (yes/no)

If you dont wish to return active nav item in breadcrumbs, you can pass this variable to "no". Default behaviour of this variable is "yes".

include_self="no"

self_title

If you want to change title of active entry, You can change with this variable.

self_title="HERE"

reverse (yes/no)

With this parameter you can loop through navigation breadcrumbs in reverse mode.

ul_class

If you wish to add classes to all the wrapper, you can add it here. In basic navigation, all your wrapper can be either <ul> or <ol>.

ul_class="nav"
// All wrapper will assign this class.

li_class

If you wish to add classes to all the <li>, you can add it here.

li_class="nav-li"
// All <li> will assign this class.

active_li_class

If you wish to add a class to all the active <li>, you can add it here.

If you wish to add classes to all the <a> tag, you can add it here.

link_class="nav-link"
// All <a> will assign this class.

If you wish to add a class to all the active <a>, you can add it here.

passive_tag

Only title nodes can be set to a specfic tags like em, span or div instead of <a> by using this parameter.

passive_tag="span"
// Before
<a href="">Passive Link</a>

// After
<span>Passive Link</span>

remove_passive (yes/no)

If you want to remove all Passive (Title only) nodes from breadcrumbs, You can do that with this variable. Default behaviour of this parameter is "no".

remove_passive="yes"

Variables

Here is all the variables you can use with custom breadcrumbs.

This variable will returns the navigation group ID.

This variable will returns the Link ID.

This variable will returns the Link Text. In Entry and Category, Link Text field is Optional. If this field is empty is that case, It will return entry title for Entry and category name for Category.

This variable will return type of link. It can be one of entry, category and url.

This variable will return final link of the navigation item.

This variable will return link string that will be without base url and trialing slash. This is created to pass the URLs into Publisher or Transcribe parse url tags. (That makes this plugin transcribe supported)

{link_string}

// Output 
blog/my-blog-entry

entry_id

This variable will return Entry ID of given link if link type is entry

category_id

This variable will return Category ID of given link if link type is category.

This variable will return order of link. it can be 1..2..3.. in number.

target

This variable will return true (1) if link is set to open in new tab either it will return null.

parent_id

This variable will return Parent ID of given link. If given link is root, it will return 0.

ul_class

This variable will return all the classes added in ul_class and active_ul_class parameter.

li_class

This variable will return all the classes added in li_class and active_li_class parameter.

This variable will return all the classes added in link_class and active_link_class parameter.

count

This variable will return level wise count.

total_results

This variable will return level wise total number of nodes.

absolute_count

This variable will return absolute count no matter which level you are.

absolute_results

This variable will return absolute result count no matter which level you are.

CUSTOM_FIELD

any custom field you added in navigation group can be use here as a variable.

Examples

Here is few examples of advanced breadcrumbs tag.

Advance Breadcrumbs
{exp:super_navigation:breadcrumbs
	nav_short_name="header_navigation"
	ul_class="ul_class"
	li_class="li_class"
	link_class="link_class"
	active_li_class="active_li"
	self_title="Here"
	passive_tag="em"
}
	{if count == 1}
	<ul{if ul_class} class='{ul_class}'{/if}>
	{/if}

		<li{if li_class} class='{li_class}'{/if}>
			{if count != total_results}
			<a href='{if link}{link}{if:else}#{/if}' {if link_class}class='{link_class}'{/if}>
				{link_text}
			</a>
			{if:else}
			<span>{link_text}<span>
			{/if}
		</li>

	{if count == total_results}
	</ul>
	{/if}
{/exp:super_navigation:breadcrumbs}