Tag Info

Hot answers tagged

8

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


5

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


4

Can't you do a custom javascript to add the ms-cui-disabled class to the buttons you'd like to disable? Edit: This just makes the button appear disabled but it will in fact be clickable. You might need to add the ms-cui-disabled class and a custom class so you can bind an onclick function to that custom class to prevent default and return false.


3

in 2013 you have to edit the master page directly to style it beyond the built-in themes. better yet, you can "legally" design master pages from scratch (now a supported feature) and set the CSS howver you like. microsoft calls it the "design manager" option of publishing sites. check it out here: http://msdn.microsoft.com/en-us/library/jj822363.aspx the ...


3

Just hide the Content Type from the button: Go in to List Settings and click on "Change new button order and default Content type" under the Content Types headline. Set "Visible on new button" to false for your unwanted content type. Absolutely no need for a custom action More information: ...


3

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


3

var clientContext = SP.ClientContext.get_current(); // Gets current site context var id = GetItemID(); //retrieve selected list item id to update data var listId = SP.ListOperation.Selection.getSelectedList(); var oList = context.get_web().get_lists().getById(listId); this.oListItem = oList.getItemById(id); function GetItemID() { var selectedItems ...


2

If the idea is that some content should "fall behind" the Ribbon (such as a header, navigation, etc.) you can just place your markup in the with the ID "s4-titlerow". This gets automatically hidden when the Ribbon displays, giving the effect that the Ribbon falls "on top" of the content. Otherwise, I would give a try to any of the script proposed ...


2

You need to append 15 to _layouts i.e /_layouts/15 in order to get hold of the file as you are working on SP 2013. UPDATE Put the javascript file under CustomRibbonButton folder in your project and use /_layouts/15/CustomRibbonButton/JavaScript1.js. The hive folder for SharePoint 2013 is 15. It used to be 12 for MOSS and 14 for SP 2010. This needs to be ...


2

Yes i think you can do that: After you created your Action Button(or ribbon control), in "Elements.xml" of your control you need to add "EnabledScript" command to it, like this: <CustomAction Id="Shakib.EditPermissionForce" Location="CommandUI.Ribbon"> <CommandUIExtension> <CommandUIDefinitions> ...


2

You can use css or javascript to hide the top blue bar: using this style in your css file: #suiteBar { display: none; } Or using this command in your document ready function: $('#suiteBar').hide();


2

thanks to this : Showing the tab on button click I created a function that click on my calendar. So, I simulate three clicks and it does what I wanted. Even though the ribbon is Hidden. click on webpart to make the contextual ribbon appear (still hidden) click on ribbon menu click on link in ribbon here is the code : function calendarClick(){ var ...


2

I thought of giving it a try and came up with the below solution. Consider the name of the Boolean Field in the Library/List is BoolField. The following JSOM code will Enable/Disable the Ribbon Button based on the field value. Place the code in a JS file and refer it from ScriptSrc in CustomAction function EnableDemoButton() { var context = ...


2

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


2

Try resizing your browser window (which browser are you using?) Change the browser zoom level (know bugs with that) Check for any JavaScript errors while loading the page Try to remove all custom CSS/branding - that is does it behave the same on a default non customized site?


2

Here's a link that helped me out when I needed to find out what javascript function is bound to each ribbon button. Basically, the steps you have to follow are (applies to sp2010, the might be slight differences in sp2013): Find the id attribute of the ribbon button. eg. Ribbon.EditingTools.CPEditTab.Markup.Html.Menu.Html.EditSource-Menu16. Next go to 14 ...


2

Since you don't want to use jQuery, you can use CSS to hide the ribbon buttons. For ex. #RibbonContainer a[id$="Datasheet-Large"], #RibbonContainer a[id$="Datasheet-Medium"], #RibbonContainer a[id$="CreateView-Large"], #RibbonContainer a[id$="CreateView-Medium"] #RibbonContainer span[id$="ModifyView-Medium"] { display: none !important; } Use ...


2

Change if (location.pathname.search('test.aspx') = 0) { To this: if (location.pathname.search('test.aspx') == 0) { You are assigning zero to location.pathname.search('test.aspx'), not testing if it is zero. Second part: window.SelectRibbonTab = function (SelectRibbonTab) { return function ("Ribbon.Read", true) { if ...


2

Use JS library SPServices from codeplex to get current user permissions: http://spservices.codeplex.com/wikipage?title=GetRolesAndPermissionsForCurrentUser And then just hide the menu item with JS. The hardest part is to obtain the permissions, which can be done smoothly with SPServices. You can add this JS to edited master page, or develop custom control, ...


2

You can use the SPRibbon.TrimById(controlId) method to hide controls. You can use other OM methods to determine the user's permission and call the TrimById method accordingly. For example, you could use DoesUserHavePermissions on the page's list item: ...


2

Firstly just to warn you that trying to hide the "Share with" option in SharePoint 2013 can be a bit like playing 'whack-a-mole'. The following CSS will hide this option on the context menu and also the ribbon bar (which was probably going to be your next question:-)). We normally have this in a CSS file that's loaded by a custom master page used in all ...


1

All you need to to is to pass some query strings to the aspx page without any JS call. As like in wiki this goes like this. <a href="/demo/wiki/Seiten/home.aspx?ControlMode=Edit&DisplayMode=Design">Edit this page</a> This works for every page and not only for wiki page. The valid control mode values can be found on the MSDN as the values for ...


1

This happens to me when I use low resolution screen, may I suggest that you take a look at it on a screen with higher resolution?


1

You can use Sharepoint:SPSecurityTrimmedControl . Add the tags for ribbon inside this tag.It will be displayed to only those users who has the permission specified in the permission string. <Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="FullMask"> </Sharepoint:SPSecurityTrimmedControl> Below is link ablout the ...


1

I don't have the exact command to hand but each ribbon button had a permissions mask property that you could set so only site collection admits have it enabled. This property is used as part of xml declaration of ribbon elements and may be accessible through c#. Failing that I think you would need to hide the ribbon button and the recreate in xml definition ...


1

I might not be able to give you an exact answer as the solution architecture it is quite open to debate. I would not see a good practice to call the WS from ribbon button via JavaScript, but rather go for launching a dialog window, loading an Application Page. This way you get better error control, and full server-side API, therefore much easier to ...


1

sorry im not being clear!: there are two types of application pages! the first contains no inherited masterpage and contains a reference to the .cs page but that is about it... it has head, body tags, looks somthing like this: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Meeting.aspx.cs" Inherits="meeting.Meeting" %> <!DOCTYPE html ...


1

You have to use a custom action on your contenttype.. look at the answer on this thread How can I add button to ribbon that visible only for specific content type?


1

You cannot hide features after they have been deployed. Correction: Web Application is not a border for feature definition visibility in SharePoint 2010 SP2 as reflecting on Microsoft.SharePoint.WebControls.FeatureActivator shows. Actually, what you should have done is you should have deployed to the one and only web application that is supposed to ...


1

you could add a custom action, maybe a checkbox. <?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Id="MyRibbons.RibbonScript" ScriptSrc="~SiteCollection/_layouts/MyRibbonsScript.js" Location="ScriptLink"> </CustomAction> <CustomAction ...



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