You can easily customize your Ribbon menu control in Sharepoint 2010. This example demonstrate the custom CommandAction ribbon button which display the application page as model dialog. Find the below Elements.xml sample used javascript file to execute the custom action Aboutscript().
<Elements xmlns=”http://schemas.microsoft.com/sharepoint/” >
<CustomAction
Id=”AboutFilesButton”
Location=”CommandUI.Ribbon”
RegistrationId=”101″
RegistrationType=”List”
Title=”About”>
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
Location=”Ribbon.Library.ViewFormat.Controls._children”>
<Button Id=”Ribbon.Library.ViewFormat.About”
Command=”AboutButtonCommand”
LabelText=”About”
Image32by32=”/_layouts/1033/IMAGES/AboutIcon.jpg”
TemplateAlias=”o1″ />
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler
Command=”AboutButtonCommand”
CommandAction=”javascript:Aboutscript();“/> –> Refer Your Function here
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
//Referencing the Script
<CustomAction
Id=”AboutFilesButton.Script”
Location=”ScriptLink”
ScriptSrc =”/_layouts/RibbonScripts/AboutButtonscript.js”/>
</Elements>
Similar Topics:
- How to customize sharepoint list toolbar
- Sharepoint best practices advantages of storing scripts in layout folder
- SharePoint 2010 MSDN article collection for developer
- This solution contains no resources scoped for a Web application – Sharepoint WSP deployment exception
- Learn Sharepoint 14Hive folder structures
- Sharepoint 2010 upgrades planning using pre upgrade check
- Creating the custom theme in MOSS Branding
- More about SharePoint Custom page and Application Page
- Sharepoint 2010 Quick learn video Tutorial 1
- Enabling IIS6 HTTP compression on SharePoint dynamic page