Hot answers tagged

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


3

TL;DR The best way to remove a tab is to write and deploy a custom action. This can be done quite easily both in JavaScript and PowerShell. If for some reason you don't want a custom action (e.g. you want to remove the LIST tab for only one of the list views), you can still remove a tab after the page has loaded using JavaScript, but this usually makes up ...


3

Following are the steps to remove this button from Ribbon Create an empty SharePoint 2010 Solution, you may give your favorite name to it Add a feature by right clicking on the Features in Solution Explorer Right click on the Project and add a new item, choose empty element and name it Open the Elements.xml file from the newly added item Copy & paste ...


3

EASY solution is the CSS. Just inspect element from browser and apply some css like display: none; If you need this across the site, then add these style into your master page. If you need this for a specific library only, then add these into that specific page using Content Editor Web Part. You can use this plugin in Chrome for generating css.


3

I think you are almost there except that you have used assignment operator which will always return TRUE. Instead you have to use comparison '==' or '===' operators. update in below line EnabledScript="javascript:SP.ListOperation.Selection.getSelectedItems().length === 1;"


2

*Edited to actually provide a (hopefully) useful answer It is unfortunate that there is so much confusion in the MS developer community about what is allowed in custom actions in SharePoint 2013. Trying to be helpful, many have offered answers but given examples for SharePoint 2010. The solutions offered are not relevant to SharePoint 2013 add-in ...


2

You specified a wrong Id. Use Ribbon.Documents.New.NewDocument instead of Ribbon.Library.Actions.NewDocument. Your code should look like this: $CustomAction = $list.UserCustomActions.Add() $CustomAction.Title = "Hide New Document" $CustomAction.Location = "CommandUI.Ribbon" $CustomAction.commandUIExtension = " <CommandUIExtension> ...


2

Make sure that the content type of the missing page layout is set properly to "Page Layout" If you are deploying it from visual studio it should be something like below <File Path="PageLayouts\PageLayoutOneCol.aspx" Url="WABOneCol.aspx" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" Level="Published" ReplaceContent="true"> ...


2

I just opened the new document set form by going to ribbon > files > new document > new document set, copied the url and created a quick launch link with the same url. It works fine for me. Steps : Go to ribbon > files > new document > new document set in the given list Copy the whole URL In the right, at the bottom of the quick launch ...


2

Use EnabledScript property in CommandUIHandler. Example: EnabledScript="javascript: function enableButton() { var items = SP.ListOperation.Selection.getSelectedItems(); var ci = CountDictionary(items); if (ci > 0) { return true; } } enableButton();"


2

Try the following CSS: /* Hide Calendar Ribbon Body */ #RibbonContainer ul[id$="Calendar"] { display: none !important; } /* To hide Calendar Ribbon tab */ #RibbonContainer li[id$="Calendar-title"] { display: none !important; } You can add the above CSS either to the Script Edito/Content Editor web part or embed into the page.


2

You mean like using a link? Such as this one: {Site URL}/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={List GUID}&View={View GUID}&CacheControl=1 from the post Create Link to Export Library Contents to Excel


2

Create that Button in the Master Page and use javascript/jquery to hide it for pages whose current page URL do not contain "/Lists" or "/Forms". In this way you can have your button for only lists and libraries.


2

Please follow the following approach. Create a Sandbox solution rather then creating the SharePoint App Deploy your solution to your SharePoint Online Solution Gallery Activate your solution Activate the feature of your newly activated solution I know this is not the ultimate solution but this solution worked at my end. Let me know whether it helped you ...


1

Have you try to use : HideCustomAction ?? With this, you can hide specific custom (the custom and OOTB CustomAction).


1

You can try this: add another Custom Action with a Location set to where you want to hide it - for example attach it to list with a specific content type, or to a list based on a custom template (there are many different locations, just Google around): <CustomAction Id="RemoveRibbonButton" Location="CommandUI.Ribbon" ...


1

Please have a look at the three part series on how to customize Top Navigation: Customizing SharePoint 2010 global navigation with Css and jQuery – Part 1 Here is another great series on how to brand SharePoint 2010: Brand SharePoint: Global Navigation – The Journey Begins (Part 3) For the header like title and icon, you can create your own HTML instead ...


1

If you are trying to change the page layout for pre-created SharePoint default page than you will not get it (If you are changing the page layout of the page which are created before activating feature than it will not work.). The issue is that the feature is not enabled that allows the layouts. To fix the issue go to Site Actions -> Site Settings in the ...


1

Well, I found this, which will prevent the List Tools from appearing when you click into the listview webpart! That's even better. $(".s4-wpcell").removeAttr('onkeyup').removeAttr('onmouseup');


1

Solution in 1 line: EnabledScript="javascript:SP.ListOperation.Selection.getSelectedItems().length > 0;"


1

If you want to enter the page in edit mode just add ?ControlMode=Edit&DisplayMode=Design to your URL. If you want the page list item in edit mode you can get the url via JS like this: var ctx = SP.ClientContext.get_current(); var list = ctx.get_lists().getById(_spPageContextInfo.pageListId); ctx.load(list, 'DefaultEditFormUrl'); ...


1

Are they anonymous sites? If so login to get the ribbon. If not, it could be some CSS issue. Get the help of developer tool in browser (F12) and ascertain the issue Let me know if you have any questions


1

Assigning a list guid to registration id is not possible. In your case you would need to have a specific list-template-id or content type assigned to this list and assign this to the registration id. You get a custom listtemplate-id if you create a list definition in a solution and create a new instance of this list. Otherwise you could use the ...


1

You can use the EnabledScript attribute to enable the action just for your Meeting List. <CommandUIHandler Command="Ribbon.ListItem.CustomGroup.Controls.BtnSayHello.Command" CommandAction="javascript:doYourStuff();" EnabledScript="javascript: function isEnable(){ if(SP.ListOperation.Selection.getSelectedList() == "meeting list GUID"){ ...


1

Enabled SharePoint Server Publishing Infrastructure feature on the site collection level and then the SharePoint Server Publishing feature must be activated on the site level


1

Your CommandUIExtension should look like below: <CommandUIExtension xmlns="http://schemas.microsoft.com/sharepoint/"> <CommandUIDefinitions> <CommandUIDefinition Location="Ribbon.List.CustomizeList.Controls._children"> <Button ...


1

You can update same solution and then deploy updated WSP file to server. That's it.


1

Yes, you can do by placing below CSS: #s4-titlerow { display:block !important; } #s4-titlerow is the default SharePoint class for showing the title row. When you open the ribbon it will make this div as hidden. As other approach you can go with your custom master page. Here is the custom starter masterpage available that you can use: Starter Master ...


1

I think you're command handler lacks one character. Instead of doing 'length = 1', you should do 'length == 1'. Now you're assigning 1 to length, which always results in a positive result. The > 1 works because that's a compare operator and not an assign one :) I verified and this seems to work.


1

Yeah, it is pretty common problem. No matter how you try to edit your code it will be difficult to read, debug, manage, and update, when it is written inside elements.xml. I know that question is about the editor itself, but sometimes it is much better to write your JavaScript code in another .js file, and use only reference in CommandAction. You can load ...



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