Pages

5/23/2010

SharePoint: Customizing the Basic Page

This article is for SharePoint 2007

 

I have yet to find anyone who really likes the Basic Page.  This is the page you get from “Site Actions, Create, Basic Page”. This page is easy to use, is stored in a library (and can support check in/out, content approval and versioning) and ugly.

This is how it looks when your first edit it:

image

The areas in red are the most often I asked about.

 

Tips in this article:

  • Hide the site description
  • Hide the blue bar
  • Selectively hide things
  • Add Quick Launch to the Basic Page

All of the following requires the use of SharePoint Designer, therefore Owner or Designer rights to the site or the library. If you really mess up… remember you can click on the file name in SharePoint Designer and select “Reset to Site Definition”.

 

Getting rid of the Site Description

The first thing you may want to get rid of is the oddly placed Site Description.

Before:

        image

You could just go to Site Actions, Site Settings, Title Description and Icon and remove it there, but that removes it from all pages, AND from search indexing.

  • Open the page in SharePoint Designer
  • Find the “PlaceHolderPageDescription” placeholder
  • Either delete the entire placeholder or delete the SharePoint:ProjectProperty control inside of the placeholder
<asp:Content ContentPlaceHolderId="PlaceHolderPageDescription" runat="server">    <SharePoint:ProjectProperty Property="Description" runat="server"/></asp:Content>
After:
        image
 

Getting rid of the “big blue bar”

Method #1:

Hide the blue area, but keep the crumb trail.

  • Find the following area
    <style>
    Div.ms-titleareaframe {
        height: 100%;
    }
    .ms-pagetitleareaframe table {
        background: none;
    }
    </style>
  • And change it to:
    <style>
    Div.ms-titleareaframe {
        height: 100%;
    }
    .ms-pagetitleareaframe table {
        background: none;
        height:25px;
    }
    #onetidPageTitle
    {
        display:none
    }    
    </style>

 

Result:

        image

And add the change to get rid of the site description and you get:

        image

 

But the edit link is now gone… how do you edit it?

To edit just add
    “?PageView=Shared&ContentEditorPopUp=True”
to the end of the URL.

I.e.: http://yourserver/sites/yoursite/Shared%20Documents/Sample%20Basic%20Page.aspx?PageView=Shared&ContentEditorPopUp=True

 

If you want to only make the changes above for selected users then replace the style block above with the following.  See “Method 3” below for some more info on the SPSecurityTrimmedControl.

    <style>
    Div.ms-titleareaframe {
        height: 100%;
    }
    .ms-pagetitleareaframe table {
        background: none;
        height:25px;
    }
    #onetidPageTitle
    {
        display:none
    }    
    </style>

    <Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ManageWeb">
    <style>
    .ms-pagetitleareaframe table {
        height:53px;
    }
    #onetidPageTitle
    {
        display:inline
    }    
    </style>
    </SharePoint:SPSecurityTrimmedControl>

 

Method #2:

Hide the blue bar AND the crumb trail:

  • Open the page in SharePoint Designer
  • Find the “PlaceHolderAdditionalPageHead” placeholder
  • Add “display:none” to the “.ms-pagetitleareaframe” section  (see line 17 below)
   1:  <asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
   2:      <META Name="GENERATOR" Content="Microsoft SharePoint">
   3:      <META Name="ProgId" Content="SharePoint.WebPartPage.Document">
   4:      <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
   5:      <META Name="CollaborationServer" Content="SharePoint Team Web Site">
   6:      <script>
   7:      var navBarHelpOverrideKey = "wssmain";
   8:      </script>
   9:      <SharePoint:RssLink runat="server"/>
  10:      <SharePoint:ScriptLink language="javascript" name="bpstd.js" runat="server"/>
  11:      <style>
  12:      Div.ms-titleareaframe {
  13:          height: 100%;
  14:      }
  15:      .ms-pagetitleareaframe table {
  16:          background: none;
  17:          display:none;
  18:      }
  19:      </style>
  20:  </asp:Content>

 

After:

        image

Looks good, but we lost the crumb trail and… how do you edit it?

To edit just add
    “?PageView=Shared&ContentEditorPopUp=True”
to the end of the URL.

I.e.: http://yourserver/sites/yoursite/Shared%20Documents/Sample%20Basic%20Page.aspx?PageView=Shared&ContentEditorPopUp=True

 

Method #3

Hide the blue bar and the crumb trail from “some” users, based on user permissions.

  • Make the change as above to hide the blue bar (line 17)
  • Add a SPSecurityTrimmedControl to use a custom CSS for selected users (by permission) (lines 21-27)
  • Set “PermissionsString="ManageWeb"” to one of the SharePoint 32 permissions (see the comments at the end of the page here)
   1:  <asp:Content ContentPlaceHolderId="PlaceHolderAdditionalPageHead" runat="server">
   2:      <META Name="GENERATOR" Content="Microsoft SharePoint">
   3:      <META Name="ProgId" Content="SharePoint.WebPartPage.Document">
   4:      <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
   5:      <META Name="CollaborationServer" Content="SharePoint Team Web Site">
   6:      <script>
   7:      var navBarHelpOverrideKey = "wssmain";
   8:      </script>
   9:      <SharePoint:RssLink runat="server"/>
  10:      <SharePoint:ScriptLink language="javascript" name="bpstd.js" runat="server"/>
  11:      <style>
  12:      Div.ms-titleareaframe {
  13:          height: 100%;
  14:      }
  15:      .ms-pagetitleareaframe table {
  16:          background: none;
  17:          display:none;
  18:      }
  19:      </style>
  20:      
  21:      <Sharepoint:SPSecurityTrimmedControl runat="server" PermissionsString="ManageWeb">
  22:      <style>
  23:      .ms-pagetitleareaframe table {
  24:      display:inline;
  25:      }
  26:      </style>
  27:      </SharePoint:SPSecurityTrimmedControl>
  28:   
  29:  </asp:Content>

This first example below is displayed for users without “ManageWeb” (site owner) rights. The second example is for those with “ManageWeb”.

       image   
       image  

 

Bonus!  Add Quick Launch!

The basic page does not include Quick Launch, sometimes that is desired, but removing it does break basic site navigation.

  • Using SharePoint Designer find and delete the following two lines:
<asp:Content ContentPlaceHolderId="PlaceHolderLeftNavBar" runat="server"></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderNavSpacer" runat="server"></asp:Content

 

.

No comments:

Post a Comment

Note to spammers...
Spammers, don't waste your time... all posts are moderated. If your comment includes unrelated links, is advertising, or just pure spam, it will never be seen.