AvailablePageLayouts property value has to be one a single line

Today, I was deploying a custom web template in SharePoint 2010 in which I had specified that only 9 custom page layouts were allowed. I did this by adding a property to the Publishing feature (id 22A9EF51-737B-4ff2-9346-694633FE4416) in my custom onet.xml file called AvailablePageLayouts where you specify the location and the name of the allowed page layouts.
The format of the string with the list of layouts you specify as the value for that property has to be specific:

  • the location of the page layout has to be a relative URL
  • they have to separated by a colon (:)

After I deployed the feature I created a new site from my custom template and all of a sudden I got an error:

All Page layout urls inside the string have to be server relative

The error message furthermore mentioned more information on which page layouts were affected.

When I looked at the list of page layouts I added to this property, they all had relative urls.
Since the 1st layout was not mentioned in the error, something started to go wrong with the second one. I placed each page layout on a new line because that was so much easier than a single line and this was the problem. So, I put everything on a single line and for sure… this solved the error. My site was created successfully and only the 9 specified page layouts were available.

Update (4/12/2011): Someone commented on this post that you can actually split the page layouts over multiple lines for readability. You just need to start each new line with the colon. And he’s right. The next does work:


2 thoughts on “AvailablePageLayouts property value has to be one a single line

  • Sunday, 4 December, 2011 at 12:42

    Thanks for the comments Joey. You’re absolutely right. I’ve updated the post with your remarks.

  • Tuesday, 29 November, 2011 at 21:53

    Great post!
    Actually you can list the page layouts on new lines (for readability) by listing the colon (:) first:


Comments are closed.