Hot answers tagged

17

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 ...


10

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 ...


10

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

I know you asked for 2013 but I'm leaving the 2010 one here too in case anyone go crazy like you did. 2010 When any ribbon tab is open (other than the 'browse' one) it forces a 135px height on its container, which is a sibling of the #s4-workspace container, see where I am going? #s4-ribbonrow[style='height: 135px;'] ~ #s4-workspace #s4-leftpanel { ...


8

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)) ...


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

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>


8

They have a JavaScript API for this: http://msdn.microsoft.com/en-us/library/office/ff408647(v=office.14).aspx You can even add command ui extension like you have them. var context = new SP.ClientContext.get_current(); this.site = context.get_web(); var customAction = this.site.get_userCustomActions().add(); ...


8

Check http://sharepoint.stackexchange.com/a/52877/35604: <script type="text/javascript"> function Custom_Submit(command) { SP.Ribbon.PageState.Handlers.showStateChangeDialog(command, SP.Ribbon.PageState.ImportedNativeData.CommandHandlers[command]); } </script> <input type="button" ...


7

You can do it with SharePoint Management shell: Set-SPSuiteBarBrandingElement -WebAppUrl http://sp2013.intranet.adventureworks.com -Text 'AdventureWorks Intranet' Just replace the AdventureWorks Intranetwith the text you want. More details here


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" ...


7

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

just add .ms-dialog in front of the class you want to change, and it will only affect the modal dialogs: .ms-dialog .ms-cui-topBar2{ background-color: red; }


6

There are a couple reasons it may not be displaying: You're not running the Enterprise edition of SharePoint. This feature requires Forms Services, which are only available in EE. You're looking at a list type that does not support this feature. Basically, any list type that uses a non-standard display for an item, like Calendars, will not have this option ...


6

I noticed that the in the webpart div container there were two attributes, 'onkeyup' and 'onmouseup' which called a JavaScript function to trigger the list tools to show. I added a single line of jQuery code to remove those two attributes from the s4-wpcell div container and I no longer get the list tools to show on when I click anywhere inside the list ...


6

You can use SP.ListOperation.Selection.getSelectedItems() to get the currently selected item. Here is a code sample: var context = SP.ClientContext.get_current(); var selectedItems = SP.ListOperation.Selection.getSelectedItems(context); var item; for (i in selectedItems) { alert(selectedItems[i].id); } Once you have the id of the item, you will ...


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

You can even use GetCurrentCtx() to get context info and get much of information among the list title (name): var ctx = GetCurrentCtx(); var title =ctx.ListTitle;


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

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.


5

As I posted in the question, the class Microsoft.SharePoint.Publishing.WebControls.ConsoleVisibleUtilities - which seems to control ribbon visibility - contains some check that require the user to have specific permission on the site. This means that server side the ribbon is already "removed" if the user fails to match certain requirements - thus giving no ...


5

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 - ...


5

Since those are new to SharePoint 2013, you should know the terminologies and it will be easy to find.. The Green one is called "Suite Bar", while the grey one (with Share, Follow buttons) are called "Promoted Actions".. Using delegate you can have your custom Suite Bar or Promoted Actions.. Following tutorials should help: Add,Remove Links in Top ...


5

Create a JS file (HideScript.js) and paste the following code in it, which hides the ribbon for a certain page. Upload the JS file to some document library for e.g. "SiteAssets" function HideRibbon() { $("#s4-ribbonrow").hide(); var newHeight = $(document).height(); if ($.browser.msie) {newHeight = newHeight - 3; } ...


5

Yes it is possible, check this tutorial out that is demonstrating how to create a Visual WebPart as a Text editor and it's also connected to Ribbon as claimed by author, however it's for SharePoint 2010 but I am pretty sure it will work as it is or with some changes for SharePoint 2013 as well. Develop a custom editable Visual Web Part (WebPart) Helpful ...


5

Follow this guide from Waldek, it is for 2010 but should work just as well from 2013: http://blog.mastykarz.nl/consistent-content-authoring-sharepoint-2010-rich-text-editor/ Basically: <PublishingWebControls:RichHtmlField FieldName="PublishingPageContent" HasInitialFocus="True" AllowFonts="false" AllowTextMarkup="false" ...


5

Apparently, this is a common problem (I'm surprised that nobody already had a custom solution). Apparently, this is what causes the problem: When you add a web part to the standard list views, the page is no longer classified as a list view page, but instead it is classed as an application page. Katrina over on Stack Exchange posted this solution. ...


5

This is not a bug. If you have more than one web part on a page then you must click the one you want the ribbon for.


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



Only top voted, non community-wiki answers of a minimum length are eligible