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" onclick="javascript:Custom_Submit('...


3

Please try to append the stylesheet into iFrame using below code. It actually works for me before in one solution. function setFrameStyle() { $('iframe').load( function() { $('iframe').contents().find("head") .append($("<style type='text/css'> #s4-ribbonrow{display:none;} </style>")); }); }


3

Create a group which contains users who cant see page and browse buttons in the ribbon or vice versa, The Below function will hide the browse and page tab from the ribbon function HideBrowseAndPage() { var SPGroupName = "YourGroupName"; var clientContext = new SP.ClientContext.get_current(); var currentUser = clientContext.get_web().get_currentUser(); ...


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

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


3

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


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.


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

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

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


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

The mistake you are doing is you are using List's UserCustomActions, but here your ScriptLink is the part of SPWeb or SPSite. So you code need to be like UserCustomAction Scriptaction1 = clientContext.Web.UserCustomActions.Add(); instead of UserCustomAction Scriptaction1 = collUCA.Add(); Refer this


2

If you want to display a content to the user only with 'Full Control' permission level use the below snippet <Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="FullMask"> <div id="s4-ribbonrow" > </div> </Sharepoint:SPSecurityTrimmedControl> Different base permissions EmptyMask : Has no permissions on the Web ...


2

Create JavaScript or CSS code that hides the items from the ribbon Place that code inside Script Editor Web Part Use Audience targeting in web part properties to only "display" that web part to specific users (=to those from which you wish to hide the ribbon items)


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

I was having same issue when i need to set CSS color for some element and it was over written with default CSS. So I just used some tricky way for that. Please try following code once and let me know its worked for you or not. Because it worked for me. function setFrameStyle() { var mySiteIframe = $("iframe"); mySiteIframe.load(function(){...


1

If you have put that element in the feature which scope is set to "Site", then add another feature, set the scope to "Web", add your button item in this feature, saved, deployed, enabled the new feature from site feature. UPDATE Try this below EnabledScript: EnabledScript="javascript: var JustReturnTrue = function() {return true;}; JustReturnTrue();" ...


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

I got to the bottom of this after contacting Microsoft. The problem was that the SSSvc site feature wasn't activated on the Central Admin site, which can only be enabled using PowerShell: Enable-SPFeature -identity " SSSvcAdmin " -URL http://centraladminURL


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


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

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

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

Here's the easiest, simplest way I could come up with... if (someCondition == true) { $("#Ribbon\\.ListForm\\.Edit\\.Commit\\.Publish-Large").on("click",function(e){ e.preventDefault(); }).addClass("ms-cui-disabled"); }


1

https://books.google.co.in/books?id=q_L_jQ4VYpsC&pg=PT300&lpg=PT300&dq=create+features+elements+file,&source=bl&ots=2T5lGxMUfh&sig=D5G3Zp-_6rvt7Gs-XZHCoCjGMYQ&hl=en&sa=X&ved=0CEMQ6AEwBWoVChMIheak4vSbyAIVjFuOCh1RyASL#v=onepage&q=create%20features%20elements%20file%2C&f=false This may help. Gives an overview from 14/...



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