Wrox Programmer Forums
|
BOOK: Professional SharePoint 2010 Development
This is the forum to discuss the Wrox book Professional SharePoint 2010 Development by Tom Rizzo, Reza Alirezaei, Jeff Fried, Paul Swider, Scot Hillier, Kenneth Schafer; ISBN: 9780470529423
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional SharePoint 2010 Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 21st, 2010, 11:25 AM
Registered User
 
Join Date: Jan 2009
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Thumbs down Chapter 4: Example Ribbon Customization

Has anyone managed to make the proposed customization work? I'm added the following piece of code in a feature that deploys successfully but then, it never appears on the ribbon. Never. I tried changing the location from CommandUI.Ribbon.List to just CommandUI.Ribbon but still no joy. Is there something missing from the code or is there something that I'm not doing correctly?

Thank you for your answers in advance

Code:
<?xml version="1.0" encoding="utf-8"?>

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
    Id="CustomRibbonTab"
    Location="CommandUI.Ribbon.List"
    RegistrationId="101"
    RegistrationType="List"
    Title="My Custom UI"
    Sequence="5">
  <CommandUIExtension>
  <CommandUIDefinitions>
  <CommandUIDefinition Location="Ribbon.Documents.New.Controls._children">
  <Button
              Id="Ribbon.Documents.New.RibbonTest"
              Alt="Test Button"
              Sequence="5"
              Command="Test_Button"
              LabelText="Click me!"
              Image32by32="/_layouts/images/ribbon_blog_32.png"
              Image16by16="/_layouts/images/ribbon_blog_16.png"
              TemplateAlias="o1" />
  </CommandUIDefinition>
  </CommandUIDefinitions>

  <CommandUIHandlers>
  <CommandUIHandler
          Command="Test_Button"
          CommandAction="javascript:alert('I am a test!');" />
  </CommandUIHandlers>

  </CommandUIExtension>
</CustomAction>
</Elements>
 
Old October 29th, 2010, 06:37 AM
Registered User
 
Join Date: Jan 2009
Posts: 6
Thanks: 1
Thanked 0 Times in 0 Posts
Talking Never mind

Yeah such situations are embarrassing... Never mind my previous post, I managed to get it working. I still dont know how to use the relative path for my icon though. I mean, I dont know where I should place the icon... when I use the "/_layouts/images/ribbon_blog_32.png" form, I can't figure out where the _layouts path is. Or, if I'm supposed to create it, where am I supposed to create it. Oh well, I guess I'll figure that out as well, at some point.

The following code works like a charm anyways:

Code:
<?xml version=”1.0″ encoding=”utf-8″?><Elements xmlns=”http://schemas.microsoft.com/sharepoint/“>
<CustomAction
Id=”Test_Button”
Location=”CommandUI.Ribbon”>
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
Location=”Ribbon.Documents.New.Controls._children”>
<Button Id=”Ribbon.Documents.New.RibbonTest”
Alt=”Test Button”
Sequence=”8″
Command=”Test_Button”
LabelText=”Click me!”
Image32by32=”C:\Users\User\Desktop\icon.jpg”
TemplateAlias=”o1″ />
</CommandUIDefinition>
</CommandUIDefinitions>
<CommandUIHandlers>
<CommandUIHandler
Command=”Test_Button”
CommandAction=”javascript:alert(‘I am a test!’);” />
</CommandUIHandlers>
</CommandUIExtension>
</CustomAction>
</Elements>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom Office ribbon ayazhoda Access VBA 0 May 29th, 2008 09:36 AM
Access 2007 won't let me select a ribbon bgnetman Access 0 October 23rd, 2007 12:04 PM
Access 2007 Ribbon button link to .chm aholley0628 Access 0 September 13th, 2007 02:35 PM
Discussion board customization marclena SharePoint Development 0 September 7th, 2006 10:40 AM
Graph Customization hosefo81 PHP How-To 3 November 10th, 2003 03:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.