3
votes

I've create a custom ribbon button that only shows up the Insert block for a blog post. On my dev environment, it shows up fine. When I deploy to another environment, it shows up, but is disabled. I can't figure out how to enable it.

Button is enabled and okay on my dev environment

alt text

Button is disabled on other environment, where I'm a site collection admin.

alt text

It states that it is likely security or you have something selected that is not in context. I'm a site collection admin, so don't think it's security and I've selected the Rich text area, so not sure about the object context either.

Secondary Question: I'd ultimately like to take over the Video and Audio button, but cannot find where that is referenced in the cmdui.xml. Where does that thing come from?

Here is my code for the ribbon button:

 <?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
  Id="CommandUI.Ribbon.EditingTools.BlogSiteMediaButton"
  RegistrationType="ContentType"
  RegistrationId="0x0110"
  Location="CommandUI.Ribbon">
    <CommandUIExtension>
      <CommandUIDefinitions>
        <CommandUIDefinition Location="Ribbon.EditingTools.CPInsert.Media.Controls._children">
          <Button
            Id="Ribbon.EditingTools.CPInsert.Media.Controls.BlogSiteMediaButton"
            ToolTipTitle="Video"
            ToolTipDescription="Insert a video onto the page."
            Sequence="15"
            Image32by32="/_layouts/images/lg_ICWMD.gif"
            Image16by16="/_layouts/images/lg_ICWMD.gif"
            Command="BlogSite_Media_Button"
            LabelText="Insert Video"
            TemplateAlias="o1" />
        </CommandUIDefinition>
      </CommandUIDefinitions>
      <CommandUIHandlers>
        <CommandUIHandler
          Command="BlogSite_Media_Button"
          CommandAction="javascript:OpenInsertMediaDialog();" />
      </CommandUIHandlers>
    </CommandUIExtension>
  </CustomAction>
  <CustomAction Id="Ribbon.EditingTools.CPInsert.Actions.Scripts"
   Location ="ScriptLink"
   ScriptSrc="/_layouts/BlogSite.MediaButton/BlogSite.Ribbon.InsertMedia.js" />
</Elements>
1
Thanks for the example. I am trying to do the same in an article page Body field. And using Sharepoint 2013. I have just copy and paste your XML Schema, changed the RegistrationId to 0x01 and didn't use the second CustomAction and it appears nothing to me. Do you have any idea what could be this problem ?Tito

1 Answers

2
votes

Finally figured this one out and it was a simple thing. The environment I developed in was RTM. The shared development server that it was being deployed to and tested on was still Beta. Ahhh! So this was just a true beta bug with SharePoint that is now fixed in RTM. So much wasted troubleshooting time. Sometimes, it's the simplest things.