Module: alfresco/documentlibrary/AlfBreadcrumbTrail

alfresco/documentlibrary/AlfBreadcrumbTrail

This widget can be used to render breadcrumb trails. It can be used either to render a fixed set of breadcrumbs (e.g. where you might want to render some information about a fixed location of a page) or it can be used to render path based data. When rendering path based data it is possible to get the path from the browser URL hash or from explicitly configured path publishing topics. When rendering a path based breadcrumb trail it is expected that the last item in the trail represents the current location and clicking it can either navigate the user to another page (in which case you should set the lastBreadcrumbPublishTopic and other associated attributes). Clicking on any other breadcrumb in the trail is expected to simply publish information about the selected path.

Each element in the trail is rendered by the AlfBreadcrumb widget. This module should be extended and the renderBreadcrumb function overridden if an alternative widget needs to be used.

Author:
  • Dave Draper
License:
Source:

Members

_filterDisplayed :boolean

This boolean flag is used to indicate whether or not a filter is being displayed rather than a breadcrumb trail. This should not be configured or changed as it is used to maintain the internal state of the widget. It is necessary to keep track of whether or not a filter is displayed to determine what actions to take when the current node changes.
Type:
  • boolean
Default Value:
  • false
Source:
An array of fixed breadcrumbs to render. Each breadcrumb needs to have a "label" attribute and can also optionally include "publishTopic" and "publishPayload" attributes if clicking on the breadcrumb should have an action.
Type:
  • object[]
Default Value:
  • null
Source:

cssRequirements :object[]

An array of the CSS files to use with this widget.
Type:
  • object[]
Default Value:
  • [{cssFile:"./css/AlfBreadcrumbTrail.css"}]
Source:

currentNode :object

The current Node that content will be worked relative to.
Type:
  • object
Default Value:
  • null
Source:

currentPath :string

A path to use as a breadcrumb trail. This is a simple alternative to defining invidual breadcrumbs but gives less flexibility over what clicking on the breadcrumbs do.
Type:
  • string
Default Value:
  • "/"
Source:

hide

Indicates whether or not to hide the breadcrumb trail when first instantiated.
Default Value:
  • false
Source:

i18nRequirements :object[]

An array of the i18n files to use with this widget.
Type:
  • object[]
Default Value:
  • [{i18nFile: "./i18n/AlfBreadcrumbTrail.properties"}]
Source:

lastBreadcrumbIsCurrentNode :boolean

This indicates that the final breadcrumb in the trail is
Type:
  • boolean
Default Value:
  • false
Source:

lastBreadcrumbPublishGlobal :boolean

Indicates whether or not the clicking on the last breadcrumb publishes on the gloabl scope. This defaults to true because it is expected that the last breadcrumb will be a page navigation and therefore need to publish to a globally subscribing NavigationService.
Type:
  • boolean
Default Value:
  • true
Source:

lastBreadcrumbPublishPayload :object

This is the payload that is published when the final breadcrumb in the trail is clicked.
Type:
  • object
Default Value:
  • null
Source:

lastBreadcrumbPublishPayloadItemMixin :boolean

Indicate whether or not the "currentItem" object will be mixed into the lastBreadcrumbPublishPayload. By default this is set to false because it is not expected that there will typically be a "currentItem" object set.
Type:
  • boolean
Default Value:
  • false
Source:

lastBreadcrumbPublishPayloadModifiers :string[]

An array of the modifying functions that will be applied to the lastBreadcrumbPublishPayload if the [lastBreadcrumbPublishPayloadType]{@link module:alfresco/documentlibrary/AlfBreadCrumbTrail#lastBreadcrumbPublishPayloadType} is configured to be "PROCESS".
Type:
  • string[]
Default Value:
  • null
Source:

lastBreadcrumbPublishPayloadType :string

This is the type of payload that is published when the final breadcrumb in the trail is clicked. By default it will use the lastBreadcrumbPublishPayload exactly as it is configured.
Type:
  • string
Default Value:
  • "CONFIGURED"
Source:

lastBreadcrumbPublishToParent :boolean

Indicates whether or not the clicking on the last breadcrumb publishes on the parent scope
Type:
  • boolean
Default Value:
  • false
Source:

lastBreadcrumbPublishTopic :string

This is the topic that is published when the final breadcrumb in the trail is clicked.
Type:
  • string
Default Value:
  • null
Source:

pathChangeTopic :string

A topic to subscribe to for path change events.
Type:
  • string
Since:
  • 1.0.17
Default Value:
  • null
Source:

pathChangeTopicPathProperty :string

The property to use when retrieving path data from payloads published on the pathChangeTopic.
Type:
  • string
Since:
  • 1.0.96
Default Value:
  • "path"
Source:

rootLabel :string

The label for the root of the breadcrumb trail.
Type:
  • string
Default Value:
  • "root.label"
Source:

showRootLabel :boolean

Indicates whether or not to display a root label for the breadcrumb trail. This label will effectively represent "/"
Type:
  • boolean
Default Value:
  • true
Source:

templateString :String

The HTML template to use for the widget.
Type:
  • String
Source:

useHash :boolean

Indicates whether the browser URL hash will be used to provide the breadcrumb trail. If this is set to true then the breadcrumb trail will be re-rendered as the hash changes.
Type:
  • boolean
Default Value:
  • false
Source:

Methods

copyPublicationConfig(config)

This function can be used to copy the publication configuration from the breadcrumb trail to an individual AlfBreadcrumb.
Parameters:
Name Type Description
config object The configuration object to copy the publication configuration to
Since:
  • 1.0.71
Source:

onCurrentNodeChange(payload)

This handles publications on the metadataChangeTopic topic to set the location of the current folder (e.g the last crumb in the trail). This information is required because the last crumb navigates to the details page for the node rather than just the list view of the crumb.
Parameters:
Name Type Description
payload object
Source:

onFilterSelection()

This handles publications on the filterSelectionTopic topic to show when a filter is selected. The rendered path is replaced with the details of the filter.
Source:

onHashChanged(newHash)

Handle hash-change events
Parameters:
Name Type Description
newHash object The new hash value
Since:
  • 1.0.60
Source:

onPathChanged(payload)

This handles publications on the hashChangeTopic topic and updates the [currentPath]{@link module:alfresco/documentlibrary/AlfBreadcrumbTrail#currentPath} attribute and calls the renderBreadcrumbTrail function to re-render the breadcrumb trail.
Parameters:
Name Type Description
payload object The details of the path change. The object must have both 'filterId' and 'filterData' attributes
Source:

onShowBreadcrumb(payload)

This handles publications on the onShowBreadcrumb topic to change the breadcrumb trail visibility.
Parameters:
Name Type Description
payload object Must contain a "selected" attribute which should map to whether or not the trail is shown or not.
Source:

postCreate()

Implements the Dojo widget lifecycle function to subscribe to the relevant topics that provide information on path and filter changes.
Source:

renderPathBreadcrumb(folderName, index)

Renders an individual AlfBreadcrumb in the breadcrumb trail.
Parameters:
Name Type Description
folderName string The name of the folder to render
index integer The index of the folder in array of breadcrumbs
Source:

renderPathBreadcrumbTrail()

Renders the breadcrumb trail by calling the renderBreadcrumb function for each element in the current path.
Source:

<inner> renderBreadcrumb(breadcrumb, index)

Renders a breadcrumb.
Parameters:
Name Type Description
breadcrumb object The configuration for the breadcrumb
index number The index of the breadcrumb
Source: