4

I would like to make a ribbontoolbar button like the NewComponent Button in the Create tab. So one which has the ability to add options with a drop down menu.

printscreen of the New Component Button in CME

I have Looked into the CME editor of Tridion but do not seem to find how to make this myself.

I already have some code to make that ribbon tab and button but cannot find how to add the dropdown functionality with more options.

<ext:ribbontoolbars>
      <ext:add>
        <ext:extension pageid="MyPage" groupid="DefaultGroup" name="Action" assignid="Btn-MyPage-Action">
          <ext:command>Action</ext:command>
          <ext:title>Do Action</ext:title>
          <ext:dependencies>
            <cfg:dependency>Tryout.RibbonTab.Commands</cfg:dependency>
          </ext:dependencies>
          <ext:apply>
            <ext:view name="DashboardView">
              <ext:control id="DashboardToolbar" />
            </ext:view>
          </ext:apply>
        </ext:extension>
      </ext:add>
</ext:ribbontoolbars>
3

Article from Bart actually describes everything you might need in this perspective.

I'd only add that you can`t extend a Button via external control. However, you can add a group with the buttons you need. Like

<ext:extension insertbefore="" 
       name="ExtendedGroup" 
       assignid="ExtendedGroup"
       pageid="HomePage">
        <ext:group>~/Extension/ExtensionItemsGroup.ascx</ext:group>
        <ext:apply>
                <ext:view name="DashboardView">
                    <ext:control id="DashboardToolbar" />
            </ext:view>
        </ext:apply>
</ext:extension>

While in ExtensionItemsGroup.ascx it should be Dropdown button

<c:RibbonButton runat="server" CommandName="ExtendedButton1" IsDropdownButton="true" Title="TestButton" ID="UsersDropdown">
    <c:RibbonContextMenuItem runat="server" Command="ExtendedButton1" Title="ExtendedButton1" Label="ExtendedButton1" ID="ExtendedButton1" />
    <c:RibbonContextMenuItem runat="server" Command="ExtendedButton2" Title="ExtendedButton2" Label="ExtendedButton2" ID="ExtendedButton2" />
</c:RibbonButton>

Or split button:

<c:RibbonSplitButton runat="server" CommandName="Split1" Title="SplitButton" Label="SplitButton>" ID="SplitButton">
    <c:RibbonContextMenuItem runat="server" ID="SplitButton" Command="Split1"  Title="Split1" Label="Split1" />
    <c:RibbonContextMenuItem runat="server" ID="Split2Button" Command="Split2"  Title="Split2" Label="Split2" />
</c:RibbonSplitButton>
3

I'm not sure how to actually create such a drop down, but fairly sure it is using a Tridion User Conrtol (.ascx) like is the story with the Ribbon Item Group (where you can have three small buttons stacked under eachother).

See my blog post about how to use the Ribbon Item Group: http://www.tridiondeveloper.com/ribbon-item-group and take it from there. You will probabaly need to further inspect the existing files in the SDL Tridion CME client and there you should be able to find how it is done, and then you just have to replicate it (like I did with the Ribbon Item Group).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.