Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SharePoint > SharePoint 2010 > BOOK: Professional SharePoint 2010 Development
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
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>
Reply With Quote
  #2 (permalink)  
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>
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 02:07 PM



All times are GMT -4. The time now is 06:23 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.