Hot answers tagged ribbon
9
You can use the SPRibbon.TrimById(controlId) method to hide controls. http://msdn.microsoft.com/en-us/library/microsoft.web.commandui.ribbon.trimbyid.aspx
This page lists the controlIDs: http://msdn.microsoft.com/en-us/library/ee537543.aspx
You can use other OM methods to determine the user's permission and call the TrimById method accordingly. For ...
9
You can associate your custom action to a specific list by using the RegistrationId property.
Example:
<CustomAction ControlAssembly="MagicalProject.Actions"
ControlClass="MagicalProject.Actions"
ControlSrc="/_layouts/MagicalSite/MagicalPage.aspx"
Description="This is my custom action which does magical ...
8
As described in this article : Remove button from the Ribbon in SharePoint 2010, you can, with a feature, remove existing button.
In your case, the feature.xml file should be :
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="RemoveDataSheetButton"
...
8
Jquery approach can be implemented, but I'm afraid it will be exceedingly complicated, because ribbon buttons can change their size if you resize the browser window (so the id of the button will be changed respectively, for example from ..-Large to ..-Medium, etc.), and also they're created after page load, dynamically with js - so you will need some ...
7
Bil! Looks like, you have missed Scaling element inside Groups element.
Try add this to your definition:
<Scaling Id="BilSimser.Ribbon.ListForm.Display.CustomerGroup.Scaling">
<MaxSize
Id="BilSimser.Ribbon.ListForm.Display.CustomerGroup.MaxSize"
GroupId="BilSimser.Ribbon.ListForm.Display.CustomerGroup"
...
6
Put this in a content editor webpart
<script>
setTimeout(function() {
var elem = document.getElementById("MSOZoneCell_WebPartWPQ2");
if(elem != null) {
var dummyevent = new Array()
dummyevent["target"] = elem
dummyevent["srcElement"] = elem
WpClick(dummyevent)
}
}, 2000)
</script>
6
When you click Check In button, method handleCommand called from javascript object SP.Ribbon.PageState.PageStateHandler (sp.ribbon.js) with commandId = "PageStateGroupCheckin"
If you debug it, you can find that it executes this line at least:
return SP.Ribbon.PageState.Handlers.showStateChangeDialog(properties['CommandValueId'], ...
6
http://msdn.microsoft.com/en-us/library/ff458385.aspx:
{SiteUrl} – The fully qualified URL to the site (Url).
The SharePoint code proves it - here's the SPCustomActionElement.ReplaceUrlTokens method:
internal static string ReplaceUrlTokens(string urlAction, SPWeb web, SPList list, SPListItem item)
{
if (string.IsNullOrEmpty(urlAction))
...
6
You have two options here. One is to create simple toggle button with this markup:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction Id="8DCC5B17-4B9E-41A7-BA51-65CBC6F8205D"
Location="CommandUI.Ribbon"
Sequence="10">
...
6
You can specify Location="CommandUI.Ribbon.ListView" and RegistrationType="ContentType" with ID set to 0x01 for custom button to appear on ListView pages of all the lists.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="ShowHelloWorldButton"
...
6
Nicholas,
The SharePoint 2010 ribbon is kind of a double-edged sword. I have seen many business users asking for "not having" the ribbon for the sake of branding. Then there were instances when people needed some extended administrative sections in SharePoint sites without the ribbon.
The fact is no matter what you do, without the ribbon there are numerous ...
5
You may well need to define your own GroupTemplate. The out of box ones - such as Ribbon.Template.Flexible - are not necessarily available.
http://www.andrewconnell.com/blog/archive/2010/10/10/always-create-your-own-group-templates-with-sharepoint-ribbon-customizations.aspx
5
I think you can go that way:
Register a javascript on your page which will add a Listener to all ribbon buttons on a page, but make sure, that your listener will be the second and will not break real ribbon listener. It seems it's possible to have 2 js listeners for 1 event. You can use jQuery - http://api.jquery.com/click/ or regular js - ...
5
ExecuteOrDelayUntilScriptLoaded(function () {
var pageStateGroupPublishValue = SP.Ribbon.PageState.PageStateCommands.pageStateGroupSubmitForApproval;
SP.Ribbon.PageManager.get_instance().executeRootCommand(pageStateGroupPublishValue, window.g_CUIcommandProperties, { CommandId: pageStateGroupPublishValue }, null);
}, "sp.ribbon.js");
5
Site Actions -> Navigation -> Show and Hide Ribbon Setting Make "Show Ribbon" and "Hide Ribbon" commands available to No should prevent the ribbon from disabling and requiring folks to enable it. It should also make it available all the time for everyone.
4
According to Connect to Outlook – Tipps und Tricks (English version), it looks like you want something like this:
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="RemoveRibbonButton"
Location="CommandUI.Ribbon"
RegistrationType="List"
...
4
In short, you can customize it. Here is a nice example:
http://blogs.msdn.com/b/weslbo/archive/2011/04/21/how-to-create-a-custom-color-picker-flyout-in-the-sharepoint-ribbon.aspx
4
1 Make sure jQuery is present and working on the page in question - I found I had to download from the jQuery site (http://docs.jquery.com/Downloading_jQuery) and use a relative link. Using the CDN hosted jQuery didn't work for me.
<script src="/Shared%20Documents/jquery.js" type="text/javascript"></script>
This link was useful - ...
4
All the ribbon definitions are stored in this file:
C:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\14\TEMPLATE\GLOBAL\XML\CMDUI.XML
Action JS code for most of these ribbon elements you can find here:
C:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\14\TEMPLATE\LAYOUTS\SP.Ribbon.debug.js
Actions for ...
4
This is afaik the only way to do it SECURELY the ajax answer on that page is a bad example however of how to acheive this, the accepted answer is the correct way:
Hiding buttons of the Ribbon Bar
3
This question came up some time ago on the MS foras.
The answers are more usable for anonymous access (eg removes for all) but see if it gets you going. http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010general/thread/4848315b-c9c2-4bbb-a1cd-f3a106e0fd8e
3
You could use javascript to do this.
var menuItems = document.getElementsByTagName('ie:menuitem');
for (i=0; i<menuItems.length; i++)
if (menuItems[i].text == 'Edit in Datasheet')
menuItems[i].removeNode();
jQuery version:
$("ie\\:menuitem[text='Edit in Datasheet']").each(function() {
this.hidden = true;
});
3
In addition to Steve B's solution, another 2010-only way of doing this is to set the following property to true:
SPList.DisableGridEditing
Unfortunately there appears to be no way to do this in 2007.
3
Create a reg file and install on the user's computer (this might be too restrictive for you though)
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\yourprotocol]
"EditFlags"=dword:00000002
"URL Protocol"=""
@="URL:yourprotocol protocol"
[HKEY_CLASSES_ROOT\yourprotocol\shell]
[HKEY_CLASSES_ROOT\yourprotocol\shell\open]
...
3
Not quite sure where you want the ribbon but I am guessing that you have not created a Ribbon itself but trying to customize an existing ribbon.
SharePoint has displays Ribbon (which can be customized) at several fixed locations and those locations are documented here:
http://msdn.microsoft.com/en-us/library/ee537543.aspx
You can customize instances of ...
3
To assign ribbon to all pages with specified content type, you can use RegistrationType="ContentType" and set RegistrationId to the content type Id.
For example:
<CustomAction
Id="AddRibbonForContentType"
Location="CommandUI.Ribbon"
RegistrationType="ContentType"
RegistrationId="0x01080100E7218A6B458E40A49EF635CD​4E1228FF">
...
3
Location for ribbon group templates is Ribbon.Templates._children. For example:
<CustomAction Id="MyRibbonCustomization" Location="CommandUI.Ribbon">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition Location="Ribbon.Templates._children">
<GroupTemplate ...
3
As SPDoctor stated - it sounds like an issue with 64 bit install of Office.
You cannot view a list in Datasheet view after you install the 64-bit version of Office 2010
Try installing the 2007 Office System Driver: Data Connectivity Components
3
I have found the best and easiest solution will be available in version 1.4 of SharePoint 2010 Fluent Ribbon API
that omlin at codeplex runs.
Blog post about the techique
Thank you omlin!
3
This is XML to hide ManageWorkflows button.
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<CustomAction
Id="RemoveRibbonButton"
Location="CommandUI.Ribbon">
<CommandUIExtension>
<CommandUIDefinitions>
<CommandUIDefinition
...
Only top voted, non community-wiki answers of a minimum length are eligible