none
HowTo add ContextualGroup to ribbon menu? RRS feed

  • Question

  • Hi,
    on my Wiki-Pages i like to add an custom "ContextualGroup" to the ribbon menu.
    the "ContextualGroup" sould only display if the page is in the edit mode!

    i have got this, but it doesnt work :/ any ideas?

    <?xml version="1.0" encoding="utf-8"?>
    
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    
      <CustomAction Id="Extended.Wiki" Location="CommandUI.Ribbon.EditForm">
        <CommandUIExtension>
          <CommandUIDefinitions>
    
            <CommandUIDefinition Location="Ribbon.ContextualTabs._children">
              <ContextualGroup Id="Extended.Wiki.ContextualGroup" Sequence="50" Color="Orange" Command="Extended.Wiki.Command" ContextualGroupId="Extended.Wiki.Contextual" Title=" ">
    
                <Tab Id="Extended.Wiki.ContextualTab" Title=" " Description="Groups and controls will go in here" Sequence="501">
                  <Scaling Id="Extended.Wiki.Scaling">
                    <MaxSize Id="Extended.Wiki.MaxSizeNew" GroupId="Extended.Wiki.MyWorkGroupNew" Size="MyWorkLayout" Sequence="10" />
    
                    <MaxSize Id="Extended.Wiki.MaxSizeManage" GroupId="Extended.Wiki.MyWorkGroupManage" Size="MyWorkLayout" Sequence="20" />
    
                    <Scale Id="Extended.Wiki.Scaling.MyWorkTabScalingNew" GroupId="Extended.Wiki.MyWorkGroupNew" Size="MyWorkLayout" Sequence="30" />
    
                    <Scale Id="Extended.Wiki.Scaling.MyWorkTabScalingManage" GroupId="Extended.Wiki.MyWorkGroupManage" Size="MyWorkLayout" Sequence="40" />
                  </Scaling>
    
                  <Groups Id="Extended.Wiki.Groups">
                    <Group Id="Extended.Wiki.MyWorkGroupNew" Description="New group description" Title="New" Command="MyWorkContextualTab.EnableMyWorkGroupNew" Sequence="52" Template="Ribbon.Templates.MyWorkTemplate">
    
                      <Controls Id="Extended.Wiki.MyWorkGroupNew.Controls">
                        <Button Id="Extended.Wiki.MyWorkGroupNew.NewItem" Command="Extended.Wiki.NewItemCommand" Sequence="15" Description="Add a new item" LabelText="New Item" TemplateAlias="ONERW" Image32by32=" " />
                      </Controls>
                    </Group>
                  </Groups>
    
                </Tab>
              </ContextualGroup>
            </CommandUIDefinition>
          </CommandUIDefinitions>
        </CommandUIExtension>
      </CustomAction>
    </Elements>

    thanks,
    Matthias

    Monday, June 9, 2014 11:37 PM