0

I've successfully added a custom ribbon button to my site and everything shows up as expected. However, when I go to a sub site, my custom ribbon button doesn't show up. How can I get my button to show up in the main site and also sub sites? I assumed that a button deployed to the main site would also carry over to sub sites but I guess that isn't the case. Anyone have any ideas or guidance? My button get's added to the "Media" group of the "Insert" tab for the RTE.

Here is my button code:

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <CustomAction
        Id="CommandUI.Ribbon.EditingTools.MyCompany_InsertVideoButton"
        Location="CommandUI.Ribbon">
        <CommandUIExtension>
            <CommandUIDefinitions>
                <CommandUIDefinition
                    Location="Ribbon.EditingTools.CPInsert.Media.Controls._children">
                    <Button
                        Id="Ribbon.EditingTools.CPInsert.Media.Controls.MyCompany_InsertVideoButton"
                        ToolTipTitle="Video"
                        ToolTipDescription="Insert a video into the page."
                        Sequence="50"
                        LabelText="Insert Video"
                        Image16by16="/_layouts/MyCompany/images/icons/ribbonInsertVideoButton_16.png"
                        Image32by32="/_layouts/MyCompany/images/icons/ribbonInsertVideoButton_32.png"
                        Command="MyCompany_InsertVideoButtonCommand"
                        TemplateAlias="o1" />
                </CommandUIDefinition>
            </CommandUIDefinitions>
            <CommandUIHandlers>
                <CommandUIHandler
                        Command="MyCompany_InsertVideoButtonCommand"
                        CommandAction="javascript:alert('MyCompanyInsertVideoButton clicked!');"
                />
            </CommandUIHandlers>
        </CommandUIExtension>
    </CustomAction>
</Elements>

2 Answers 2

2

Looks like you have a Web-scoped feature. You should try to change your feature scope to Site.

3
  • 1
    Nope, it actually is a site scoped feature.
    – TehOne
    Commented May 19, 2011 at 21:29
  • 1
    The behaviour described is certainly consistent with a web-scoped feature.
    – SPDoctor
    Commented May 20, 2011 at 8:52
  • I'll test this as soon as I can. Commented May 20, 2011 at 12:31
1

I did end up finally finding the problem to this, it wasn't actually a problem with any code anywhere, but it was a caching problem in the browser. Apparently, doing an F5 or ctrl-r refresh wasn't good enough to clear out the ribbon cache, so I had to manually clear out my browser cache, then I would see the correct ribbon. I feel like an idiot for this, but in any case it's something to note down for future users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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