Upload
grayguitar
View
2.220
Download
1
Tags:
Embed Size (px)
DESCRIPTION
This session will demonstrate the approach used for the Extension Disaster Education Network’s (EDEN) public internet site’s custom branding in Sharepoint 2007. This session will walk through generating a custom solution package containing features that can be deployed to any farm running WSS 3.0 or MOSS 2007. This automated branding approach relies on custom master pages, page layouts, and CSS for customizing the look and feel without customizing any of the out of the box files.
Citation preview
NetC 2010
SharePoint 2007 Site Branding An Automated Approach
May 26, 2010
NetC 2010
Who Am I?
Summer PrisockExtension Disaster Education Network (EDEN)
WebmasterLocated at the LSU AgCenter in Baton Rouge, LAAbout 2 ½ years experience working with
SharePoint 2007
@grayguitar on Twitter [email protected]
May 26, 2010
NetC 2010
Quick EDEN Overview
EDEN’s MissionThe mission of the Extension Disaster
Education Network (EDEN) is to share education resources to reduce the impact of natural and man-made disasters.
Institutional Members from all 50 states & 3 territories1862 & 1890 Land Grants, Sea Grants, & NIFAOver 200 delegates from these institutions
For more info visit: www.EDEN.lsu.edu
May 26, 2010
NetC 2010
Agenda
Brief SharePoint Branding Overview Master Page Breakdown Delegate Controls Helpful Tools in Branding The Automated Solution Explained Gotcha’s Demo Q & A’s
May 26, 2010
NetC 2010
Brief SharePoint Branding Overview
May 26, 2010
NetC 2010
Not Customized/Customized Not Customized (formerly “ghosted”)
Lives on the file server not the content databaseUnedited files shipped with SharePointCustom files created via features
Customized (formerly “unghosted”)Lives in the content databaseRequires a request to the file system and the
databaseAnything edited or created in SharePoint designerCan be harder to managePossible post-service pack upgrade problems
May 26, 2010
NetC 2010
SharePoint Themes
More focused on changing colors and images, not on reorganization.
Stored on Web Server Editing a theme requires:
Making changes & copying to web serverReapplying the theme to each site that usesControlling themes available requires editing
OOTB file spsthemes.xml on the web server
May 26, 2010
NetC 2010
Master Page Breakdown
May 26, 2010
NetC 2010
Master Pages Swapping out Master Page for site pages
relatively easy~masterurl\default.master
○ Applied to standard default.aspx page template used in Team Site & Blank site
○ Also used in form pages such as Allitems.aspx and NewItem.aspx
~masterurl\custom.master○ Used in publishing sites○ Includes all content pages within page libraries of MOSS
publishing site○ Content pages designed to use a dynamic token for the
MasterPageFile attribute
May 26, 2010
NetC 2010
Master Pages No obvious way to swap out application.master,
simple.master, dialog.master, pickerdialog.master Runs out of the LAYOUTS directory Can be addressed by implementing a custom HTTP Module For a great list of which pages use each of these master
pages see: http://blogs.msdn.com/bgeoffro/archive/2007/11/12/branding-a-moss-corporate-intranet-portal-part-1a-high-level-overview-terminology-and-approach.aspx
There are a set of content placeholders that must be in your master page in order for SharePoint to run properly Better to start with one of the base master pages to ensure
you are including the requirements.May 26, 2010
NetC 2010
Master PagesBase Publishing Master Page before
Base Publishing Master Page after
May 26, 2010
NetC 2010
Delegate Controls
May 26, 2010
NetC 2010
What is a DelegateControl? A DelegateControl is a ASP.NET control
in SharePoint that acts as a placeholder for content or other controls.Basically just ContentPlaceholders with a
SharePoint feature deployment method that can allow for activating content on a page.
A lot of SharePoint’s default functionality uses them, ie: ○ Search○ Global Links
May 26, 2010
NetC 2010
Example #1
CustomDelegate Control
May 26, 2010
NetC 2010
Example #2
Custom Delegate Control
AdditionalPageHead DelegateControl
May 26, 2010
NetC 2010
Figure 1: Feature.xml
Figure 2: elements.xml
EDENInternetBrandingHazardsHeader Feature
May 26, 2010
NetC 2010
Figure 3: Solution excerpt in Visual Studio
May 26, 2010
NetC 2010
Helpful Tools in Branding
May 26, 2010
NetC 2010
The Tools SharePoint Designer 2007
Real time view of your master page’s look Firefox’s Firebug add-on
Visualize the renderingInspect elements to see which style is being read
Heather Solomon’s blogStripped down master pagesCSS reference sheet
Andrew Connel’s SharePoint Project UtilityQuick automated folder creationQuick ddf and manifest creation (somewhat automated)
May 26, 2010
NetC 2010
The Automated Solution Explained
May 26, 2010
NetC 2010
Solution Derived From
Automated SharePoint Site Branding by Ted Pattison (C#)http://
msdn.microsoft.com/en-us/magazine/cc700347.aspx
A stripped down version of my adaption of this solution (VB) will be posted to the LSU AgCenter’s National MOSS Collaboration Wiki this weekhttp://intranet.lsuagcenter.net/sites/team/mo
sswiki/National%20MOSS%20Repository/ May 26, 2010
NetC 2010
Intro to Automated Solution Three different primary features
Central Feature: EDENInternetBranding○ Scope to a WSS or MOSS site collection & forces
the entire solution to apply the branding.2nd Feature:
EDENInternetBrandingWebApplication○ Scoped to web app level, configured via a feature
receiver class & updates the web.config3rd Feature:
EDENInternetBrandingChildSiteInitializer○ Scope to site level, copies top level site branding
properties into the current child site.
May 26, 2010
NetC 2010
Intro to Automated Solution Several features for different delegate
controlsScoped to site level, specifies what delegate
control(s) to display within the specific site Utility Class: BrandManager
Contains all the code to apply and remove various branding elements
EDENInterntBrandingHTTPModuleChecks for enable and then swaps out
application.master and simple.master
May 26, 2010
NetC 2010
EDENInternetBranding Feature
Contains your master page template Page Layouts (optional)
May 26, 2010
NetC 2010
Elements manifest file elements.xmlContains provision logic to create an instance of this Master
Page template & of you custom page layouts if you choose to include them
Provisions a custom action in site settings that links to your custom Branding Manager
May 26, 2010
NetC 2010
FeatureReceiverSiteCollection classContains event handlers that uses the
BrandManager class to apply or remove all the various branding elements
May 26, 2010
NetC 2010
Contains methods to ensure web application-level feature has been activated or deactivated so that the HttpModule is properly registered or not registered with ASP.NET
May 26, 2010
NetC 2010
Utility Class: BrandManager Synchronizes:
pages to link to EDENInternetBranding.masterpages to use an alternate CSS filepages to use a custom graphic for the site logo
Adds support to swap out the Master Page for application pages
May 26, 2010
NetC 2010
Contains several static properties that parse together URLs pointing to various resources.
May 26, 2010
NetC 2010
Contains several methods which go through every site in the current site collection and updates each site’s corresponding property.
May 26, 2010
NetC 2010
Contains methods that create a custom property on the top level site to indicate if swapping out the Master Page should be enabled or not
May 26, 2010
NetC 2010
Custom HTTP Module: EDENBrandingHttpModule.vb
Registers an event handler for one of the events in the ASP.NET page life cycle named PreInit
May 26, 2010
NetC 2010May 26, 2010
NetC 2010
EDENInternetBrandingWebApplication Feature
Scoped at the web application level Using a feature receiver, it updates the web.config
to add the HttpModule entry in each web application
May 26, 2010
NetC 2010
Function that creates the HttpModule entry
FeatureReceiverWebApplication class
Event handlers that add or remove the required HttpModule entry to the web.config
May 26, 2010
NetC 2010
EDENInternetBrandingChildSiteInitializer Feature
FeatureReceiverChildSite classContains event handler that copies the top
level site’s branding properties into the current child site.
May 26, 2010
NetC 2010
Feature stapling is used to get EDENInternetBrandingChildSiteInitializer to activate automaticallyStapled to the main EDENInterntBranding feature
via FeatureSiteTemplateAssociation element
Figure 1:EDENInternetBrandingFeature.xml excerpt
Figure 2:EDENInternet Brandingstapling.xml excerpt
May 26, 2010
NetC 2010
BrandManagement Class Pulls it all together when the user specifies what
elements to use on this newly deployed page under site settings
May 26, 2010
NetC 2010
“Gotcha’s”
May 26, 2010
NetC 2010
Unknown Error
Friendly Errors – turn them off; they’re not friendly (when debugging)1. Open web.config for site
2. Change CallStack status to “true”○ <SafeMode MaxControls="200"
CallStack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">
3. Chance CustomErrors to “off”○ <customErrors mode="Off" />
May 26, 2010
NetC 2010
Demo
May 26, 2010
NetC 2010
Questions
May 26, 2010