Monday, May 16, 2011

Custom site templates issues in 2010 after migration

1. Install and configure SharePoint 2010 per the instructions at http://technet.microsoft.com/en-us/library/cc262243.aspx.
2. Create a web application per the instructions at http://technet.microsoft.com/en-us/library/cc288705.aspx. Enter the following. Default for all others is fine.
a. Name: SharePoint
b. Port: 80
c. Host Header: Leave this blank.
3. Create a site collection per the instructions at http://technet.microsoft.com/en-us/library/cc263165.aspx. Use the following settings:
a. Title: Test Publishing Site
b. Web Site Address: http:///
c. Template: Publishing
4. Upload the logo and .css to the Style Library of the site.
a. Site Actions > View all site content > click the Style Library.
b. Upload a .CSS style sheet.
d. Return to the Style Library and click the Images folder.
e. Upload a .JPG to the images folder.
5. Link a custom Style Sheet to the Publishing site, then change to the v4 master.
- In the Alternate CSS URL section, click to 'Specify a CSS file to be used by this publishing sites and all sites that inherit from it'.
- Browse to the .CSS in the Style Library.
- Now toggle the masterpage to V4 masterpage in both Site Master Page and System Master Page.
- Click OK.
6. Create a new site under the publishing root site using a Team Site template.
7. Return to the root Publishing site. In Site Settings, click Master page.
- Select the check-box stating 'Reset all subsites to inherit this alternate CSS URL'
Then click OK.
8. Set the Site Logo on the Team Site
-Site Actions > Site Settings > Click Title, description, and icon.
- In the 'Logo URL and Description' give the full URL to the logo's .jpg file. Click to test using 'Click here to test'. Click OK.
9. Save the Team Site as a template
Click Site Actions > Site Settings > Save site as template. Save this site as a template; this will place that template in the solution gallery
(http:///_catalogs/solutions/forms/allitems.aspx).
10. Create a new site using the .wsp 'Template'
- This is done through Site Actions > View All Site Content > Create. Select your template by name in the Silverlight Create dialog > Name and
create the site.
11. Once this new site is created, try to go to Site Settings here.
Also notice that the site logo is not set.

Actual Results:
The Site Logo is missing and Site Settings is not accessible

Error Message in Browser Unexpected Error

ULS
System.Web.HttpException: Error executing child request for /Style Library/XSL Style Sheets/ModotCustomStyles.css.
at System.Web.HttpServerUtility.ExecuteInternal(IHttpHandler handler, TextWriter writer, Boolean preserveForm, Boolean setPreviousPage, VirtualPath path, VirtualPath filePath, String physPath, Exception error, String queryStringOverride)
at System.Web.HttpServerUtility.Execute(String path, TextWriter writer, Boolean preserveForm)
at ASP._controltemplates_topnavbar_ascx.__Render__control1(HtmlTextWriter __w, Control parameterContainer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output)
at System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.RenderChildren(HtmlTextWriter writer)
at System.Web.UI.Page.Render(HtmlTextWriter writer)
at Microsoft.SharePoint.WebControls.UnsecuredLayoutsPageBase.Render(HtmlTextWriter writer)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

The workaround for this, if you're having this issue is to run the following PowerShell or object model code to make that property empty:

$web = Get-SPWeb http://
$web.AlternateHeader
<< will show the url of the AlternativeCSS >>
$web.AlternateHeader = ""
$web.Update()

This would have to be integrated into your wsp creation code. It would need to set the property to an empty string after the process of creating the wsp has finished. I'm not familiar with that API but this is what you do to fix this issue up post site creation so the key would be to see if you can modify the wsp in your code to avoid this altogether.

1 comment:

sbobet said...

publishing sites and all sites that inhsbo
sbo
erit