-
Notifications
You must be signed in to change notification settings - Fork 83
How to use Breadcrumbs
This sdk documentation is deprecated and will not be updated. Check out our new docs at https://sdk.buildfire.com/docs/breadcrumbs/
Breadcrumbs keep track of user navigation between different plugins and sections within a plugin.
You can add to breadcrumbs inside your plugin to give the user the ability to navigate back to any breadcrumb you added.
Whenever you drill down a level in your plugin and wish to reflect this in the breadcrumb simply use push to add to the breadcrumb history
arguments:
-
[label]: The label for the breadcrumb -
[options obj]: Options object where you can pass in data that is needed to take the user back to the view when breadcrumb is clicked (optional). When the propertyshowLabelInTitlebaris settruein the options object it will cause the label to displayed in the app title bar instead of the plugin title.
example:
buildfire.history.push('2014 Top 10', { elementToShow: '#2014Top10' });
Whenever you would want to go back one level in your own plugin breadcrumbs and wish to reflect this in the breadcrumb simply use pop to pop the latest breadcrumb in breadcrumb history.
Note that you can only pop breadcrumbs added by your plugin.
example:
buildfire.history.pop();
To be able to retrieve the breadcrumbs list use 'get'.
arguments:
-
[options]: An options object where you can set the following (Optional):-
pluginBreadcrumbsOnly: To filter out your plugin breadcrumbs from other breadcrumbs. Defaultfalse
-
-
[callback]: The callback function that is called when breadcrumbs list is retrieved. functionfunction(err, result){}receives two parameters; theerrif there is any and theresultthat holds the result of the operation requested.
example:
buildfire.history.get({
pluginBreadcrumbsOnly: true
},function(err, result){
console.info('Current Plugin Breadcrumbs', result);
});
When the user clicks on the breadcrumb, that would cause the breadcrumb to pop along with any subsequent breadcrumb.
You should capture that event using the onPop function:
arguments:
-
[callback]: Your callback function to call passing the new active breadcrumb object after the pop operation. -
[allowMultipleHandlers]: optional bool param that tells the method to override all other handlers. Defaultfalse
example:
buildfire.history.onPop(function(breadcrumb) {
// Show / Hide views
document.getElementById(breadcrumb.options.elementToShow).style.display = "block";
});
