0

I have added a deployable custom action (FlyoutAnchor) to my Site. Now I have to hide this button in all other pages which are not inherit from a specific content type.

is it possible to do this with custom content types? does it work for content types that inherit from? For me it doesn't work yet (for default content type 0x01 as well!) With the two properties RegistrationType and RegistrationId the button is hidden everywhere.

Custom action Elements.xml:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction Id="Ribbon.EditingTools.MyCustomBtn" Location="CommandUI.Ribbon" Title="MyCustomBtn" RegistrationType="ContentType" RegistrationId="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900C0DEBA5E97584817AA6A2C3A0402E78A" >
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.EditingTools.CPInsert.Content.Controls._children">
          <FlyoutAnchor
            Id="Ribbon.EditingTools.Snippets.FlyoutAnchor"
            Sequence="20"
            LabelText="Add something"
            Image16by16="/_layouts/$Resources:core,Language;/images/formatmap16x16.png" Image16by16Top="-16" Image16by16Left="-16"
            Image32by32="/_layouts/$Resources:core,Language;/images/formatmap32x32.png" Image32by32Top="-32" Image32by32Left="-32"
            TemplateAlias="o1"
            PopulateDynamically="true"
            PopulateOnlyOnce="true"
            PopulateQueryCommand="GetDynamicNewMenuXml">
          </FlyoutAnchor>
        </CommandUIDefinition>
      </CommandUIDefinitions>
    </CommandUIExtension>
  </CustomAction>

Content type Elements.xml:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<ContentType ID="0x010100C568DB52D9D0A14D9B2FDCC96666E9F2007948130EC3DB064584E219954237AF3900C0DEBA5E97584817AA6A2C3A0402E78A"
                   Name="Abstract Page"
                   Group="MyPages"
                   Description="My Abstract Base Page"
                   Inherits="TRUE"
                   Hidden="TRUE"
                   Version="0">
        <FieldRefs></FieldRefs>
</ContentType>
0

Is your Location attribute Location="Ribbon.EditingTools.CPInsert.Content.Controls._children" correct? I don't see it in Default Server Ribbon Customization Locations here. These are the ones available:

Ribbon.EditingTools.CPInsert.Links 
Ribbon.EditingTools.CPInsert.Media 
Ribbon.EditingTools.CPInsert.Tables 
Ribbon.EditingTools.CPInsert.WebParts 
1
  • Well without RegistrationType and RegistrationIdit works well. It's visible in all pages when edit mode is enabled under the ribbon Insert inside the group Content. – Sebastian Sep 24 '13 at 11:39

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.