Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to arrange the ribbon item groups?

I would like to reorder the itemgroups under the home tab as well as reoder the tabs also. say for example: under the home tab few groups are available like (clipboard, Manage, Edit, Publish and etc..). Each group has its own buttons.

I have created few gui extensions buttons and i have assembled them under one group. by default gui extension is placed last under the given tab in the config file.

I would like to place my extension group next to manage or edit group as well as i would like to re order the group.

Could anyone help me on this?

like image 547
user1428019 Avatar asked Jan 29 '13 04:01

user1428019


2 Answers

The items under the home group have been ordered by the product, apart from any extensions which have been added. Reordering them is not something which by default belongs to the available options.

However, adding your own group in a specified order rather then at the end is possible. For this you can use the insertbefore attribute in your ext:extension element, roughly like so:

<ext:ribbontoolbars>
  <ext:add>
    <ext:extension assignid="MyGroupID" name="My Name" pageid="HomePage" insertbefore="PublishGroup">
       ...
    </ext:extension>
  </ext:add>
</ext:extension>

See also my article on Tridion Developer which explains how to add a Ribbon Item Group.

What can help you for all the available attributes is to refer to the schema of the extension configuration. There are a couple of them and you can find them on your CM server in the ..\Tridion\web\WebUI\Core\Schemas directory.

To find the IDs which you can use in the insertbefore attribute, you basically need to inspect the HTML of the UI. You will see that every div which makes up a group will have an ID, and its those ID names you can use. Which in turn allows you to basically place your extension group, before any existing item.

like image 107
Bart Koopman Avatar answered Oct 19 '22 16:10

Bart Koopman


Bart is right, re-ordering is not possible by default. As an option, you can hide existing groups, create your new custom groups (which will be actually the same, as original from CME) and insert them in the place, you want. And yes, "insertbefore" attribute also works for groups! But be aware, that extensions are applied in the order you specified them in configuration file. For example, if you have two Ribbon Groups extensions in the following order:

<ext:ribbontoolbars>
  <ext:add>
    <ext:extension assignid="MyGroupID1" name="My Name" pageid="HomePage" insertbefore="MyGroupID2">
       ...
    </ext:extension>
    <ext:extension assignid="MyGroupID2" name="My Name" pageid="HomePage" insertbefore="PublishGroup">
       ...
    </ext:extension>
  </ext:add>
</ext:extension>

Group with id "MyGroupID1" will be added at the end of "HomePage", because Group "MyGroupID2" is not there yet! Just by swapping these two extensions you will do the trick.

like image 21
Boris Ponomarenko Avatar answered Oct 19 '22 17:10

Boris Ponomarenko