Breadcrumb
`ff-breadcrumb-trail` displays active searches, filters, and advisor selections as a trail. Use item templates to customize each trail item and its separator.
Documentation
Default templates
When using the element without custom HTML templates, ff-breadcrumb-trail uses default templates.
This means that the separator, which is displayed between the ff-breadcrumb-trail-items, defaults to > and the ff-breadcrumb-trail-item's innerHTML defaults to the {{item.text}} data binding.
<ff-breadcrumb-trail></ff-breadcrumb-trail>Data format
The ff-breadcrumb-trail element reads the breadCrumbTrail list from the search response and renders ff-breadcrumb-trail-item elements from it.
Because the breadcrumb trail is closely related to facets, ff-breadcrumb-trail-item elements receive a data object composed of item and facet which can be accessed in its HTML template.
<!-- Data structure
{
facet: Facet,
item: BreadCrumbTrailItem,
}
-->
<ff-breadcrumb-trail>
<ff-breadcrumb-trail-item type="filter">{{facet.name}}: {{item.text}}</ff-breadcrumb-trail-item>
<ff-breadcrumb-trail-item type="search">Facet is undefined: {{facet}}</ff-breadcrumb-trail-item>
</ff-breadcrumb-trail>Changing the separator appearance
By annotating an HTML element with the data-separator attribute, you tell ff-breadcrumb-trail to use this element as the separator template.
Changing the item appearance
By annotating the ff-breadcrumb-trail-item with the type attribute, you can use this item as the default template for that specific breadcrumb trail type.
Beware of Cross Site Scripting (XSS)
This is particularly dangerous when applied to the breadcrumb trail item of type search.
The search term is often derived from the URL's query parameter. Sharing a link with a maliciously crafted query parameter could cause users who click it to unintentionally run 3rd party code which might attempt to, for example, steal the user's session credentials.
Please see Template Engine for details on data binding.
Demo
API
ff-breadcrumb-trail
Properties
bread-crumb-trail-items (Array) (default: empty)
The breadcrumb data from FactFinder.
show-asterisk-query (String) Options: "true", "false" (default: "false")
Determines if an ff-breadcrumb-trail-item of type search is displayed for a single asterisk query ("*").
Events
dom-updated
This event is triggered when the element has received new data and the template for this element and all sub elements have been punched out.
ff-breadcrumb-trail-item
Properties
bread-crumb-trail-item (Object) (default: empty)
The breadcrumb data from FactFinder.
type (String) Options: "search", "filter", "all", "advisor" (default: "search")
Determines which kind of breadcrumb is present.
Last updated
Was this helpful?