Skip to main content

buildfire.history

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.

Methods

push()

buildfire.history.push(label, options)

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

buildfire.history.push("Log in");

label

NameTypeRequiredDescriptionDefault
labelstringnoBreadcrumb label, can be used as title

options

Options object where you can pass the data that is needed to take the user back to the view when breadcrumb is clicked (optional).

NameTypeRequiredDescriptionDefault
showLabelInTitlebarbooleannoShows label instead of plugin title in titlebarfalse

More Examples

buildfire.history.push("Profile", {
showLabelInTitlebar: true,
user: { name: "John Doe" },
id: 1234,
});

pop()

buildfire.history.pop()

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

You can only pop breadcrumbs added by your plugin.

buildfire.history.pop();

onPop()

buildfire.history.onPop(callback, allowMultipleHandlers)

Event that triggers whenever a breadcrumb is popped

buildfire.history.onPop((breadcrumb) => {
console.log("Breadcrumb popped", breadcrumb);
});

callback(breadcrumb)

Function that will get called on every event.

NameTypeDescription
breadcrumbobjectBreadcrumb object that was popped

allowMultipleHandlers

NameTypeRequiredDescriptionDefault
allowMultipleHandlersbooleannoTells the method to override all other handlersfalse

get()

buildfire.history.get(options, callback)

Used to retrieve the list of all breadcrumbs

buildfire.history.get(
{
pluginBreadcrumbsOnly: true,
},
(err, result) => {
console.info("Current Plugin Breadcrumbs", result);
}
);

options

Function that will get called on every event.

NameTypeRequiredDescriptionDefault
pluginBreadcrumbsOnlybooleannoFilter out to current plugin breadcrumbs if truefalse

callback(err, result)

NameTypeDescription
errstringError string, null when operation is successful
result[object]Array of breadcrumb objects