Custom Ribbon button in SharePoint 2010 showing up as disabled
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
Button is disabled on other environment, where I'm a site collection admin.
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=开发者_StackOverflow社区"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>
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.
精彩评论