Posts mit dem Label ribbon bar werden angezeigt. Alle Posts anzeigen
Posts mit dem Label ribbon bar werden angezeigt. Alle Posts anzeigen

Freitag, 17. Februar 2012

Bugfix for 'Walkthrough: Replacing a Button on the Server Ribbon'

There is an example how to replace a button on the server ribbon available in the MSDN with one issue: it doesn't work ... ;-)

But I found the error and commented it below in the Community Content-section. For completeness I'll post it in my blog again:

There exists no button with the ID 'Ribbon.Library.Actions.ConnectToClient.ReplacementButton' so a javascript-error is thrown in the browser. The part of the xml must changed to this line and then it works:

<CommandUIDefinition Location="Ribbon.Library.Actions.ConnectToClient">
  <Button Id="Ribbon.Library.Actions.ConnectToClient" Command="ReplacementButtonCommand" ...>


Just remove the string '.ReplacementButton' in the Id of the Button from the example and it works.

Donnerstag, 7. Juli 2011

Add customaction to ribbonbar in sharepoint 2010 wiki page

Just a simple copy & paste of a custom action that adds a button to the ribbonbar in a publishingpage in the pageslist of a wiki-site:

<CustomAction Id="WikiDocumentExportCustomizationPageView" Rights="Contribute" Location="CommandUI.Ribbon" Sequence="30" Title="Wiki-Document-Export"> 
 <CommandUIExtension> 
  <CommandUIDefinitions> 
   <CommandUIDefinition Location="Ribbon.WikiPageTab.Share.Controls._children"> 
    <Button Id="WikiDocumentExportCustomizationPageView.Button" Command="ExportCurrentWikiDocumentFile2" CommandType="General" Description="Export Wiki-Document" TemplateAlias="o1" Sequence="30" Image32by32="/_layouts/images/wiki/pdf_export.png" LabelText="Export Wiki-Document"/> 
   </CommandUIDefinition> 
  </CommandUIDefinitions> 
  <CommandUIHandlers> 
   <CommandUIHandler Command="ExportCurrentWikiDocumentFile2" CommandAction="javascript:ExportCurrentWikiDocumentFile('{SiteUrl}');"/>
  </CommandUIHandlers> 
 </CommandUIExtension> 
</CustomAction>

Pay attention that this button is only visible to users with contribute-rights on the list.
ExportCurrentWikiDocumentFile is a custom external javascript-function that implements the code behind the button. You must define your own function here...