Sharepoint 2010 One site but need unique master page for page layouts for publishing pages


 I have a SharePoint 2010 site on a win 2008 server that will used by staff to  manage an  intranet and serve public pages.  I want to create a separate master page(s) for my public web pages.  I want to leave the  current intranet master page the way it is.   I can create a master page for my public site.  But how do I make one page layout reference the intranet master page and a different layout reference my public master page?

The goal is to have staff create pages for the intranet and the public web by creating a page, then using page layouts, but I  need to create layouts for each master page.

Who is Participating?
Ted BouskillConnect With a Mentor Senior Software DeveloperCommented:
OK, first off, let's make sure we are speaking the same language in SharePoint.  There are three primary logic entities in SharePoint.  A web application, a site collection and a site.  A web application requires a default site collection at the root of the web application with more site collections as an option.  A site collection can have additional nested sites.

Here are two examples of web applications

Here is some examples of additional site collections on a web application

There is also host header site collections but I'll avoid discussing that here.

Adding sites is listed here:

The overhead of sub-sites isn't an issue and should be considered as a valid way to organize your sites.

What is MOST important is that permissions are applied based on those entities.  So if you want to precisely control access using web applications, site collections and sites is VERY important because for example mixing anonymous and authenticated access won't work because a browser will automatically use the least resistant method to authenticate which is anonymous.

So on many intranet sites I do the following: (Entire company) (Site collection only accessible by the accounting team and the executives)

SharePoint automatically changes it's pay features and layout based on your membership role.  Visitor, Contributor, Designer or even Owner.

Rather than over-thinking the issues in my opinion you seem to be making assumptions and adding unnecessary restrictions and not using SharePoints strengths.

If anonymous users are members of the 'Visitors' group then they have read-only access to pages.  Then if your users are members of 'Contributors, Designers or Owners' then they will be able to administer the pages automatically using built-in SharePoint functionality.

There are some good articles online on how to change the master pages so for example, the ribbon bar and other page elements are hidden for people that are anonymous users or who have Visitor access.

The problem you are trying to solve is actually already solved in SharePoint out of the box.
Ted BouskillSenior Software DeveloperCommented:
Why can't you run two separate sites? (even a sub-site for staff)

You can use audiences to change the view of a page based on membership in the audience.
EpistrophyAuthor Commented:
I can’t have separate sites or a subiste.  

Perhaps I over thinking this.

This is a simple site.  Consider it like doing a site for small not for profit.  I just want have my public pages and a place to administer those pages.   If I brand the master page I assume that will put that branding on all my pages.  I only want that on my public pages.    I want the public to see a home page and the staff who are going to maintain the site to see a home page for them to administer the site.  But I don't need my public facing branding on any non-public facing pages.

Are you saying I should use the same home page and with audiences have a public view and an admin view?
The template default page seems to be  I image that is the page I need to make my public facing page. Which means I will customize a combination of the master page, page layout and page itself?

Or to put it another way, what is my landing page for the public?  What is the landing page for my staff when they log in?

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

EpistrophyAuthor Commented:
Thanks for the quick response . I only have access to the site. Not the web application or site collection. (I agree that a subsite would be the best way to go but I don't have the option in my case. ) So I am restricted to making that site be the public web and the admin pages.

I will let SharePoint  manage what the user sees on the page based on their groups ( I am familiar with groups from WSS3.0 but new to 2010 and audiences.)   I understand that part.
So I assume I should just go ahead and brand the site for my public web and all users will see that branding  public and internal.     I still have my original question.  How can I make my non-public pages see a different master page?   In my case my public web has a giant header that will just waste a ton of space on non public admin pages.  

Can I use page layouts and  create page layouts just for public WebPages that use one master page and another set of page layouts for my non public pages?

Or to ask it another way.  What if I was creating if I had one public website with two very distinct page types?  For example, if I was creating a site for an Auto dealership I might have  a very distinct page design for the sales department and a complete different design for the service department.  

Would I create two master pages? Or two Unique Page Layouts?    Can I reference a different master page in page layout  or  are you restricted to the default master? How do you manage two types of branding in one site in 2010 SharePoint.

My background is using Sharepoint as on object in  ASP non sharepoint  webs. This is the first time since sharepoint 2.0 I have to make a public facing sharepoint site and I am new to 2010.
Thank you for your responses.
Ted BouskillSenior Software DeveloperCommented:
Hmm, I don't think my comments are clear.  If you can edit the master pages you can add sub-sites.

There will only be one default landing page.  You cannot set two master pages for that page.  So you do not need two master pages.

If you have experience working with ASP.NET outside of SharePoint it seems to be a hinderance for you at this point because you keep trying to solve problems the ASP.NET way.  SharePoint is built on top of ASP.NET but it is highly customized and specialized.  As I've said, SharePoint has already solved your problem out of the box based on user membership.

Simply define your single master page to display the content based on the user's permissions and/or audience.  However, if you don't have Site Collection administration privileges then I doubt you can edit audiences. So you will have to edit your master page based on using security trimmed controls.

I think you need to spend some time learning SharePoint 2010 because based on your questions it seems like you are missing an understanding of key built-in features.

WSS 2.0 is as different as SharePoint 2010 as Windows 3.1 and Windows 7.
EpistrophyAuthor Commented:
You are clear in your comments – perhaps I am not clear in what I am asking.   I know I have the ability to create subsites.   It is not in my business requirements to build subsites in this case.   I recognize I have to spend time learning 2010. This is part of that process.

Based on your answers can I draw these conclusions about SP 2010?  
1) In a site there can only be one master page.  

