All about the SharePoint ribbonPresentation Transcript
All about the SharePoint Ribbon Shai Petel MCT, VP R&D shai@kwizcom.com
Warning! There will be extensive visual studio use throughout this presentation!
Topics Introducing the Ribbon SPRibbon Architecture Customizing the SPRibbon
Introducing the Ribbon Office ribbon: File menu and quick access toolbar: SharePoint ribbon: Site Actions menu, Navigate Up and Edit page quick access buttons
Introducing the RibbonCommon tabs The “Browse” tab The “Page” tab
Introducing the RibbonCommon tabs The “Items” tab The “List” tab
Introducing the RibbonCommon tabs “On demand” functionality with contextual tabs
Introducing the RibbonCommon tabs Context-sensitive operations with controls status
Topics Introducing the Ribbon SPRibbon Architecture Customizing the SPRibbon
SPRibbonArchitectureObjects Hierarchy
SPRibbonArchitectureObjects Hierarchy
SPRibbon ArchitectureObjects Hierarchy Objects are defined in XML or in JSON. Example:TEMPLATEGLOBALXMLCMDUI.XML (Humans prefer XML…)
SPRibbonArchitectureRibbon Communication
Topics Introducing the Ribbon SPRibbon Architecture Customizing the SPRibbon
Customizing the SPRibbonGeneral info Declaring controls Handling commands Associating your ribbon tabs
Customizing the SPRibbonGeneral info Declaring controls Declare Ribbon controls in feature XML Injext XML to SPRibbon using ribbon.RegisterDataExtension Handling commands Associating your ribbon tabs
Customizing the SPRibbonGeneral info Declaring controls Handling commands Declare command handlers inline in the XML Register a PageComponent to handle more complex commands (such as lazy load) Associating your ribbon tabs
Customizing the SPRibbonGeneral info Declaring controls Handling commands Associating your ribbon tabs Associate with a list template or content type Use code to bring un-associated tabs to view Associate web part with contextual group tabs
Customizing the SPRibbon Code + demo (See demo script in README.txt inside VS project)
Nice to know… Use JS objects to avoid conflicts The ribbon shows informative formatting errors 9 times out of 10
Nice to know… Some controls cannot be large / medium / small. Checkbox cannot be large. If you inject to existing node (_children) you can only inject one child at a time. Create CommandUIDefinition for each injection. Documentation error: group template and template alias are not optional!
Nice to know… SPRibbon in not accessible from sandboxed code! Dispatch command manually: SP.Ribbon.PageManager.get_instance().get_commandDispatcher().executeCommand(Commands.CommandIds.ApplicationStateChanged, null);
Topics Introducing the Ribbon SPRibbon Architecture Customizing the SPRibbon
See also Server Ribbon visual studio extensibility project: http://code.msdn.microsoft.com/vsixforsp PageComponent more info:http://msdn.microsoft.com/en-us/library/bb383792.aspx Shai's Blog:http://kwizcom.blogspot.com Chris O'Brien ribbon blog (Beta!) can be found here: http://www.sharepointnutsandbolts.com/2010/01/customizing- ribbon-part-1-creating-tabs.html MSDN How-To Webpart with contextual ribbon: http://msdn.microsoft.com/en-us/library/ff407578.aspx