TyphonJST
TyphonJS3y ago
Faey

Sidebar Tab Application

I have, after diving deep into the Foundry Code, figured out how to actually add new Sidebar tabs.

it's a two step process of sorts.

You need to add the actual button to reveal the Sidebar Tab, as well as actually provide the SidebarTab Application.

Only ways to add the Button is either wrap the getData() method on Sidebar, if you already use libWrapper this is the cleaner method. Alternatively you can just sort of inject the HTML for the button with jQuery.
The Tab itself is actually the easier part. Because the canonical way is already just
ui.sidebar.tabs[this.tabName] = this;
at the end of the SidebarTab constructor.
And then the Sidebar takes care of rendering and stuff.

However, the SidebarTab has a very specific api that the Sidebar Application expects to exist. As such, the Application templates in TRL are currently insufficient to just make new SidebarTabs on their own
Was this page helpful?