SharePoint Publishing: How are the components related?


I made a couple of changes to a SharePoint site earlier in the week.  While showing it to the customer it went down pretty well as they liked the layout and functionality.  After a little more than a week, the customer was ready to show it to some of her colleagues, but when testing it with their user profiles, the page was just blank.

What could have gone wrong?

I immediately assumed that the page I edited had not been published, but upon investigation found that it was.

//Scratches head//

Then it hit me, I had been modifying the page layouts.  I then went into the Master Page and Page Layouts gallery (_catalogs/masterpage/Forms/AllItems.aspx) and as I thought, the page layouts were in a pending state.  They had obviously been changed and published, but not approved, therefore the regular viewers were seeing an older major version of the page layout.

I spoke of a number of components in the scenario above, let me explain how they all relate to one another:

Pages

A page is created in a pages library and will inherit the master page of the current site.  The page will also take on the layout of the available page layouts.  The administrator decides what page layouts are made available per site in the Page Layouts and Site Templates page (_Layouts/AreaTemplateSettings.aspx).  The page is where you are able to add content, web parts and so forth.

Page Layout

The page layout is what defines the layout of the page.  More than that, it also defines what the user may do on the page.  For example, the designer can decide whether or not to add web part zones onto the page, thus enhancing the flexibility of what the user may do with the page.  In a typical controlled public facing internet site, page layouts are used to add content (for display) as well as (for edit only).  The “for edit only” elements are effectively metadata and will enhance search, but will not be displayed to the visiting viewer.  The columns need to be added inside of a EditModePanel container.

Content Types

Content Types you say?  Content Types are super important as they define many things including what fields (columns) a.k.a metadata and content are available for a particular page layout.  For example, if you have a NewsArticle page layout, you must have a content type associated to it that will allows the user to enter the article date, by line, article picture, author and so forth.  You can then decide what is displayed on the page by altering the page layout.

The following screenshot illustrates how columns are displayed in the EditModePanel container:

editing a page

The following screenshot illustrates the same page as above, but in View mode.  Notice how the viewing user cannot see the “article type” and “article date” for example.  Those are metadata fields used for aggregation and search.

viewing a page

Master Page

The master page is used to create a uniform look and feel across a site or sub site.  The master page contains the various controls that help build out the page, for example, the ribbon, search, quick launch, global navigation and so forth.  You may move these items around with CSS (styling the DIVS) to customize the layout of the master page.

All styles that are to be used in the site, should be referenced in the master page, so the pages (made up of page layouts) can utilise them.

The items discussed above are by no means a comprehensive review of SharePoint’s publishing framework, however it will give you a solid overview of the components you will be using on a day to day basis.

How to: Embed Managed Metadata into Page Layout


I got the fright of my life when added a managed metadata column onto my page layout.  At first I ignored the error thinking that perhaps SharePoint Designer was playing games.  I saved and published the layout only to find an even scarier error message hit me smack in the grill:

‘CustomTag_0:TaxonomyFieldControl’

This, incidentally was part of the exact same error I received in SharePoint Designer.  I’ll start trusting it a bit more in the near future.  Smile

After a bit of research, I found that the control was complaining as a result of a missing reference in the page layout itself.

To resolve simply add the following lines of code at the top of your .ASPX Page Layout:

<%@ Register Tagprefix="Taxonomy" Namespace="Microsoft.SharePoint.Taxonomy" Assembly="Microsoft.SharePoint.Taxonomy, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>

There is very little online about this, so a big thanks to Dave from Ironworks for his post.

SharePoint 2010: Cannot find link to Master Page / Page Layouts?


This may be trivial to some people, but I just wanted to post this quickly as I’m sure many people starting out with the SharePoint branding will need to know this.

Where can you set the master page / page layouts if you create a Team Site / non publishing site collection?  Well, Microsoft obviously knew that people would want to use the publishing features with the non publishing enabled site collections, so this is an example of where the feature framework really works well.  To resolve the “problem” simply complete the following steps:

- Navigate to the landing page of your newly created site collection

- Click on “Site Actions”

- Click on “Site Collection Features”

- Enable “SharePoint Server Publishing Infrastructure”

Site Collection Feature

Enable on site collection level

 - Click on “Site Actions”

- Click on “Manage site features”

- Enable “SharePoint Server Publishing”

Site Feature

Enable on a site level

Once this has been completed, you can again access the master pages and page layouts via site settings as you would normally do for  a publishing portal.