2) When an authenticated user creates a new page by clicking Site Settings/ New Page/  and gets to the Page Ribbon and clicks Page Layout the user will see groups of page layouts. Each of those layouts  is based on the identical default master page.

3) I can’t create a new Group of Page layouts or a single page layout based on a different master page from the site default master page.

How would you handle  my example of the car dealership?  In that case the user class is the same – all public visitors to the web site.    My public facing Sales Department Page requires completely different branding  and layout from my Service department page.

I know it is possible in 2010 to create a stand alone page and reference a different  master page and put that page on the website. I have done that.   But I want to stay in the 2010 publishing model and have the authenticated user be able to create pages in the standard way by selecting the page layout and all the follow on advantages of using SharePoint 2010.

I want my authenticated user to be able to create a page for the sales department and for the service department.    Is the only way to handle that to make each department their own subiste so they each have their own master page?    
Ted BouskillSenior Software DeveloperCommented:
1) No.  Each page can only have one master page and there is a default for all pages on the site (and sub-sites)

2) Not necessarily.  It depends on the site template.

3) That isn't true.  You can add new page layouts that work with any master page and even by default all the site templates have multiple master pages.

Unless you want to reinvent the wheel subsites were specifically made to solve meet your requirements.   The Sales section should be a subsite with it's own settings.  The Service department should be it's own subsite (or possibly site collection if it's going to be large)

Sites in SharePoint are specifically designed to allow them to have their own theme, look and feel et cetera.

In fact, based on the requirements you should be using Site collections for the Sales and Service department in your example.  The reason being is that SharePoint features (a core component) is controlled at the site collection level.

So, if you used managed paths to create the site collections the layout would be:

Then you could force users in the Service site collection to only use Service page templates.  It would be impossible to use a Sales page template in the ServiceSiteCollection.  In the SalesSiteCollection you could do the same thing.

Even controlling the types of sub-sites, lists et cetera has to be done at the Site Collection level.
EpistrophyAuthor Commented:
OK  your answer here is what I am after.  And brings me back to my original question.
“3) That isn't true.  You can add new page layouts that work with any master page and even by default all the site templates have multiple master pages.”

What code do I put in the page layout to reference another master page? There is no reference to a master page in, for example,  welcomesplash.aspx.  When I try to add a master page reference I don’t see the change reflected in my design and the page will error on render.  

Here is top two lines from welcomesplash.aspx.

<%@ Page language="C#"   Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" meta:webpartpageexpansion="full" %>
<%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

Open in new window

EpistrophyAuthor Commented:

 Why don't we agree to delete this question. I don't think it is going to be much use to anyone.

I appreciate your time.
Ted BouskillSenior Software DeveloperCommented:
Well I've actually given you everything you need if you are willing to use SharePoint as it was designed.  Master pages and layouts are applied based on features defined in the site templates.  It's more complex than using master pages in typical ASP.NET programming.  If you were willing to use subsites and site collections it would meet your needs.

I cannot believe that your client would reject subsites or site collections if they meet the functional business requirements.
EpistrophyAuthor Commented:
This is not about sharepoint site planning/desin.

I simply want to know how to associate a page layout with a 2nd master page.

I am not interested in other solutions.

If it can't be done or you can't tell how to do it - let's call it a day.
Ted BouskillSenior Software DeveloperCommented:
Site planning design in SharePoint is directly related to how the features and core functionality were designed to be used.  The correct solution is to use the features as they were designed to solve your problem.  That is why Microsoft tied features and UI layout to site templates.

Page layouts are tied to a specific master page per site template.  So, the solution to your problem is use sub-sites and/or site collections.  It can be done if you use SharePoint as it was designed.
EpistrophyAuthor Commented:
Then  the answer to my original question....

"But how do I make one page layout reference the intranet master page and a different layout reference my public master page?"

... can't be done
EpistrophyAuthor Commented:
Let's try to close this off.

OK Inlight of our discussion, what is the best practice for handling the palce holder navigation barwhen creating a public facing web site?  If the public users and staff user both see /page/deafult.aspx upon coming to the site then how  do you hide it from the public but keep it available to authenticated users?  

If you are custonizing a master page sometimes it will interfere with the public layout?  Where do you put that navigation bar?

EpistrophyAuthor Commented:
Maybe this is a better way to wrap this up. I am trying to get a handle on with a public facing publishing template.  

I need branded public facing pages.
I want  the staff to have a landing page with the quick launch and the Ribbon.  

What are the best practices for accomplsing that without a subsite.

thanks for your time.

Ted BouskillConnect With a Mentor Senior Software DeveloperCommented:
Well as I said in an earlier comment you need to modify the site master page to use security trimmed controls based on the role of the user.  Here is some links.

If you search for more you can other variations.  Generally they add a login button so that staff can sign in.  The staff cannot sign in automatically on an anonymous site because the browser will sign in anonymously automatically if it can.
EpistrophyAuthor Commented:
This thread did not asnwer my basic question. How can I have a page layout reference a different master page.   The answers I got where links to sites and comments about using subsites instead to accomplish my goal.
Ted BouskillSenior Software DeveloperCommented:
No worries, from now there will be other experts helping you.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.