Answered Internet facing publishing site - Ribbon

  • Monday, December 28, 2009 10:34 AM
     
     
    I'm working on customizing the design of a site which will be an internet facing publishing site. Does anyone know if the Ribbon box (with links to site settings, login information +++) will always show (even to anomymous users)?

All Replies

  • Wednesday, December 30, 2009 2:55 AM
     
     
    You can see that it does show up for Anonymous users on my SPF Internet site (Foundation - no publishing): http://www.cospug.com
    SharePoint Architect || My Blog
  • Wednesday, December 30, 2009 11:37 AM
     
     
    Thanks.

    My next question is; how can I hide the Ribbon for anonymous users? I mean, I would go as far as saying that is should be OOTB. Microsoft have put quite a bit of focus on making SharePoint 2010 internet friendly and it's as good as impossible to build your branding around the Ribbon.

    So, if anyone knows how to hide the Ribbon from anonymous users, please let me know how.

    Thanks.
  • Wednesday, December 30, 2009 2:37 PM
     
     
    Using the Publishing Site template will give you what you need. Create a new site collection with Publishing Site template (instead of Team Site or Enterprise Wiki templates - which will generally be used for mainly collaboration sites) for your internet facing site. Anonymous users will not see a ribbon when they visit your site.
    Asif Rehmani, MVP. Host of http://www.sharepoint-videos.com (SharePoint and InfoPath Video Tutorials). Co-author of Book "Professional SharePoint Designer 2007"
  • Wednesday, December 30, 2009 4:39 PM
     
     
    But there is no publishing in SPF, and that will likely be the primary tool used for Internet facing sites - at least those of regular people like myself as opposed to corporations wanting to have an Internet presence.  What do SPF sites do?
    SharePoint Architect || My Blog
  • Thursday, January 14, 2010 5:08 AM
     
     
    For a true internet facing site, I would not recommend using just SharePoint Foundation. IMHO, SharePoint Foundation is for collaboration, not for publishing content that's edited by few and consumed by many. Having said that, it's of course ok for individuals or microbusinesses to put up sites using just SharePoint Foundation for the purpose of disseminating some information out on the net.
    Asif Rehmani, MVP. Host of http://www.sharepoint-videos.com (SharePoint and InfoPath Video Tutorials). Co-author of Book "Professional SharePoint Designer 2007"
  • Thursday, January 14, 2010 5:16 AM
     
     
    For a true internet facing site, I would not recommend using just SharePoint Foundation. IMHO, SharePoint Foundation is for collaboration, not for publishing content that's edited by few and consumed by many. Having said that, it's of course ok for individuals or microbusinesses to put up sites using just SharePoint Foundation for the purpose of disseminating some information out on the net.
    Asif Rehmani, MVP. Host of http://www.sharepoint-videos.com (SharePoint and InfoPath Video Tutorials). Co-author of Book "Professional SharePoint Designer 2007"

    No argument there.  I also noticed that he referred to the Ribbon and referenced the Site Settings button + Profile button, but neither of those are part of the ribbon.  Do those actually go away with a publishing page, or just the ribbon?

    SharePoint Architect || My Blog
  • Thursday, January 14, 2010 6:12 AM
     
     
    >>I'm working on customizing the design of a site which will be an internet facing publishing site

    You are better off by building your own custom Master Page and Page Layouts which do not include the Ribbon for your publishing site. Everything is a div in the master page which you can also easily hide it in your styles. But instead of tinkering with the default master page, you could take a copy of existing master page and work on it. For a start, you could start with a minimal master page which can be found here - C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\minimal.master - As far as I know, this minimal.master does not have Ribbon in it.


    Regards,
    Chakkaradeep || SharePoint Developer - MCTS SharePoint Dev, WSS Dev
    http://www.intergen.co.nz || Twitter: http://twitter.com/chakkaradeep || http://www.chakkaradeep.com
  • Thursday, January 14, 2010 6:13 AM
     
     
    But there is no publishing in SPF, and that will likely be the primary tool used for Internet facing sites - at least those of regular people like myself as opposed to corporations wanting to have an Internet presence.  What do SPF sites do?
    SharePoint Architect || My Blog

    Regarding using SharePoint Foundation 2010 for extranet sites, I think you need to get the Extranet license from Microsoft. With SharePoint 2010, Microsoft has introduced Intranet/Extranet Licenses depending on the scenario you want to use SharePoint. I don't think that applies for SharePoint Foundation 2010. You can read about this more here .
    Regards,
    Chakkaradeep || SharePoint Developer - MCTS SharePoint Dev, WSS Dev
    http://www.intergen.co.nz || Twitter: http://twitter.com/chakkaradeep || http://www.chakkaradeep.com
  • Friday, January 15, 2010 1:27 AM
     
      Has Code
    Per this blog post, this is the code. I have not tried this, but see if this helps you.

    public void HideRibbonForAnon()
    {
      SPRibbon current = SPRibbon.GetCurrent(this.Page);
    
      if (current != null && !this.Page.Request.IsAuthenticated)
      {
        current.CommandUIVisible = false;
    
        SiteActions actions = SiteActions.GetCurrent(this.Page);
    
        if (actions != null)
        {
           actions.Visible = false;
        }
        HideStatusBar();
      }
    }
    
    internal void HideStatusBar()
    {
    
       string script = 
          "document.onreadystatechange=fnRemoveAllStatus; function fnRemoveAllStatus(){removeAllStatus(true)};";
       this.Page.ClientScript.RegisterClientScriptBlock(typeof(HideTheRibbon), "statusBarRemover", script, true);
    }
    
     

    Source: http://www.elumenotion.com/Blog/Lists/Posts/Post.aspx?ID=106


    Blog: Alpesh Nakar's Blog | Twitter: Follow Alpesh on Twitter |SharePoint Resources: Just SharePoint Resource Center | Follow Just SharePoint updates on Twitter
  • Monday, January 25, 2010 1:37 AM
     
     
  • Tuesday, January 26, 2010 7:39 AM
     
     
    Hi guys,

    I'm still searching for a solution on how to hide the ribbon part of my internet-facing publishing site.

    I have now tested it real-world and what happens is that the ribbon still shows. That is, it shows the 'Navigate up' icon/button and a 'Sign in' link. I really don't want that to show, well, our designer really doesn't want that to show.

    Now, I've found articles on Google with code that supposedly takes care of this 'problem'. The thing is that only the code has been posted, not guidelines on how to implement it. I mean, how do you attach the code and to what? Here's one blog where the code is listed: http://www.elumenotion.com/Blog/Lists/Posts/Post.aspx?List=64b38372-f170-48e3-9720-d3398b3f211c&ID=106 .

    Edit: I just noticed that this code was posted in the thread. Sorry about that. But, has anyone tried it? How did you do it?

    Anyone got any good ideas? I would have thought that the SharePoint:SPRibbon control would have a property that would handle this...

    Thanks!

  • Tuesday, January 26, 2010 5:09 PM
     
     Proposed Answer

    Hi Relapse666,

    I've the same problem last week. I'm not sure it is the best solution, but it seems to work. I've added a security trimmed :

    <Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ViewFormPages">
    <!-- =====  Begin Ribbon ============================================================ -->
    <div id="s4-ribbonrow" class="s4-pr s4-ribbonrowhidetitle">
    ...
    </div><!--/ Ribbon ============================================================ -->

    </SharePoint:SPSecurityTrimmedControl>

    You can specify the PermissionString you want


    regards,

    Emmanuel Baron, AlphaMosaik

  • Wednesday, January 27, 2010 6:16 AM
     
     Answered


    You can use an <asp:LoginView to hide the ribbon with CSS for anonymous users:

        <asp:LoginView id="LoginView" runat="server">
         <AnonymousTemplate>
         <style type="text/css">
           body #s4-ribbonrow {
            display: none;
           }
          </style>
         </AnonymousTemplate>
        </asp:LoginView>


    Randy Drisgill - MVP SharePoint Server
    SharePoint911 Branding and UI Services
    My Blog: http://blog.drisgill.com
    Wrox: Professional SharePoint 2007 Design
  • Thursday, January 28, 2010 9:31 PM
     
     
    Randy,
    Your approach made the most since to me.....I went to my master page (sharePoint 2010) and pasted the code above into the head section.   After saving the master page, I refreshed my browser, and then at my normal default page "........./Pages/default.aspx" I now get a "File Not Found" error....after looking at logs, my master page was the file that wasn't found.  So is putting this code into my head incorrect?  Seems to break my master page.......(checking it back in inside of SP Designer fixed it)

    .....any ideas what could be happening and why that code did not work for me?

    Thanks.....
    • Proposed As Answer by DJ Monzyk Thursday, January 28, 2010 10:11 PM
    • Unproposed As Answer by Chakkaradeep Chandran Friday, January 29, 2010 7:47 AM
    •  
  • Friday, January 29, 2010 2:29 AM
     
     
    Check to make sure the master page and any loaded assets are checked in as major versions and approved. Sounds like something isn't checked in.
    Randy Drisgill - MVP SharePoint Server
    SharePoint911 Branding and UI Services
    My Blog: http://blog.drisgill.com
    Wrox: Professional SharePoint 2007 Design
  • Wednesday, July 28, 2010 2:08 PM
     
     
    Greatly appreciated Randy, the anonymous template works great.  After using the security trimmed controls my scrollbars no longer work but the anonymous template changes the style based on the logged in user and that is exactly what needs to happen.  Greatly appreciated!!!
  • Monday, August 02, 2010 2:33 PM
     
     

    Randy, that works great, and I'm using it succesfully to hide both the ribbon and the Site Actions / Navigate Up / Sign In bar, because it doesn't fit the design that the graphic designer has produced.

    My question is - How do I let the admin users log in now I've hidden the sign-in bar? What I was hoping to do was to create a single page which would use the default v4 master page, and let admins log in there, but I have no idea how to do this. Any clues you could share with us?

  • Monday, August 02, 2010 3:20 PM
     
      Has Code

    @James - What type of Authentication are you using?  If you are using Active Domain, I can share a solution where I placed a simple login link in my footer.

     

    I just placed this code in my masterpage where I wanted the item to appear, wrapped in a div:

     

     

    <wssuc:Welcome id="IdLogin" runat="server" EnableViewState="false"></wssuc:Welcome>
    
    <wssuc:MUISelector runat="server"/>

    Then, because in the ribbon which would now appear on login, (the normal account actions are present) I hide the div which contained the login link so there weren't duplicate controls to confuse the user.  Not sure if this is correct or a best practice, but has worked for us on the site.


  • Monday, August 02, 2010 3:32 PM
     
     

    That's cool DJ but I assume that with your solution, your log-in control is visible on every page? My question was really how I go about creating a single page on the site to handle log-ins, and hide the log-in functionality on the rest of the site.

    What I effectively want is a way to make the log-in page use the default v4 masterpage, while the rest of the site uses another. Do you know how to do that?

  • Monday, August 02, 2010 3:39 PM
     
     
    @James -  I suggest using a different page layout (instead of another masterpage) where you invoke the control, and use that unique page layout on your login page.
  • Monday, August 02, 2010 3:43 PM
     
     

    If you just want to have a one-off login page, you can make a page with a link to /_layouts/authenticate.aspx that fires of the standard SharePoint login.


    Randy Drisgill - MVP SharePoint Server
    SharePoint911 Branding and Design Services
    My Blog: http://blog.drisgill.com
    Wrox: Professional SharePoint 2010 Branding and UI Design
  • Tuesday, August 03, 2010 3:46 PM
     
     

    Thanks Randy and DJ. As you may have guessed I am very new to SP2010 and have arrived with a bunch of preconceptions which are hampering my understanding of the system - coming from a standard ASP.NET background, I have to get used to doing things "the SharePoint way".

    Can I just clarify one point then: When adding a page of content to my Publishing site, is there any way the editor can select which masterpage will be applied? I was hoping there would be some kind of dropdown menu of available masterpages, but it seems to me that SP only supports one masterpage at a time, selected in the Site Settings / Look and Feel / Master Page area.

  • Tuesday, August 03, 2010 3:50 PM
     
     
    @James - I'm also pretty new to SharePoint, but here is my understanding.  As you said, you can apply masterpages at the SITE level using Site Settings.  If you need a different layout at the page level, this is where you want to create different Page Layouts.  These are selectable by content editors in the ribbon on a per-page basis.
  • Wednesday, November 03, 2010 8:29 AM
     
     
  • Friday, March 25, 2011 4:52 PM
     
     

    You are correct, only one master page can be applied to an SPWeb at a time.  Why are you wanting the user to select a different master page?  Can you achieve what you want by having them select a different page layout as suggested by DJ Monzyk?


    If I am not writing code, then you will probably find me on my tractor!
  • Thursday, September 15, 2011 9:51 PM
     
     
    Thanks Randy.  Your suggestion did work for me.
    Harish Vajja