Hide Ribbon - Sharepoint 2013

 I have added the following to hide the ribbon for users that dont have full control.
It works to hide the ribbon for users that don't have full control, but on the users it removes it from it removes half of the viewing space on the page.
When I remove the SPSecurityTrimmedControl it goes back to normal. 
Could someone assist with troubleshooting this. Any help is appreciated. 
<div id="ms-designer-ribbon" >
<!--MS:<SharePoint:SPSecurityTrimmedControl runat="server" PermissionsString="ManageWeb" EmitDiv="true">-->
<!--SID:02 {Ribbon}-->
<!--PS: Start of READ-ONLY PREVIEW (do not modify) --><div class="DefaultContentBlock" style="background:rgb(0, 114, 198); color:white; width:100%; padding:8px; height:64px; overflow:hidden;">In true previews of your site, the SharePoint ribbon will be here.</div><!--PE: End of READ-ONLY PREVIEW -->
<!--ME:</SharePoint:SPSecurityTrimmedControl>-->
</div>

Hi Try this code in here
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
<script type="text/javascript">
$(function(){
ExecuteOrDelayUntilScriptLoaded(setRibbonbyUserPermissons, "sp.js");
function setRibbonbyUserPermissons()
var context = new SP.ClientContext.get_current();
web = context.get_web();
this._currentUser = web.get_currentUser();
context.load(this._currentUser);
context.load(web,'EffectiveBasePermissions');
context.executeQueryAsync(Function.createDelegate(this, this.onSuccessMethod), Function.createDelegate(this, this.onFailureMethod));
function onSuccessMethod(sender, args)
if (!web.get_effectiveBasePermissions().has(SP.PermissionKind.manageWeb))
$("#s4-ribbonrow").hide();
function onFailureMethod(sender, args)
console.log('Fail: ' + args.get_message() + '\n'+ args.get_stackTrace());
</script>
https://rvieiraweb.wordpress.com/2013/04/08/hideshow-ribbon-by-user-permissons-sharepoint-2010/
http://sharepoint.stackexchange.com/questions/69133/jquery-sp-js-objects-to-test-if-current-sharepoint-user-has-full-control-owner
Kind Regards,
John Naguib
Technical Consultant/Architect
MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation
Please remember to mark your question as answered if this solves your problem

Similar Messages

  • Hide ribbon in Sharepoint Foundation 2013 for visitors group

    Hello,
    I'm looking for a way to hide the ribbon in Sharepoint Foundation 2013. In this forum I can find many ways to do it but every possibilities are for Sharepoint 2010 or Sharepoint 2013 and not for foundation.
    Also if I want to change the .html master page I can't because it doesn't exist in my site.
    Anyone can help me?
    Regards
    Américo Silva

    You can use SPSecurityTrimmed Control in sharepoint designer, check this :
    http://www.infowisesolutions.com/blog/Comments.aspx?ArticleId=28
    http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.spsecuritytrimmedcontrol.aspx
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d054d018-bb59-409c-b6dd-8fbe6828dbbd/hide-ribbon-for-site-visitors-read-only-addandcustomizepages?forum=sharepointgeneralprevious
    <Sharepoint:SPSecurityTrimmedControl ID="SPSecurityTrimmedControl2" runat="server" PermissionsString="AddListItems">
    <script type="text/javascript">
    document.getElementById("s4-ribbonrow").style.display = "block";
    </script>
    </Sharepoint:SPSecurityTrimmedControl>

  • How to hide libraries from breadcrumb in SharePoint 2013?

    Hi,
    How to hide libraries from breadcrumb in SharePoint 2013? just we want to display parent and least node like below,
    Home Site > Test page
    not like,
    Home Site > Pages > Test page
    Please help us to resolve this.
    Thanks., Prakash

    hi
    OTB breadcrumb have many problems, e.g. it doesn't work properly also with friendly urls. The simplest way is to create custom breadcrumb, e.g. as shown here:
    Building breadcrumbs the way you want it in SharePoint 2010.
    Blog - http://sadomovalex.blogspot.com
    Dynamic CAML queries via C# - http://camlex.codeplex.com

  • Hide view links in list view in sharepoint 2013

    Hi
    How I can hide view links in list view in sharepoint 2013. Like below pic?
    Thanks.

    for that you can use id of its parent span element something like below.
    #WPQ2_ListTitleViewSelectorMenu_Container {
    display: none !important;
    Thanks.

  • How can I Hide(not Disable) the Save As and Exit options in the File menu of Excel Documents in SharePoint 2013?

    Hi,
    I want to hide(not disable) the "Save As" and "Exit" options in the File Menu of Excel Documents in SharePoint 2013.When I make changes in the excelribbon.css file of xlviewer.aspx,all the options under File menu are getting hidden but
    I want to hide only these two options while retaining the others.
    Kindly suggest me a method to achieve this.
    Looking forward to your reply at the earliest.
    Thanks in advance.
    Regards,
    Sanjana

    Hi Sanjana,
    To hide the “Save As” and “Exit” options in xlviewer.aspx page in SharePoint, I recommend to use the code below(however it is not recommended):
    <style>
    div.cui-menusection li.cui-menusection-items:nth-child(2)
    display:none !important;
    div#m_excelWebRenderer_ewaCtl_menuJewelSaveAs{
    display:none !important;
    div#m_excelWebRenderer_ewaCtl_msJewelSecondary{
    display:none !important;
    </style>
    As “:nth-child()” selector is supported in IE 9 and later versions, please use IE 9 or later versions’ IE browser.
    http://www.w3schools.com/cssref/sel_nth-child.asp
    Best regards.
    Thanks
    Victoria Xia
    TechNet Community Support

  • Controls in ITEM and LIST tabs of Ribbon disabled always in Punishing SharePoint 2013 site if i add list to home page as List View Webpart

    Hi,
    Below is the scenario,
    If i created any custom list and navigating to the list (AllItems.aspx) and on selecting the item, i can see controls in ITEM and LIST tabs of Ribbon are enabled in SharePoint 2013 publishing site.
    If i add the same list in the home page (add web part --> select list view webpart) in the publishing site, on selecting of item, all controls in ITEM and LIST tabs of Ribbon are disabled always.
    Please help me to fix this issue ASAP.
    Regards,
    Krishna

    Hi,
    Thanks for your reply.
    Ribbon controls (only ITEM and LIST tab) still in disabled mode even if i selected the item in the list view webpart.
    Also, i have noticed the below things,
    when i create a published site (default page : default.aspx) and add the list view webpart in the default page, the controls are in disabled mode on selecting item in list view webpart.
    when i create a team site (default page : home.aspx) and add the list view webpart in the default page, the controls are in enable mode on selecting item in list view webpart.
    Please help me on this.
    Regards,
    Krishna

  • Ribbon disabled on Publishing Pages in SharePoint 2013

    When using a blank web part page in a Pages Library (Publishing Feature actived), the ribbon is disabled for a document web part on the page.
    After adding the document web part and saving the page, I click in the document web part to activate the ribbon. Clicking on the Files tab in the ribbon display the document library ribbon but it is disabled. Clicking on the library tab also displays a disabled
    ribbon.
    We have been able to reproduce this in multiple instances of SharePoint 2013 Enterprise including on a client site.
    This works in SP2010!
    In a site pages library this also works in SP2013...
    Is this a bug in SharePoint 2013 or is this working as designed in SharePoint 2013
    Thanks in advance!

    I tried to replicate the issue by creating the page with blank web part page, but i can see the Ribbon is available.
    MCTS,MCPD Sharepoint 2010. My Blog-
    http://www.sharepoint-journey.com
    If a post answers your question, please click "Mark As Answer" on that post and "Vote as Helpful

  • Disable/Hide Blog from Mysite in SharePoint 2013

    Hi All,
    Do we have any chance to Disable/Hide creating blog option in Mysite 2013? When user accessing Mysite for the first time a new site collection is creating, any chance to avoid this? Do we have any chance to restrict users to create a sub site under mysite
    2013?  
    Your help will be appreciated.
    Thanks,
    Nisanth

    Hi Nishant,
    Hope the below links helps you
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/73a81d79-6f90-4256-bbba-dbb107419a68/hide-blog-feature-from-mysite-in-sharepoint-2013?forum=sharepointdevelopment
    http://wellytonian.com/2012/10/restricting-permissions-on-mysites-sharepoint-2013/
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/ceb9a2df-f029-4ac8-b225-7627d114d682/sharepoint-2013-prevent-mysite-users-from-creating-subsite-except-allow-blog-site?forum=sharepointgeneral
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • Adding Attchement button inside create new discssion in SharePoint 2013 Discussion Board not from the Ribbon

    all that i want to customize create a new discussion layout by adding new attach new document but not by using Ribbon

    Hi,
    For your issue, you can customize the layout for the discussion board new form with content editor web part.
    For more information, you can refer to the blog:
    http://www.markrackley.net/2013/08/29/easy-custom-layouts-for-default-sharepoint-forms/
    http://www.shillier.com/archive/2013/03/26/uploading-files-in-sharepoint-2013-using-csom-and-rest.aspx
    Actually in my opinion, the new file upload behavior in SharePoint 2013 is great. As we can click in the body and upload files via the ribbon INSERT tab.The
    new 2013 discussion board allow attachments to be stored in any document libraries besides the default Site Asset library.
    Reference:
    http://sharepointconnoisseur.blogspot.in/2013/07/tips-to-use-sharepoint-2013-discussion.html
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Eric Tao
    TechNet Community Support

  • SharePoint 2013 - Missing Publishing Page Ribbon/Tab on custom page layout - Page language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,.... VS CodeBehind="BlogDemo.aspx.cs" Inherits="DemoProject.Branding.BlogDemo"

    I created page layouts using Visual Studio 2013 and SharePoint 2013. I added both ASP.NET web controls (e.g. asp:Label, asp:HyperLink) and SharePoint web controls (e.g. SharePointWebControls:UrlField) in a page layout.
    However, when I deployed the solution, I cannot edit all the ASP.NET & SharePoint web controls (column fields from custom content type used for the page layout) except the web part zones.
    Then I found out about inherits property:
    1) if I use the code for the page layout as shown below:
    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BlogDemo.aspx.cs"
    Inherits="DemoProject.Branding.BlogDemo" MasterPageFile="/_catalogs/masterpage/DemoProject/DemoMasterPage.master"
    %>
    Result: There is no publishing ribbon/tab. E.g. Edit, Publish..... although both ASP.NET & SharePoint web controls can be displayed on the page layout.
    Screenshot:
    2) if I use the code instead as shown below:
    <%@ Page language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=15.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c"
    meta:progid="SharePoint.WebPartPage.Document" %>
    Result: Publishing ribbon/tab is available, but ASP.NET web controls won't appear. Only SharePoint web controls appear on the page layout.
    Screenshot:
    I wonder how I can combine both codes to ensure that the page layout can have publishing ribbon/tab and displays both ASP.NET & SharePoint web controls.

    Found a way to solve the issue
    I follow the solution:
    http://pinnacleofindiana.com/blog/developers/2012/03/28/creating-a-sharepoint-2010-page-layout-with-code-behind/
    http://blogs.msdn.com/b/kaevans/archive/2011/04/02/code-behind-page-layouts-with-visual-studio-2010.aspx

  • How to hide the Columns and Views for Login user in SharePoint 2013

    Hi Friends,
    How to hide the Columns and Views for Login user in SharePoint 2013? Is it possible using OOB features? If not possible how can we hide the Columns and Views for Login user?
    Could you please help on this.
    Thanks,
    Tiru
    Tiru

    Hello Tirupal,
    There is no OOB way to do this.
    Please check this codeplex solution to achieve the same.
    https://sp2013columnpermission.codeplex.com/
    My Blog- http://www.sharepoint-journey.com|
    If a post answers your question, please click Mark As Answer on that post and Vote as Helpful

  • Not able to Enable the Custom Ribbon button On Pages in Sharepoint 2013

    Hi Team,
    Not able to Enable the Custom Ribbon button On Pages in SharePoint 2013. we have used the button edit properties section of the Pages.
    Same is working for Lists but not for Pages.
    Thanks,
    Shrikant

    Thanks for your reply.
    Right now my server is not working to get the code. will share you in some time.
    I am just thinking if page get checked out and my control is also present in the Edit properties section then do I need to specify something explicitly to enable the button. The same is working for Lists.

  • Hide option for SharePoint 2013 UI upgrade

    Hello,
    I just want to know if there is a way to hide the banner which pops up for UI upgrade on SharePOint 2013? We are trying to leave few sites on 2010 UI only.
    Thanks,

    Hi,
    Per my understanding, you want to hide the banner which pops up for UI upgrade as below:
    You can add this custom CSS style into the master page, it will hide the banner for all the pages in the current site collection.
    <style type="text/css">
    #status_preview {
    display: none !important;
    </style>
    About how to add custom CSS style into master page:
    http://techtrainingnotes.blogspot.com/2012/05/adding-javascript-and-css-to-sharepoint.html
    Thanks                      
    Patrick Liang
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support,
    contact [email protected]
    Patrick Liang
    TechNet Community Support

  • How to hide username in comments section of sharepoint 2013 blog page

    I have a blog page in SharePoint 2013. In that, in the comments section, i have to hide the username of the person who posted the comment.
    I also have to hide it from the page source, hence i cannot use css. Please suggest some solution,if possible using xslt.

    Open the blog.xsl file which is located in "/_layouts/XSL/blog.xsl"
    For safe side take the back up of blog.xsl file and open it and find the below div
    <div class="ms-PostFooter">
    <!-- For the author field, render it using the span style and preceed it with the word "by"-->
    <span class="ms-postfootercolor"><xsl:value-of select="$thisNode/../@resource.wss.ByPrefix"/></span><xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text><xsl:call-template name="RenderAuthor"/>
    <xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text><span class="ms-postfootercolor"><xsl:value-of select="$thisNode/../@resource.wss.blog_postfooter_at"/><xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text>
    <xsl:choose>
    <xsl:when test="$ContainerId"><xsl:text disable-output-escaping="yes">&lt;#= spMgr.RenderFieldByName("PublishedDate", listItem, listSchema) #&gt;</xsl:text></xsl:when>
    <xsl:otherwise><xsl:value-of select="@PublishedDate" disable-output-escaping="yes"/></xsl:otherwise>
    </xsl:choose></span>
    <div>
    In the above div remove the span tag
    <!-- For the author field, render it using the span style and preceed it with the word "by"-->
    <span class="ms-postfootercolor"><xsl:value-of select="$thisNode/../@resource.wss.ByPrefix"/></span><xsl:text disable-output-escaping="yes" ddwrt:nbsp-preserve="yes">&amp;nbsp;</xsl:text><xsl:call-template name="RenderAuthor"/>
    If you any help please let me know

  • How to hide ribbon but show welcome control for all users using security trimmed control in sharepoint 2010

    Hi All,
    I have a requirement to hide ribbon in a document library for the read permission users. I have applied SPSecurityTrimmedControl, it is working for the read permission user but for the whole site it is hiding and also unable to see the welcome control,
    like user name, sign in as different user, etc.,
    <Sharepoint:SPSecurityTrimmedControl runat="server" ID="spTrimRibbon" PermissionMode="All" Permissions="ManageLists">
    I want to apply SPSecurityTrimmedControl to specific list/library with welcome control. Can someone please help me here.
    I Appreciate your assistance...
    MercuryMan

    Hello MercuryMan,
    I guess you have applied your code in master page that's why it is hidden from site. To hide specific list ribbon, go to your list-->and edit the page-->then add content editor webpart and apply below script.
    <SharePoint:SPSecurityTrimmedControl PermissionsString="ManagePermissions" runat="server">
    <div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle">
    </div>
    </SharePoint:SPSecurityTrimmedControl>
    http://blogs.msdn.com/b/sharepointdev/archive/2012/04/30/how-to-hide-the-ribbon-in-sharepoint-2010-rajeswari-mohandas.aspx
    Hope it could help
    Hemendra:Yesterday is just a memory,Tomorrow we may never see
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

