For example, here's the code that defines the settings (gear) category:
provider.registerService("orion.page.link.category", null, {
id: "settings", // category id
name: "Settings",
imageClass: "core-sprite-gear", // imageDataURI can be used instead
order: 60
});
Existing
orion.page.link and orion.page.link.related extensions can be assigned
to a category by adding a category field. For example this assigns a static link to settings.html to the "settings" category:
provider.registerService("orion.page.link", null, {
id: "orion.settings",
name: "Settings",
category: "settings", // category id
uriTemplate: "{+OrionHome}/settings/settings.html"
});
In the current design, a category can only contain 1 link. Clicking on the category icon takes you to that link. We experimented with submenus in the past, but they were clumsy, so now each icon leads to a separate page dealing with a broad area of features: Editing, Git, Settings, etc. If this meshes OK with your product, you can just add an additional category/icon/link there.
Otherwise, you can show multiple links by converting them into
orion.navigate.command extensions. The signature for this API is pretty much identical to
orion.page.link.related, the only real difference is that navigate commands appear in the menubar under View > Open Related. To make them appear regardless of selection, just omit the
validationProperties field entirely.
Mark