Breadcrumbs

Breadcrumbs Module/Widget

Including breadcrumbs

The breadcrumbs  module/widget can be included in a page via the page_o.modules collection and can be referenced in an html page using the location or position in the template or by module type = mod_breadcrumbs. We are iterating through the modules collection and if the module position equals "heading-a" process the tags. If the URL of the page equals the URL of the breadcrumb then $item.active is TRUE

<!--#4DEACH $module in page_o.modules--> // The collection of modules/widgets assigned to the page
<!--#4DIF($module.position="heading-a")--> // The module position
<nav class="d-inline-block" aria-label="breadcrumb">

  <ol class="breadcrumb">
    <!--#4DEACH $item in $module.breadcrumbs-->
    <!--#4DIF $item.active--> // Active breadcrumb do not include the URL
    <li class="breadcrumb-item active" aria-current="page">
      <!--#4DTEXT $item.title-->
    </li>
    <!--#4DELSE-->
    <li class="breadcrumb-item"><a href="<!--#4DTEXT $item.path-->"> // not active link include URL
        <!--#4DTEXT $item.title--></a></li>

    <!--#4DENDIF-->
    <!--#4DENDEACH-->
  </ol>
</nav>
<!--#4DENDIF-->
<!--#4DENDEACH-->

 
Breadcrumbs Data

The breadcrumbs JSON example of page_o.modules object which contains the $module.breadcrumbs collection. 

{
    "breadcrumbs": [
        {
            "title": "Support",
            "class": "", // Optional class defined in the module options
            "path": "/support",
            "active": false,
            "home": 0 // Equals 1 for the home page menu
        },
        {
            "title": "Templates",
            "class": "",
            "path": "/support/templates",
            "active": false,
            "home": 0
        },
        {
            "title": "Breadcrumbs",
            "class": "active",
            "path": "/templates/breadcrumbs",
            "active": true,  // True for current page
            "home": 0
        }
    ]
}