Maybe you are looking for

  • How can i declare 2 or more dimension array as function parameter???

    I am new to Objective-C and Cocoa. and now I have a problem. I want to send 2 dimension array to function but it cannot compile the error is "array type has incomplete element type" Please help me This is my Interface + (void) reValueInArray: (int[][

  • Problem in saving while drag & drop in Mac(specific) Urgent !!!

    The mothod below return the session object that is stored in the text file. after reteriving the i type cast the object accordingly. The main problem is :- this method works properly when i do normal save in my programme. But when i drag the text fro

  • ADF- Jdev11.1.1.6 Business Components supports distributed transaction ?

    Hi , I'm using Jdeveloper 11.1.1.6 release 1 . How to implement distributed transaction in ADF business component level. In my scenario i need to perform A Single transaction with two different database . I do need to role back both if either one fai

  • Attachments at header level from SRM BI/BID  to ECC PO

    Hello All, Our landscape is SRM 5.0sp09 & backend ECC 6.0. SRM tech scenario - CLASSIC SRM business scenario - Sourcing with Bid Invitation We have set up DMS in ECC and are now able to transfer item level attachments from SRM BI and BID to ECC follo

  • Date parameters with Sage

    I am attempting to build a report for SSRS using Visual Studio.  I have a query that is returning results, and the report is functioning perfectly.  However, the end user decided they wanted a date range selector on this report.  I have done this hun