Extending tabs in a dialog
Add a tab to a dialog, such as a Component dialog or a Schema dialog, to populate it with controls and/or information.
Procedure
- From the Add-ons screen in Content Manager Explorer, download the Add-on package (ZIP file) that contains your GUI Editor extension.
- From the ZIP file you downloaded, extract the GUI Editor's configuration file and open it for editing.
- In the
extensionssection, locate theext:tabpagessection. Inside this section, create or find an<ext:add>element. - For each new dialog tab you want to create, insert an
ext:extensionelement that has the following form:<ext:extension assignid="MyDialogTabID" name="My Dialog Tab" insertbefore="InfoTab"> <ext:control>~/Extensions/Tabs/MyDialogTab.ascx</ext:control> <ext:pagetype /> <ext:apply> <ext:view name="*"> <ext:control id="MasterTabControl"/> </ext:view> </ext:apply> </ext:extension>where MyDialogTabID identifies the new tab, My Dialog Tab is the display label of the tab, and the value of insertbefore indicates to the left of which tab the new tab will be positioned. The
ext:viewelement specifies where to add this new tab. In this example, the new tab is added to all views that contain a control calledMasterTabControl. - If you intend to place static data only on this new dialog tab, your tab is now finished.
- Alternatively, if you intend to place controls and/or dynamic data on it, continue by creating a JavaScript class that inherits from Tridion.Controls.DeckPage and that defines your custom implementation of the new dialog tab.
- At the end of the file, call
Tridion.Controls.Deck.registerPageTypeto register this new type of dialog tab under a specific name. - Save this file as a .js file and add it to your Visual Studio solution.
- Create a new
cfg:groupelement for this JavaScript file in your custom Editor's configuration file, and give it a dependency on the group that represents the set of tabs you want to add it to. - Add a
ContentResourcesattribute to the server-side class for the ASCX control, and set it to the name of the new resource group. - In the
ext:extensionelement that defines the new dialog tab, setext:pagetypeto the name under which you registered your new dialog tab in the JavaScript file. - Save and close the configuration file and update it in the ZIP file. You may want to increase the build number in the filename of the ZIP file, or even the version number of the Add-on (which you must also then change in the manifest file).
- From the Add-ons screen in Content Manager Explorer, upload the updated Add-on package (ZIP file). It replaces your old Add-on package.