close

Filter

loading table of contents...

Studio Developer Manual / Version 2101

Table Of Contents

7.7.1 Adding buttons to the Favorites Toolbar

The Favorites Toolbar on the left side is vertically divided into three subcontainers:

  • The top section, which in Studio's default configuration has buttons to open Bookmarks, and to create content

  • The middle section (FavoritesToolbarUserItemsArea), which contains user-managed search folders. Users can add, delete, and modify their own, often used search folders in this section. Therefore, your ability to preconfigure this section is inherently different from the top and bottom section of the Favorites Toolbar. For details, see Section 7.7.2, “Providing default Search Folders” below

  • The bottom section, which in Studio's default configuration has an Apps button for developer-defined extensions. You can extend the Apps buttons menu or add top-level buttons above or below.

If you want to add fixed buttons to the Favorites Toolbar (that is, buttons that can not be modified or removed by the user), you need to add them to either the top or the bottom section of the Favorites Toolbar.

The main BlueprintFormsStudioPlugin.mxml file shows how you can easily use the AddItemsPlugin to add your own buttons to the top and bottom sections of the toolbar, respectively:

<editor:FavoritesToolbar>
  <editor:plugins>
     <ui:AddItemsPlugin>
       <ui:items>
         ...add your component/button here...
       </ui:items>
       <ui:after>
         <Component itemId="{favoritesToolbar.NEW_MENU_BUTTON_ITEM_ID}"/>
       </ui:after>
     </ui:AddItemsPlugin>
  </editor:plugins>
</editor:FavoritesToolbar>

Ensuring a proper order of the items of the favorites toolbar helps significantly in making the application usable. Note how an after constraint is used to put the new button to a specific place. It uses the framework-predefined itemId of the Library button to describe the desired location of the added button, and references the new button via an element with Blueprint namespace - the button itself is declared in a separate MXML file in the Studio plugin.

To add a simple button with an action, enter the following code inside the <items> element (see Section 7.2, “Localizing Labels” to learn how to localize the label of the button):

<Button itemId="exampleButton">
  <baseAction>
    <editor:ShowCollectionViewAction text="toBePublished"
     published="false" editedByMe="true" contentType="CMArticle"/>
  </baseAction>
</Button>

Example 7.36. Adding a search for documents to be published


This code snippet will create a search folder button with label text "toBePublished" that uses a ShowCollectionViewAction to open the Library window in a mode that searches for a restricted set of content items (please see the API documentation for ShowCollectionViewAction for more details).

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.