<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:series="http://unfoldingneurons.com/"
	>

<channel>
	<title>SharePoint Magazine &#187; Customization</title>
	<atom:link href="http://sharepointmagazine.net/tag/customization/feed" rel="self" type="application/rss+xml" />
	<link>http://sharepointmagazine.net</link>
	<description>SharePoint Magazine is an online Magazine dedicated to the world of SharePoint</description>
	<lastBuildDate>Mon, 05 Jul 2010 09:14:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Everything You Need to Know about BDC: Part 8 of 8</title>
		<link>http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-8-of-8</link>
		<comments>http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-8-of-8#comments</comments>
		<pubDate>Mon, 08 Feb 2010 10:53:04 +0000</pubDate>
		<dc:creator>Wen He</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Customisation]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[BDC]]></category>
		<category><![CDATA[BI]]></category>
		<category><![CDATA[Business Data Catalog]]></category>
		<category><![CDATA[Business Intelligence]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[Dashboards]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[platform]]></category>
		<category><![CDATA[reporting]]></category>
		<category><![CDATA[search]]></category>

		<guid isPermaLink="false">http://sharepointmagazine.net/?p=3838</guid>
		<description><![CDATA[An action is simply an operation upon a selected item. The operation can retrieve information about the selected item, or it can launch a program or Web page with the selected item as a parameter.]]></description>
			<content:encoded><![CDATA[<p>Welcome back to Part 8 of our 8-part series on the Business Data Catalog (BDC). From the previous 7 installments, we have covered everything about BDC, from BDC architecture, ADF, BDC Web parts, BDC search and profile, to the BDC object model in details.  We also touched the surface of BDC actions in <a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-4-of-8">Part 4</a> and <a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-5-of-8">Part 5</a>. As promised, we’ll dedicate this final article to actions. We’ll explain what the BDC actions are and what they can do for you.  We’ll then walk you through how to create custom actions and how to perform these actions by using custom Web parts and InfoPath forms. As you will soon learn, this is another power capability of BDC because it extends the ability to link content to Web sites.  This allows you to quickly create mashups that are item-specific so that you can take actions in context, such as write back to your LOB systems.</p>
<p>For your reference, these are our previous seven articles:</p>
<ol>
<li><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-1-of-8">Part 1</a>, BDC Purpose and technical architecture</li>
<li><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-2-of-8">Part 2</a>, Application Definition File (ADF) and its Development</li>
<li><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-3-of-8">Part 3</a>, Developing an ADF to Connect to Web Services</li>
<li><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-4-of-8">Part 4</a>, Consuming Business Data through Web Parts and SharePoint Lists</li>
<li><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-5-of-8">Part 5</a>, Implementing Enterprise Search with Business Data</li>
<li><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-6-of-8">Part 6</a>, Integrating User Profiles with Business Data</li>
<li><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-7-of-8">Part 7</a>, Working with the BDC Object Model</li>
</ol>
<p>With that, let’s dive into BDC actions and start by asking what is an action.</p>
<h3>What is an action?</h3>
<p>An action is simply an operation upon a selected item. The operation can retrieve information about the selected item, or it can launch a program or Web page with the selected item as a parameter. The operation is a predefined URL link in each BDC item that enables you to act on the item, such as editing, or mapping it using Live Search as we demonstrated in Part 4.<br />
An action is composed of a URL target where the action is to occur, and the matching parameters in the URL QueryString format. When we associate an action with an entity, we can pass parameters to that action based on the contents of one or more fields. For example, in the Live Search example in Part 4, we associate the Live Search page’s URL with a customer and provide the customer’s address to parameterize the search.</p>
<p>From the above, major characteristics of actions are as follows:</p>
<ol>
<li>URL-based, parameter-driven</li>
<li>Actions on any entity and appear everywhere an entity goes</li>
<li>User can take action in ECB menu</li>
<li>Custom actions means custom code</li>
</ol>
<p>A perfect example of action is the default View Profile action, as shown in <strong>Figure 1</strong>.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb.png" border="0" alt="image" width="644" height="331" /></a><br />
Figure 1  View Profile action in a Business Data Actions Web Part</p>
<p>Through a View Profile action we can navigate to the profile page of an entity. Clicking the View Profile action in a Business Data Actions Web Part as shown in Figure 1 above, as well as in a Business Data column, or in a Business Data List Web Part, lets us view the details of an item on that item&#8217;s profile page. <strong>Figure 2</strong> shows that a Profile page that displays employee details.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image1.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb1.png" border="0" alt="image" width="299" height="484" /></a><br />
Figure 2  A Profile page that displays employee details</p>
<h4>What is a Profile page?</h4>
<p>A profile page is automatically generated for each entity that has a SpecificFinder method after BDC imports an ADF file, a profile page can display all the information from a record in the BDC.  As we’ve seen in <strong>Figure 2</strong>, a profile page can display all the fields in a record for a specific employee. The default profile page contains a BDC Item Web Part for that entity.<br />
If we put the profile page in Edit mode, there are actually two Web parts: a Business Data Item Builder and a Business Data Item that connect together. The Item Builder parses the querystring (<a href="http://win7:10001/ssp/admin/Content/Employee.aspx?EmployeeID=1)">http://win7:10001/ssp/admin/Content/Employee.aspx?EmployeeID=1)</a> and passes the EmployeeID value to the Business Data Item, which then executes the SpecificFinder method and returns a record of Employee data.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image2.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb2.png" border="0" alt="image" width="543" height="484" /></a><br />
Figure 3  Profile page components</p>
<h4>Default Profile Page and default action</h4>
<p>As we have seen from above section, the default action (View Profile) along with the default Profile page is automatically created when the entity has a SpecificFinder method.  To provide an ECB menu user experience, we can also add actions in a Business Data List Web part without using the Business Data Actions Web Part.</p>
<h4>Defining an Action</h4>
<p>There are three ways to add an action: 1) defining it in the ADF, 2) adding it in the BDC admin page after the ADF has been imported into BDC, and 3) through the BDC Object Model. Here we’re focus the first two.</p>
<h5>Defining it in the ADF</h5>
<p>To define an Action for the specified BDC entity, we’ll first locate the &lt;Actions&gt; section within the &lt;Entities&gt; and &lt;Entity&gt; hierarchy.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image3.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb3.png" border="0" alt="image" width="644" height="241" /></a><br />
Figure 4  Actions is nested within the Entities/Entity in ADF</p>
<p>And insert the &lt;action&gt; portion like this one:</p>
<p>&lt;Actions&gt;<br />
&lt;Action Name=&#8221;Update Employee&#8221; Position=&#8221;1&#8243; IsOpenedInNewWindow=&#8221;false&#8221; Url=&#8221;pages/editemployee.aspx?EmployeeID={0}&#8221; ImageUrl=&#8221;"&gt;<br />
&lt;ActionParameters&gt;<br />
&lt;ActionParameter Name=&#8221;EmployeeID&#8221; Index=&#8221;0&#8243; /&gt;<br />
&lt;/ActionParameters&gt;<br />
&lt;/Action&gt;</p>
<h5>Adding an action in the BDC admin page</h5>
<p>In the SSP administration page (View Application –&gt; View Entity), the action is defined below and the URL that takes EmployeeID as a parameter: <a href="http://dpm:10001/ssp/admin/Content/Employee.aspx?EmployeeID={0}">http://dpm:10001/ssp/admin/Content/Employee.aspx?EmployeeID={0}</a></p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image4.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb4.png" border="0" alt="image" width="644" height="277" /></a><br />
Figure 5  Add an action the SSP Admin page</p>
<h4>Custom Actions</h4>
<p>We also can create custom actions for entities in BDC. Among other things, custom actions allow users to navigate to any custom page to manipulate business data.<br />
Here are some scenarios that custom actions can do:</p>
<ol>
<li>Parameterize custom search</li>
<li>Update employee in HR system</li>
<li>Customize profile page for an entity</li>
<li>Integrate BDC search into enterprise report center</li>
</ol>
<p>We’ll be creating custom actions in the last part the article.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image5.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb5.png" border="0" alt="image" width="644" height="313" /></a><br />
Figure 6 Enable View Profile action in a Business Data List Web part</p>
<p>This enables the ECB-style action, we will specify a Title property and add the following in the ADF:<br />
&lt;Entity EstimatedInstanceCount=&#8221;0&#8243; Name=&#8221;Employee&#8221;&gt;<br />
&lt;Properties&gt;<br />
&lt;Property Name=&#8221;Title&#8221; Type=&#8221;System.String&#8221;&gt;LastName&lt;/Property&gt;<br />
&lt;/Properties&gt;<br />
&lt;/Entity&gt;</p>
<p>It specifies which column in the Business Data List/Related List Web part displays the Actions menu. It also specifies the name of the TypeDescriptor that corresponds to the column you want to display as the default column in Business Data lists.</p>
<p>In the Business Data Column scenario, we can also display the action menu and link the column to the business data profile in a Business Data list.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image6.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb6.png" border="0" alt="image" width="644" height="160" /></a><br />
Figure 7  View Profile action in Business Data Column</p>
<p>This is default behavior OOB for a Business Data column.  When adding the column, just make sure the following two are checked:</p>
<ul>
<li>Display the actions menu</li>
<li>Link this column to the profile page to</li>
</ul>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image7.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb7.png" border="0" alt="image" width="644" height="410" /></a><br />
Figure 7  Enable the actions menu and profile page in Business Data list</p>
<p>These profile pages are used and being indexed by BDC Search. The following search results display the profile pages that contain the search keyword (s).  Notice in Figure 8 how a search for Great Lakes will display the profile pages for both this customer and their orders.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image8.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb8.png" border="0" alt="image" width="543" height="480" /></a><br />
Figure 8  BDC Search Results in Profile Pages</p>
<h4>Enhancing the Profile Page</h4>
<p>By default, the profile page is hosted on the Shared Services Provider site collection where the BDC administration site is located. The search result (that is, the URL) links back to the Shared Services Administration site collection address that is not scalable when you extend the Web application. In real world, we may not want to give end users access to the SSP Admin site for security reason. A better practice is to create our own profile pages and host them in any site that is not part of the SSP site collection.<br />
In this example, we’ve created a dashboard page in Report Center to replace the default Profile Page. The Report Center provides enterprise reporting capabilities that are scalable and centralized.  We can direct users to custom profile pages by updating the View Profile action.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image9.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb9.png" border="0" alt="image" width="644" height="446" /></a><br />
Figure 9  Replace the default Profile Page with Custom Report Center</p>
<p>As an alternative, we can also replace the default the URL in Action element in ADF with the path to the Profile.aspx page:</p>
<p>&lt;Actions&gt;<br />
&lt;Action Position=&#8221;1&#8243; IsOpenedInNewWindow=&#8221;false&#8221; Url=&#8221;<a href="http://reportcenter/Pages/Profile.aspx?EmployeeID={0">http://reportcenter/Pages/Profile.aspx?EmployeeID={0}&#8221;</a> ImageUrl=&#8221;/_layouts/1033/images/viewprof.gif&#8221; Name=&#8221;View Profile&#8221;&gt;<br />
&lt;ActionParameters&gt;<br />
&lt;ActionParameter Index=&#8221;0&#8243; Name=&#8221;EmployeeID&#8221; /&gt;<br />
&lt;/ActionParameters&gt;<br />
&lt;/Action&gt;<br />
&lt;/Actions&gt;</p>
<p>An action to call the Profile.aspx page for each Employee ID has been defined. This action will be the default action provides in the search result.</p>
<p>Now let’s create Profile page to display information about the Employee entity in Report Center. (The Report Center is a site that provides a central location for business-intelligence-related information.)</p>
<ol>
<li>In the <a href="http://reportcenter">http://reportcenter</a> site, create a new Blank Web Part Page called “Profile.aspx”.</li>
<li>Add the following two web parts: Query String (URL) Filter Web Part and Report Viewer Web Part.</li>
<li>Configure the Query String (URL) Filter Web Part to pickup parameter “EmployeeID” from the URL query string.</li>
<li>Configure the Report Viewer Web Part to display the employee profile report called “Employee Profile”.</li>
<li>Connect the Query String (URL) Filter Web Part parameter to the SQL Server Reporting Services Report Viewer Web Part parameter “EmployeeID”.</li>
</ol>
<blockquote><p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image10.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb10.png" border="0" alt="image" width="644" height="67" /></a><br />
Figure 10  SQL Server Reporting Services Report Viewer</p>
<p>Note: Please make sure you use this Web Part and not the OOB Report Viewer Web Part.</p></blockquote>
<p>Test that the page is picking up the URL string parameter “EmployeeID” correctly by typing the following URL: <a href="http://reportcenter/Pages/Profile.aspx?EmployeeID=108">http://reportcenter/Pages/Profile.aspx?EmployeeID=108</a></p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image11.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb11.png" border="0" alt="image" width="644" height="218" /></a><br />
Figure 11  Custom Profile Page in Report Center</p>
<h4>Creating Custom Actions</h4>
<p>Creating custom actions requires custom code. The approach we take is to treat the BDC source simply as a data reader, and to build our CRUD (create/read/update/delete) logic in custom code. The BDC object model provides the means to retrieve collections, list items and enumerators, and we can use GenericInvoker to perform CRUD, which has been extensively covered in Part 7. We get the Web Parts to display data, and then we can use custom actions to create and update records by using Web parts and InfoPath Forms.</p>
<h4>Creating Web Parts</h4>
<p>We have created and deployed two Web Parts using the Object Model as shown below, with one inserting a record and one updating an existing record. (Special thanks to Lightning Tools! I’ve used <a href="http://www.lightningtools.com/bdc-meta-man/default.aspx">BDC Meta Man</a> to help with creating the Web parts.)</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image12.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb12.png" border="0" alt="image" width="467" height="480" /></a><br />
Figure 12  The two Custom Web Parts can be used to add and update employee records</p>
<p>Add these two actions in the SSP Admin page:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image13.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb13.png" border="0" alt="image" width="644" height="166" /></a><br />
Figure 13  Adding actions in the SSP Admin page</p>
<p>Now you can access the two actions from the content menu in the Employee List:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image14.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb14.png" border="0" alt="image" width="644" height="241" /></a><br />
Figure 14  Custom Actions Add Employee and Update Employee in the context menu</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image15.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb15.png" border="0" alt="image" width="644" height="342" /></a><br />
Figure 15  Add Employee Web Part</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image16.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb16.png" border="0" alt="image" width="561" height="484" /></a><br />
Figure 16  Update Employee Web Part</p>
<h4>Creating InfoPath Form</h4>
<p>MSDN has a great article titled Using Business Data Catalog Actions to Pass Parameters to InfoPath 2007 Browser Forms that walks you through this in detail.  So I’ve created our InfoPath Form and added the action using the Form Template path:<br />
<a href="http://dpm/_layouts/FormServer.aspx?XsnLocation=http://dpm/FormServerTemplates/EmployeeUpdate.xsn&amp;DefaultItemOpen=1&amp;EmployeeID={0}&amp;FirstName={1}&amp;LastName={2}">http://dpm/_layouts/FormServer.aspx?XsnLocation=http://dpm/FormServerTemplates/EmployeeUpdate.xsn&amp;DefaultItemOpen=1&amp;EmployeeID={0}&amp;FirstName={1}&amp;LastName={2}</a><br />
<a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image17.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb17.png" border="0" alt="image" width="644" height="277" /></a><br />
Figure 17  Adding Custom Action that uses InfoPath Form</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2010/02/image18.png"><img style="border-width: 0px;" src="http://sharepointmagazine.net/wp-content/uploads/2010/02/image_thumb18.png" border="0" alt="image" width="644" height="475" /></a><br />
Figure 18  Update Employee in InfoPath Form</p>
<h4>Conclusion</h4>
<p>In this final article, we have focused on actions that users can take on the business entities. We can define actions in ADF or add it “after the fact”. We have also created custom actions using the BDC object model by using custom Web parts and InfoPath forms to enable CRUD (create/read/update/delete) operation support. Once added, actions can be performed from within the list, which becomes relatively transparent to the user where the data comes from. [The statement that the BDC data is read-only is not true anymore as we have just demonstrated.] As you have learned from our 8-part series, BDC enables user interaction in business intelligence, enterprise content management, collaboration and social features, and enterprise search.</p>
<h4>Looking Forward to SharePoint Server 2010</h4>
<p>BDC has evolved to what is now called BCS (business connectivity services) in SharePoint 2010. Even though we can use BDC to enable connectivity to external systems, it was difficult to create solutions because of the lack of a designer and it was not so simple to create a solution that enabled users to make changes and write that data back to the external store. BCS now enables you to integrate LOB data into SharePoint and Office with full CRUD support, tighter integration with Office client applications, and better tools for modeling business entities. BCS is all about connecting to external data. We look forward to sharing with you the exciting new features in BCS and what they can do for you in the near future. Until then, aloha!</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-8-of-8/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SharePoint&#8217;s Branding Limitations, Part 4</title>
		<link>http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4</link>
		<comments>http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4#comments</comments>
		<pubDate>Fri, 24 Jul 2009 07:51:47 +0000</pubDate>
		<dc:creator>Diantha van Marion</dc:creator>
				<category><![CDATA[Customisation]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Calendar]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[Date picker]]></category>
		<category><![CDATA[Design Decisions]]></category>
		<category><![CDATA[Front-end]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML-mark up]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[My site]]></category>
		<category><![CDATA[Paging]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[Search results]]></category>
		<category><![CDATA[Sifr]]></category>
		<category><![CDATA[Stylesheet]]></category>
		<category><![CDATA[Styling]]></category>
		<category><![CDATA[Tabs]]></category>

		<guid isPermaLink="false">http://sharepointmagazine.net/?p=3056</guid>
		<description><![CDATA[Not all graphical designs for a portal will work in a SharePoint environment. There are a couple of limitations the Graphical Designer must know. A Graphical designer needs to know the scope of the graphical design.

This article will give the graphical designers more insight into the effect of these design decisions.]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p>As a Front-end Developer with a background in designing I&#8217;ll show you how to make a graphical design that works for a default SharePoint-environment. If you want to take control over the front-end, don&#8217;t use any themes. Create your art by using style sheets!</p>
<p>Not all graphical designs for a portal will work in a SharePoint environment. There are a couple of limitations the Graphical Designer must know. A Graphical designer needs to know the scope of the graphical design. For example, if a Graphical Designer puts a border on an element like a table, that will take him about 3 minutes to design, but this simple border could take the Front-end Developer a few hours to implement.</p>
<p>It&#8217;s really important that the Graphical Designer and the Front-end Developer work together and have a clear communication about the graphical design. Making a graphical design specifically for a MOSS environment could save you days on the implementation! This article will give the Graphical Designers more insight into the effect of these design decisions.</p>
<p>This article assumes that the reader has SharePoint and basic HTML knowledge.</p>
<h2>Search</h2>
<p>There are multiple search interface within a SharePoint portal. One of them is the search interface in the header. Part 1 of &#8220;The art of SharePoint, how to make a graphical design work for SharePoint&#8221; discusses that one.</p>
<p>The search result page has it&#8217;s own page layout. If you take a look at  the search results page you will see that the search interface is no longer in the header but is now onto the content area. It is not another web part, because it has kept it&#8217;s ID <span style="color: #ff6600;">#1</span>, that is reserved for the search interface.</p>
<pre><a rel="attachment wp-att-3102" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/search11"></a><a rel="attachment wp-att-3610" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/search1-2"><img class="alignnone size-medium wp-image-3610" src="http://sharepointmagazine.net/wp-content/uploads/2009/06/search1-300x226.jpg" alt="search1" width="300" height="226" /></a></pre>
<h2>Page layout</h2>
<p>There is a specific page layout for the search results. If you take a closer look at the Black Search Page (Welcome page)  you can identify the following page elements:</p>
<p>• Tabs</p>
<p>• Input fields</p>
<p>• Results bar</p>
<p>• Search results</p>
<p>• Paging (only visible when there are more then 10 item found)</p>
<pre><a rel="attachment wp-att-3611" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/search15"><img class="alignnone size-full wp-image-3611" src="http://sharepointmagazine.net/wp-content/uploads/2009/06/search15.jpg" alt="search15" width="600" height="353" /></a></pre>
<p>The next section discusses all page elements in detail.</p>
<h2>Tabs</h2>
<p>The code in the following image shows that the tabs are rendered inside a table, the<span style="color: #ff6600;"> .ms-ptabarea</span>, which is rendered inside the <span style="color: #ff6600;">.ms-pagetitleareaframe</span> of the web part</p>
<pre><a rel="attachment wp-att-3612" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/search2-2"><img class="alignnone size-full wp-image-3612" src="http://sharepointmagazine.net/wp-content/uploads/2009/06/search2.jpg" alt="search2" width="769" height="292" /></a></pre>
<p>This table has one more cell as there are tabs. In this case there are two tabs, so there are three cells. The last cell of the table has only one function; it makes sure that the whole table has a bottom border all the way to the right.</p>
<p>The &lt;td&gt;&#8217;s with a tab all contain the class name <span style="color: #ff6600;">.ms-sctabcf</span>, or if the tab is selected, the class name is <span style="color: #ff6600;">.ms-sctabcn</span>. This makes it possible to style the selected tab different from the others. The last&lt;td&gt;, the one for the border, has the class name <span style="color: #ff6600;">.ms-sctabrx</span>.</p>
<p>You can make the tabs look like textual links by removing the background color and the borders of the &lt;td&gt;&#8217;s. Make sure that the selected item will be styled a bit different so that it is still visible that it&#8217;s the one selected. Also make sure you style the rollover state of them. Every class name will get &#8220;hover&#8221; behind the usual class name (except for the<span style="color: #ff6600;"> .ms-sctabrx</span>). For example <span style="color: #ff6600;">.ms-sctabcfhover</span> and <span style="color: #ff6600;">.ms-sctabcnhover</span>.</p>
<pre><a rel="attachment wp-att-3104" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/search31"></a><a rel="attachment wp-att-3613" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/search3-2"><img class="alignnone size-full wp-image-3613" src="http://sharepointmagazine.net/wp-content/uploads/2009/06/search3.jpg" alt="search3" width="406" height="38" /></a></pre>
<h2>Input fields</h2>
<p>Another web part on the search result page is where the input fields are. The table the input fields are in, has a cell for every element, plus one.</p>
<p>All the &lt;td&gt;&#8217;s have the class name <span style="color: #ff6600;">.ms-sbcell</span>, except for the last cell, that is empty. This one is called <span style="color: #ff6600;">.ms-slLastcel</span><span style="color: #ff6600;">l</span>. The cell that has the search button in it, has two class names, the <span style="color: #ff6600;">.ms-sbcell</span> and the <span style="color: #ff6600;">.ms-sbgo</span>. You can style this area by using these class names.</p>
<pre><a rel="attachment wp-att-3614" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/search4-2">
<img class="alignnone size-full wp-image-3614" src="http://sharepointmagazine.net/wp-content/uploads/2009/06/search4.jpg" alt="search4" width="446" height="402" /></a></pre>
<h2>Results bar</h2>
<p>The results bar is located just above the search results. It has it&#8217;s own web part zone called <span style="color: #ff6600;">#MidUpperLeftCell</span>. This web part has a table with three &lt;<span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">tr</span>&gt;&#8217;s. The first ans the second &lt;<span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;">tr</span>&gt;&#8217;s are empty. The third one has a &lt;td&gt; with a web part that is responcible for showing the result text. The text and the sort-links have a classname, you can use to style it.</p>
<pre><a rel="attachment wp-att-3616" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/search51-2">
<img class="alignnone size-full wp-image-3616" src="http://sharepointmagazine.net/wp-content/uploads/2009/06/search51.jpg" alt="search51" width="868" height="628" /></a></pre>
<p>The second results-row, is an other web part, in the web part zone <span style="color: #ff6600;">#MidLowerLeftCell</span>. Inside the <span style="color: #ff6600;">.ms-WPBody</span> is a div.srch-WPBody. In there is the div<span style="color: #ff6600;"> .srch-stats</span> in where the text is located.</p>
<p>Inside the <span style="color: #ff6600;">#MidLowerRightCell</span> is the upper paging positioned.</p>
<pre><a rel="attachment wp-att-3619" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/search6-2"><img class="alignnone size-full wp-image-3619" src="http://sharepointmagazine.net/wp-content/uploads/2009/06/search6.jpg" alt="search6" width="519" height="283" /></a></pre>
<h2>Search results</h2>
<p>The search results are positioned in the web part zone<span style="color: #ff6600;"> #BottomCell</span>. The div inside this web part does have class name:<span style="color: #ff6600;"> .srch-results</span>. All the search results are positioned inside that div. For every search result there is a <span style="color: #ff6600;">.srch-Icon</span>,<span style="color: #ff6600;"> .srch-Title</span>, .<span style="color: #ff6600;">srch-Descriptio</span>n and a <span style="color: #ff6600;">.srch-Metadata</span>, so every element can get its own styling.</p>
<pre><a rel="attachment wp-att-3317" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/search11-2"></a><a rel="attachment wp-att-3622" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/search111"><img class="alignnone size-full wp-image-3622" src="http://sharepointmagazine.net/wp-content/uploads/2009/06/search111.jpg" alt="search111" width="544" height="361" /></a></pre>
<p>All the elements inside a search result have a class name. It is, for example, possible to hide the icon of the document, or give the search title, description or url another color. I advise you to only style the colors and fonts and leave the position of the element as they are, which leaves as much space as possible for the search results.</p>
<h2>Paging</h2>
<p>Inside the <span style="color: #ff6600;">#MidLowerRightCell</span> is the upper paging positioned. The paging at the bottom of the screen is also positioned in the <span style="color: #ff6600;">#BottomCell</span>. Inside the paging div, the .srch-Page there is an &lt;a&gt;-tag for every link. The page that is being visited at the moment does not have a link, nor a classname. So when styling the numbers, first style every element inside the<span style="color: #ff6600;"> .srch-Page</span>, then restyle every &lt;a&gt;-tag inside the <span style="color: #ff6600;">.srch-Page</span>.</p>
<pre><a rel="attachment wp-att-3319" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/search13"></a><a rel="attachment wp-att-3623" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/search131"><img class="alignnone size-full wp-image-3623" src="http://sharepointmagazine.net/wp-content/uploads/2009/06/search131.jpg" alt="search131" width="543" height="371" /></a></pre>
<h1><span class="__mozilla-findbar-search" style="padding: 0pt; background-color: yellow; color: black; display: inline; font-size: inherit;"><br />
</span>My Site</h1>
<p>The My Site is a bit different then the other sites of SharePoint. First of all it uses another master page, which is composed out of different files. If you want to make changes in the master page or page layout of the My Site, there&#8217;s no easy way to do it. How you can edit the master page will not be discussed in this article. Just stick to the existing layout and only change the style sheet. It is possible to make a beautiful my site.</p>
<p><a rel="attachment wp-att-3101" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/mysite21"><img class="alignnone size-full wp-image-3101" src="http://sharepointmagazine.net/wp-content/uploads/2009/04/mysite21.jpg" alt="mysite21" width="922" height="575" /></a></p>
<p>Because the master page of the My Site is a bit different, it does not contain a reference to your style sheet you created. Ask a developer or architect to add the reference for you, or if that is not possible paste the css code underneath the rest of the styiling in the portal.css. This is not the best way to go, because you really want to separate the default styles from the new one&#8217;s. And you do not want to make changes in the style sheet twice (once in your custom stylesheet and once in the portal.css). So, it is better to make the master page of the My Site work with your style sheet by adding the reference to it.<br />
<a rel="attachment wp-att-3320" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/search14"><img class="alignnone size-full wp-image-3320" src="http://sharepointmagazine.net/wp-content/uploads/2009/06/search14.jpg" alt="search14" width="702" height="410" /></a></p>
<p>If you apply the layout style sheet for the portal onto the<em> My Site, </em>you will see that your graphical design is implemented for about 90%. I advise to double check all the items and make sure every element is styled correctly. Pay special attention to the blog and wiki, the calendar and the colleague tracker.</p>
<h1>SIFR</h1>
<p>Scalable Inman Flash Replacement (SIFR) is ment to replace short pieces of text (for example a title or header) by any particular font. Users of the portal do not need to have the font installed on their machine. SIFR works with javascript, flash and css and replaces the particular piece of text in a split second.</p>
<p>In the configuration file of SIFR you can refer to a class name or ID, so that the text inside that element will be replaced by a SIFR object. It is very easy to use. There is one thing you need to consider before using SIFR on a portal.</p>
<p>SIFR replaces the text with a flash object, a swf. This object is placed on top of the text, while the text that is being replaced is made invisible. It is possible to edit some of the object styles, for example the color and the padding.</p>
<p>What if the text you are replacing with SIFR is a link? Like for example a news header? In the news overview page the header is a link. SIFR replaces the text by a swf-object, but the object does not copy the reference the link had. So be careful where to use SIFR on a SharePoint Portal, because, if what you are replacing  a link with SIFR, which has the same class name/ID as referred to in the configuration file, you cannot use SIFR. Make sure your Graphical Designer knows this, and prevent him from designing a fancy menu with spiffy fonts.</p>
<h1>Calendar and date picker</h1>
<p>The calendar has its own style sheet. Just like the date picker. When you style the calendar, you should also style the date  picker, because those two have the same table-like structure and use the same colors. I advise you to only style the colors and fonts of the calendar and use the layout default.</p>
<p>Because there already is a special calendar style sheet, the calendar.css, it is very easy to style the calendar.</p>
<p>1 First of all, find an element you would like to style.</p>
<p>2 Search in the style sheet for its color and/or background image or -color.</p>
<p>3 Copy all the class names and ID&#8217;s that have that particular color or background image.</p>
<p>4 Make a separate calendar section in the exsisting style sheet, for example after the last line, at the end of the other styling in the calendar.css.</p>
<p>5 Paste the class names and ID&#8217;s in there and give them the color and background images you would like to give them.</p>
<p>This way, you can end up by changing a handfull color codes, and it can be done pretty easy. You can work the same way for the date picker, and you can use the same colors as you did for the calendar.</p>
<p>Here are some examples:</p>
<pre><a rel="attachment wp-att-3098" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/calendar11"></a><a rel="attachment wp-att-3321" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/calendar1-2"><img class="alignnone size-full wp-image-3321" src="http://sharepointmagazine.net/wp-content/uploads/2009/06/calendar1.jpg" alt="calendar1" width="554" height="340" /></a>

<a rel="attachment wp-att-3099" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/attachment/calendar21"><img class="alignnone size-full wp-image-3099" src="http://sharepointmagazine.net/wp-content/uploads/2009/04/calendar21.jpg" alt="calendar21" width="514" height="437" /></a></pre>
<p>Make sure you have checked the day, week and month view. Also check a short appointment, an appointment over a few days and an all day appoint.</p>
<h1>Summary</h1>
<p>Here&#8217;s a small overview with highlights of all four parts of the article &#8220;The art of SharePoint, how to make a graphical design work for SharePoint&#8221;.</p>
<ul>
<li>Styling elements will work best on elements that have a class name, ID or a combination of both.</li>
<li>Always double check if you haven&#8217;t forgotten to style any elements.</li>
<li>The calendar and the date picker have their own style sheet.</li>
<li>The look and feel is well manageable when making custom master pages and page layouts. This gives you the opportunity to find the boundaries and give it all a bit more exciting looking.</li>
<li>Most of the time, adjusting the height, width or colors of an element, text or image is not that hard. It is more difficult to style the position, the location of the page elements. Because you cannot change the order in which elements are rendered, you will need style sheets to edit the location on the page where the elements are shown.</li>
<li>Changing an elements position can cause some trouble on other pages on the portal, because class names and ID&#8217;s are used through the whole portal. Changing one of them will cause another element on another page to change also.</li>
</ul>
<h2>Resources</h2>
<p><a href="http://www.heathersolomon.com/content/sp07cssreference.htm" target="_blank">CSS Reference Chart for SharePoint 2007</a></p>
<p>By Heather Solomon</p>
<p><a href="http://www.mikeindustries.com/blog/sifr/" target="_blank">SIFR</a></p>
<p>By Mike Davidson<a href="http://www.sifrgenerator.com/" target="_blank"></a></p>
<p><a href="http://blogs.tamtam.nl/Diantha/" target="_blank">Tamtam blog Diantha van Marion</a></p>
<p>By Diantha van Marion</p>
<h1>Thank You Tam Tam !</h1>
<p>A big thank you to Diantha and Tam Tam from Arno at SharePoint Magazine. This post is from the SharePoint Magazine <a href="../announcements/sharepoint-magazine-partner-spotlight">Partner Spotlight</a> Week, where our featued partner was <a href="../companies/partner-spotlight-tam-tam">Tam Tam. </a></p>
<p>If you would like to be featured on the <a href="../announcements/sharepoint-magazine-partner-spotlight" target="_blank">SharePoint Magazine Partner Spotlight</a>, please <a href="../contactus.php" target="_blank">contact us</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-4/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<series:name><![CDATA[Partner Spotlight: Tam Tam]]></series:name>
	</item>
		<item>
		<title>SharePoint&#8217;s Branding Limitations, Part 3</title>
		<link>http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-3</link>
		<comments>http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-3#comments</comments>
		<pubDate>Thu, 23 Jul 2009 08:04:48 +0000</pubDate>
		<dc:creator>Diantha van Marion</dc:creator>
				<category><![CDATA[Customisation]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[Design Decisions]]></category>
		<category><![CDATA[Front-end]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML-mark up]]></category>
		<category><![CDATA[lists]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[News article]]></category>
		<category><![CDATA[Page layout]]></category>
		<category><![CDATA[Pagelayout]]></category>
		<category><![CDATA[Stylesheet]]></category>
		<category><![CDATA[Styling]]></category>
		<category><![CDATA[Tables]]></category>
		<category><![CDATA[web parts]]></category>

		<guid isPermaLink="false">http://sharepointmagazine.net/?p=2810</guid>
		<description><![CDATA[Not all graphical designs for a portal will work in a SharePoint environment. There are a couple of limitations the Graphical Designer must know. A Graphical designer needs to know the scope of the graphical design.
This article will give the graphical designers more insight into the effect of these design decisions.]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p>As a Front-end Developer with a background in designing I&#8217;ll show you how to make a graphical design that works for a default SharePoint-environment. If you want to take control over the front-end, don&#8217;t use any themes. Create your art by using style sheets!</p>
<p>Not all graphical designs for a portal will work in a SharePoint environment. There are a couple of limitations the Graphical Designer must know. A Graphical designer needs to know the scope of the graphical design. For example, if a Graphical Designer puts a border on an element like a table, that will take him about 3 minutes to design, but this simple border could take the Front-end Developer a few hours to implement.</p>
<p>It&#8217;s really important that the Graphical Designer and the Front-end Developer work together and have a clear communication about the graphical design. Making a graphical design specifically for a MOSS environment could save you days on the implementation! This article will give the Graphical Designers more insight into the effect of these design decisions.</p>
<p>This article assumes that the reader has SharePoint and basic HTML knowledge.</p>
<h1>Web parts</h1>
<p>This section is all about SharePoint&#8217;s web parts. First the display mode of the web parts will be the point of interest, then the Edit mode, and after that the Article page layouts will be discussed.</p>
<p>The &lt;td&gt; with class name <span style="color: #ff6600;">.ms-bodyareacell </span>is the overall container for the content. Inside this &lt;td&gt; is a table with class <span style="color: #ff6600;">.ms-propertysheet</span>, and a td<span style="color: #ff6600;">.ms-bodyareaframe</span> inside that there is another table. These  are the containers for the content on a page and are being defined in the page layout. Inside the <span style="color: #ff6600;">.ms-bodyareaframe</span> are a few nested tables and one of these tables is the table of a web part.</p>
<pre><img class="alignnone size-full wp-image-2811" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/wp-table.jpg" alt="wp-table" width="790" height="387" /></pre>
<h2>Web part ID&#8217;s</h2>
<p>If a web part is placed inside a web part zone, it will get an ID. Depending on the amount of already placed web parts on that page, and the order in which they are placed, the ID will get its tracking number. It does not change when you change the order of the web part zones. So therefore, the ID of the web part actually isn&#8217;t unique, it is just unique for that page.</p>
<pre><img class="alignnone size-full wp-image-2817" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/wp-id.jpg" alt="wp-id" width="445" height="211" /></pre>
<p>The web part in this example is the third web part of the page and as you can see, it carries number 3 in the ID. The search interface in the header is always the first web part of the page. In this case there were two web parts placed on the page, which together with the search makes three: the ID number of the last placed web part. If you want to style the web part in its entirety, you can only list all the web part ID&#8217;s and add styling to them. This nasty solution is the only solution to styling every web part on itself. A better solution would be for example to style the elements inside the web parts, such as the<span style="color: #ff6600;"> .ms-WPBody</span>.</p>
<pre>..
#MSOZoneCell_WebPartWPQ27,
#MSOZoneCell_WebPartWPQ28,
#MSOZoneCell_WebPartWPQ29,
#MSOZoneCell_WebPartWPQ30{
     Border:1px #f2f2f2 solid;
}</pre>
<p>Because every web part has a &lt;td&gt; and inside that a table as a container, it is possible to style the background of the web part with two background images, but it is very tricky an I advice you not to do so. Make sure every &lt;td&gt; with ID <span style="color: #ff6600;">#MSOZoneCell_WebPartWPQ2</span> (a web part ID of your choice) has a background image.  Then style every table inside the &lt;td&gt; with those ID&#8217;s with another background image. Secondly, hide every background image on every second or more nested table inside the &lt;td&gt; with the web part ID.</p>
<p>Here&#8217;s an example of how, just for web part ID 3:</p>
<pre>#MSOZoneCell_WebPartWPQ3{
     Background:transparent url(images/webparttop.jpg) repeat-x left top;
}
#MSOZoneCell_WebPartWPQ3 table{
     Background:transparent url(images/webpartbottom.jpg) repeat-x left top;
}
#MSOZoneCell_WebPartWPQ3 table table{
     Background:transparent none;
}</pre>
<p>Which means &#8220;only apply if table is the first element inside <span style="color: #ff6600;">#MSOZoneCell_</span><span style="color: #ff6600;">WebPart</span><span style="color: #ff6600;">WPQ3</span>&#8220;, because it is not supported in Internet Explorer 6 and older versions.</p>
<p>Unfortunately you cannot use</p>
<pre>#MSOZoneCell_WebPartWPQ3 &gt; table {
     ..
}</pre>
<p>Make sure the images you use are repeatable on the x-axis. If they are not, you will need to make a new page layout where the web part zones have a static width (set in the style sheet of course). This way you can control the width of the web parts in a particular web part zone, and make your background images as wide as the web parts.</p>
<pre><a rel="attachment wp-att-3146" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-3/attachment/wp-bg"><img class="alignnone size-full wp-image-3146" src="http://sharepointmagazine.net/wp-content/uploads/2009/04/wp-bg.jpg" alt="wp-bg" width="281" height="148" /></a></pre>
<h2>Web part headers</h2>
<p>Inside the &lt;td&gt; with the web part ID is always a table with two &lt;tr&gt;&#8217;s. The first one is for the header of the web part, the second one is for the content of the web part.</p>
<pre><img class="alignnone size-full wp-image-2818" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/wp-2trs.jpg" alt="wp-2trs" width="540" height="387" /></pre>
<p>The first class you can use to style the header is the<span style="color: #ff6600;"> tr.ms-WPHeader</span>. This &lt;tr&gt; has two &lt;td&gt;&#8217;s, one for the title of the header, and another one for the little arrow on the right pointing down. Only the first &lt;td&gt; has an ID, which has the same ID-number as the web part-ID.  To style the background and the borders of the header, you can style every &lt;td&gt; inside the <span style="color: #ff6600;">.ms-WPHeader</span>.</p>
<pre><a rel="attachment wp-att-3147" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-3/attachment/wp-header"><img class="alignnone size-full wp-image-3147" src="http://sharepointmagazine.net/wp-content/uploads/2009/04/wp-header.jpg" alt="wp-header" width="494" height="446" /></a></pre>
<pre>.ms-WPHeader td {
     border-bottom:1px solid #4E7CB7;
}</pre>
<p>To style the text of the header, style the<span style="color: #ff6600;"> .ms-WPTitle</span>. Be aware that some web part titles contain a hyperlink. The little arrow is also a link, and to style that you can style the &lt;a&gt;-tag inside the &lt;td&gt;, and then overrule the styling for the header text. Like this:</p>
<pre>/*This styles every link in the header*/
.ms-WPHeader td a{
	background-color:#000000;
}</pre>
<pre>/*This styles every textual link in the header*/
.ms-WPHeader .ms-WPTitle,
.ms-WPHeader .ms-WPTitle a:link,
.ms-WPHeader .ms-WPTitle a:visited{
	color:#4F3B2F;
}</pre>
<pre><img class="alignnone size-full wp-image-2813" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/wp-wph.jpg" alt="wp-wph" width="448" height="256" /></pre>
<p>It is possible to hide the header by changing the settings of the web part. Choose &#8220;appearance&#8221; and in the &#8220;chrome type&#8221; drop down and choose &#8220;none&#8221;. The &lt;tr&gt; with the header will not be rendered then.</p>
<pre><img class="alignnone size-full wp-image-2821" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/wp-chrome.jpg" alt="wp-chrome" width="127" height="107" /></pre>
<h2>Content Editor Web parts</h2>
<p>The &lt;td&gt; of the second &lt;tr&gt; of the<span style="color: #ff6600;"> </span><span style="color: #ff6600;">#MSOZoneCell_WebPartWPQ </span>contains a &lt;div&gt; with a web part ID that has the ID number related to the amount of web parts on the page, like <span style="color: #ff6600;">#WebPartWPQ3</span>. It also has a class called <span style="color: #ff6600;">.ms-WPBody</span>. The core.css uses this class to set the font family and size.</p>
<pre><img class="alignnone size-full wp-image-2822" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/wp-txt.jpg" alt="wp-txt" width="448" height="299" /></pre>
<p>When using a Content Editor Web part, text is placed directly in the <span style="color: #ff6600;">.ms-WPBody</span>. The color of the text is set by the styling in the core.css, on the<span style="color: #ff6600;"> .ms-propertysheet</span> and the body tag. The same goes for the hyper links in the text.</p>
<pre><img class="alignnone size-full wp-image-2823" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/wp-txthyperlink.jpg" alt="wp-txthyperlink" width="544" height="169" /></pre>
<h2>Lists</h2>
<p>In a list web part, there is a <span style="color: #ff6600;">table.ms-summarycustombody</span> class, in where all the links are positioned. Every &lt;td&gt; has a class.</p>
<pre><img class="alignnone size-full wp-image-2829" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/wp-list.jpg" alt="wp-list" width="817" height="488" /></pre>
<p>Depending on what list with hyper links you use, the &lt;td&gt;&#8217;s will have one of the following class:</p>
<pre>.ms-vh,
.ms-vh2,
.ms-vh-icon,
.ms-vh-icon-empty,
.ms-vhImage,
.ms-gb,
.ms-gb2,
.ms-gbload,
.ms-vb,
.ms-vb2,
.ms-vb-tall,
.ms-GRFont,
.ms-vb-user,
table.ms-disc td,
.ms-vh2-nofilter,
.ms-vh2-nograd,
.ms-vh3-nograd,
.ms-vh2-nograd-icon,
.ms-vh2-nofilter-icon,
.ms-pb,
.ms-pb-selected,
.ms-ph {
     font-family:tahoma,sans-serif;
     font-size:8pt;
}</pre>
<p>The first two of this list are for example also used for list headers. Most graphical designs will have the same styling for all hyper links on the portal, so you can add your styling to the above classes and their &lt;a&gt;-tags.  The &#8220;add new&#8221; (add new announcement, add new event, add new link, etc. ) hyper links can be styled with their own class, for example:<span style="color: #ff6600;"> a.ms-addnew</span>. Here&#8217;s an example of how you could style the lists.</p>
<pre><img class="alignnone size-full wp-image-2830" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/wp-linksintxt.jpg" alt="wp-linksintxt" width="262" height="263" /></pre>
<pre><img class="alignnone size-full wp-image-2831" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/wp-linklist.jpg" alt="wp-linklist" width="202" height="131" /></pre>
<h2>Data table</h2>
<p>SharePoint uses tables and lists to display its data. The Document Center is one of those &#8216;data tables&#8217;. The Document Center uses another page layout, because the purpose of the page is to show a big list with data and no text like articles. Therefore the Document Center has one web part zone that uses the whole width of the page.  When styling the web parts, make sure the lists of the Document Center (Documents, Announcements, Tasks) are styled correctly. Pay special attention to the list headers here and make sure the fly outs of the top navigation are positioned above the list headers. If they are, make sure you position the <span style="color: #ff6600;">.ms-vh div</span> and <span style="color: #ff6600;">.ms-vh2 div <span style="color: #000000;">s</span></span><span style="color: #000000;">tati</span>cally.</p>
<pre><img class="alignnone size-full wp-image-2832" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/wp-doccenter.jpg" alt="wp-doccenter" width="718" height="247" /></pre>
<h2>Width</h2>
<p>Sharepoint comes with a set of page layouts. These page layouts have middle and right zones, but they do not always have an ID or class name for those zones. If you want to control the width of the web parts in either the middle or the right column, you need to create new ones, based on the existing page layouts. Make sure every web part zone has an ID or class, so you can set the width of those in the style sheet.</p>
<p><img class="alignnone size-full wp-image-2833" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/wp-setwidth.jpg" alt="wp-setwidth" width="467" height="327" /></p>
<h1>Edit mode</h1>
<p>In edit mode the styling is usually  kept default. Most of the classes and ID&#8217;s of the content are different when in edit mode, so the styling of elements inside web parts is rather easy to separate, but the web parts themselves aren&#8217;t. When editing a page, some web part zones and web parts will get other class.</p>
<pre><img class="alignnone size-full wp-image-2834" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/wp-spzone.jpg" alt="wp-spzone" width="601" height="456" /></pre>
<p>System pages like the &#8220;site settings&#8221;-page and the &#8220;all site content&#8221;-page only contain the same header elements. The rest of the page has classes that are not used on the front-end. Therefore you can style those pages differently. I advise to only change the colors and fonts and leave the layout and the positioning the way it is by default. This way you won&#8217;t corrupt the usability of the system pages.</p>
<pre><img class="alignnone size-full wp-image-2835" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/wp-siteinstellingen.jpg" alt="wp-siteinstellingen" width="400" height="236" /></pre>
<h1>News articles</h1>
<p>When creating a news article, it is possible to choose between several news article layouts; the page layouts. The first page layout for an article page is the &#8220;article page with body only&#8221;. Other page layouts are the &#8220;article page with image on left&#8221;, &#8220;article page with image on right&#8221; and the &#8220;article page with summary links&#8221;.</p>
<h2>Article page with body only</h2>
<p>This page contains a page content zone and a roll up image. When publishing the page, all the content will be inside the <span style="color: #ff6600;">#MSO_ContentTable</span>. Inside that is the <span style="color: #ff6600;">d</span><span style="color: #ff6600;">iv.pageContent</span>.</p>
<pre><img class="alignnone size-full wp-image-2846" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ap-1.jpg" alt="ap-1" width="669" height="275" /></pre>
<pre><img class="alignnone size-full wp-image-2849" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ap-1a1.jpg" alt="ap-1a1" width="818" height="356" /></pre>
<p>Since the <span style="color: #ff6600;">d</span><span style="color: #ff6600;">iv.pageContent </span>is an element of every news article page layout, you cannot set the width of the element. Styling this element will cause other page layouts also to be adjusted.</p>
<pre><img class="alignnone size-full wp-image-2848" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ap-vb1.jpg" alt="ap-vb1" width="329" height="116" /></pre>
<h2>Article page with image on left</h2>
<p>The second page layout is the &#8220;Article page with image on left&#8221;.</p>
<pre><img class="alignnone size-full wp-image-2850" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ap-2.jpg" alt="ap-2" width="669" height="275" /></pre>
<p>This page layout has the following elements:</p>
<ul>
<li>Page image</li>
<li>Article date</li>
<li>Byline</li>
<li>Page content</li>
<li>Image caption</li>
<li>Roll up image</li>
</ul>
<p><strong>Page image</strong></p>
<p>The <span style="color: #ff6600;">.bodyareaframe</span> contains two tables and some &lt;div&gt;&#8217;s. The first table has the property<span style="color: #ff6600;"> float:left</span>. This makes the image positioned to the left of the text.</p>
<pre><img class="alignnone size-full wp-image-2851" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ap-2a.jpg" alt="ap-2a" width="816" height="568" /></pre>
<p><strong>Article line and byline</strong></p>
<p><strong></strong>The second table of the <span style="color: #ff6600;">.bodyareaframe </span>is the header. It contains two cells, one for the article date (<span style="color: #ff6600;">.dateLine</span>) and one for the &#8220;byline&#8221;.</p>
<pre><img class="alignnone size-full wp-image-2852" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ap-2b.jpg" alt="ap-2b" width="428" height="126" /></pre>
<p>Page content</p>
<p>The <span style="color: #ff6600;">di</span><span style="color: #ff6600;">v.pageContent</span> contains a<span style="color: #ff6600;"> div#ctl00_PlaceHolderMain_Content__ControlWrapper_RichHtmlField</span>, which contains the text. The ID is not unique for this piece of page content, it is only unique on this page.</p>
<p>Other page layouts use the same ID, so by styling this element, the text looks the same, no matter what article page layout is chosen.</p>
<pre><img class="alignnone size-full wp-image-2853" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ap-vb2.jpg" alt="ap-vb2" width="352" height="138" /></pre>
<h2>Article page with image on right</h2>
<p>The &#8220;article page with image on right&#8221; has got the same fields and controls as the &#8220;Article page with image on left&#8221;. The only difference is the floating. Where in the &#8220;Article page with image on left&#8221; the table was floating left, here the table has no floating, but a &lt;div&gt; around it has a right floating. There&#8217;s an extra container div, the<span style="color: #ff6600;"> .articleLayout </span>that was not in the &#8220;Article page with image on left&#8221;.</p>
<pre><img class="alignnone size-full wp-image-2854" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ap-3.jpg" alt="ap-3" width="669" height="275" /></pre>
<pre><img class="alignnone size-full wp-image-2855" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ap3a.jpg" alt="ap3a" width="791" height="587" /></pre>
<pre><img class="alignnone size-full wp-image-2856" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ap-vb3.jpg" alt="ap-vb3" width="396" height="201" /></pre>
<h2>Article page with summary links</h2>
<p>The &#8220;Article page with summary links&#8221; has, instead of the page image and image caption, a Summary Links control. These links are positioned inside a table that is floated to the right.</p>
<pre><img class="alignnone size-full wp-image-2859" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ap-4.jpg" alt="ap-4" width="669" height="275" /></pre>
<pre><img class="alignnone size-full wp-image-2858" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ap-4a.jpg" alt="ap-4a" width="655" height="355" /></pre>
<pre><img class="alignnone size-full wp-image-2857" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ap-vb4.jpg" alt="ap-vb4" width="270" height="136" /></pre>
<h1>Next time in &#8220;SharePoint&#8217;s Branding Limitations&#8221;</h1>
<p>Next time in part four of &#8220;the Art of SharePoint, how to make a graphical design work for SharePoint&#8221;, I will discuss some design decisions for search pages and the My Site. Other points of interest are the styling of the calendar and date picker and the use of SIFR.</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-3/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<series:name><![CDATA[Partner Spotlight: Tam Tam]]></series:name>
	</item>
		<item>
		<title>SharePoint&#8217;s Branding Limitations, Part 2</title>
		<link>http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-2</link>
		<comments>http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-2#comments</comments>
		<pubDate>Wed, 22 Jul 2009 07:27:58 +0000</pubDate>
		<dc:creator>Diantha van Marion</dc:creator>
				<category><![CDATA[Customisation]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[Design Decisions]]></category>
		<category><![CDATA[Front-end]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML-mark up]]></category>
		<category><![CDATA[Menu items]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[Mysite]]></category>
		<category><![CDATA[Navigation]]></category>
		<category><![CDATA[Quicklaunch]]></category>
		<category><![CDATA[Stylesheet]]></category>
		<category><![CDATA[Styling]]></category>

		<guid isPermaLink="false">http://sharepointmagazine.net/?p=2534</guid>
		<description><![CDATA[Not all graphical designs for a portal will work in a SharePoint environment. There are a couple of limitations the Graphical Designer must know. A Graphical designer needs to know the scope of the graphical design.
This article will give the graphical designers more insight into the effect of these design decisions.]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p>As a Front-end Developer with a background in designing I&#8217;ll show you how to make a graphical design that works for a default SharePoint-environment. If you want to take control over the front-end, don&#8217;t use any themes. Create your art by using style sheets!</p>
<p>Not all graphical designs for a portal will work in a SharePoint environment. There are a couple of limitations the Graphical Designer must know. A Graphical designer needs to know the scope of the graphical design. For example, if a Graphical Designer puts a border on an element like a table, that will take him about 3 minutes to design, but this simple border could take the Front-end Developer a few hours to implement.</p>
<p>It&#8217;s really important that the Graphical Designer and the Front-end Developer work together and have a clear communication about the graphical design. Making a graphical design specifically for a MOSS environment could save you days on the implementation! This article will give the Graphical Designers more insight into the effect of these design decisions.</p>
<p>This article assumes that the reader has SharePoint and basic HTML knowledge.</p>
<h1>Navigation</h1>
<p>This section is all about SharePoint&#8217;s navigation elements. First the meta navigation is discussed, secondly the top navigation with a focus on it’s fly outs. Thirdly, the quick launch navigation is discussed and last but not least the site actions menu.</p>
<h2>Meta navigation</h2>
<p>The meta navigation contains a set of links: Sign In/Welcome, My Links, etc.  The meta navigation is positioned at the upper right top of the page.  It has three textual links and a help icon as you can see in the image below.</p>
<pre><a href="http://sharepointmagazine.net/wp-content/uploads/2009/02/meta-navigation.jpg"><img class="size-full wp-image-2535 alignnone" src="http://sharepointmagazine.net/wp-content/uploads/2009/02/meta-navigation.jpg" alt="" width="315" height="22" /></a></pre>
<p>The meta navigation begins with the <span style="color: #ff9900;">table.ms-globalright. </span>The table is floated to the right which causes the menu to be positioned at the right of the page.  This table has five &lt;td&gt;&#8217;s and they all contain the class name <span style="color: #ff9900;">.ms-globallinks</span>.</p>
<ol>
<li>The first &lt;td&gt; is empty.</li>
<li>The second &lt;td&gt; contains the welcome text and a fly out.</li>
<li>The third &lt;td&gt; contains the vertical line.</li>
<li>The fourth &lt;td&gt; contains a new table.This table contains the &#8220;My Site&#8221; link, separator, &#8220;My Links&#8221; link and separator.</li>
<li>The last &lt;td&gt; contains the help icon.</li>
</ol>
<p>Every &lt;td&gt; of the meta navigation has the class name<span style="color: #ff9900;"> .ms-globallinks</span>. Unfortunately you cannot give this class and every &lt;A&gt; inside a color to change the color of all the links in the meta navigation. The Welcome link doesn&#8217;t change after applying a color to the <span style="color: #ff9900;">.ms-globallinks</span> and it&#8217;s &lt;a&gt;-tags. Because this &lt;td&gt; contains a &lt;div&gt; <span style="color: #ff9900;">.<span style="color: #ff9900;">m</span></span><span style="color: #ff9900;">s-SPLink. </span>Every link inside that &lt;div&gt; has a different color specified in the core.css style sheet. An other link that won&#8217;t change color is the My Links link.</p>
<pre><a rel="attachment wp-att-3129" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-2/attachment/meta-red"><img class="alignnone size-full wp-image-3129" src="http://sharepointmagazine.net/wp-content/uploads/2009/04/meta-red.jpg" alt="meta-red" width="967" height="411" /></a></pre>
<p>When coloring all the links of the meta navigation add the declaration to the &lt;a&gt;-tags in the class name <span style="color: #ff6600;">.ms-SPLink</span>, like this:</p>
<pre>.ms-SPLink a:link,
.ms-SPLink a:visited,
.ms-globallinks,
.ms-globallinks a{
    color:green;
}</pre>
<p>This will overrule the styles for the links in the<span style="color: #ff9900;"> .ms-SPLink</span>, as defined in the core.css, the master style sheet which takes care of the default styling on a SharePoint portal.</p>
<h3>Welcome &#8216;Your Name&#8217; and &#8216;My Links&#8217;</h3>
<p>The &lt;td&gt; of these links contains two spans. The first one, which is hidden, contains the fly out. The second span contains a &lt;div&gt; which contains the &lt;a&gt;-tag. Within the &lt;a&gt;-tag the little arrow pointing down is positioned as well, as seen in the next picture.</p>
<pre><a href="http://sharepointmagazine.net/wp-content/uploads/2009/02/meta-welcome.jpg"><img class="size-full wp-image-2536 alignnone" src="http://sharepointmagazine.net/wp-content/uploads/2009/02/meta-welcome.jpg" alt="" width="500" height="372" /></a></pre>
<p>The graphical behavior of the Welcome and &#8220;My Links&#8221; link is the same. When hovering the link, there&#8217;s a background-color and a border, suggesting it is a button. For consistent use of the graphical design you probably want to style the &#8220;My site&#8221; link the same as the other buttons.</p>
<pre><a href="http://sharepointmagazine.net/wp-content/uploads/2009/02/meta-rollover.jpg"><img class="alignnone size-full wp-image-2537" src="http://sharepointmagazine.net/wp-content/uploads/2009/02/meta-rollover.jpg" alt="" width="149" height="20" />
</a></pre>
<p>Here&#8217;s the code to remove the background-color and border. Add the underline on hovering, to make it look like a textual link instead of a button:</p>
<pre>.ms-HoverCellActive,
.ms-SpLinkButtonActive,
.ms-HoverCellActiveDark{
    background-image:none;
    border:0px none;
    background-color:transparent;
}
.ms-HoverCellActive a:hover,
.ms-SpLinkButtonActive a:hover,
.ms-HoverCellActiveDark a:hover{
    text-decoration:underline;
}</pre>
<h3>My site</h3>
<p>The <em>My Site</em> link is the only link (in the meta navigation) that does not contain a fly out. Therefore, this link will respond to any styling assigned to .ms-globallinks a. The hover state of the .ms-globallinks a is not defined in the core.css style sheet, and therefore overridden by .ms-globalbreadcrumb a:hover. Style the .ms-globallinks a:hover to change the hover state.</p>
<pre><a href="http://sharepointmagazine.net/wp-content/uploads/2009/02/meta-msml.jpg"><img class="alignnone size-full wp-image-2539" src="http://sharepointmagazine.net/wp-content/uploads/2009/02/meta-msml.jpg" alt="" width="500" height="372" /></a></pre>
<h3>Help icon</h3>
<p>The help icon is an image inside an &lt;a&gt;-tag. Because the image itself does not have a class name or ID, it is not specific enough to hide all the images inside the <span style="color: #ff9900;">.ms-globallinks</span>. That is because then the separators would also be effected. Therefor, you can use the &lt;a&gt;-tag (with an ID) in where the image is, to hide the help icon (by hiding the &lt;a&gt;-tag, the image will also be hidden). It is not recommended to hide the help icon because it&#8217;s function is to help the user. It is possible to show another image here. To do this you need to hide the image inside the &lt;a&gt;-tag and make the &lt;a&gt;-tag behave like a block. Then give it dimensions and place the new image of the icon as a background image.</p>
<pre><a href="http://sharepointmagazine.net/wp-content/uploads/2009/02/meta-help.jpg"><img class="alignnone size-full wp-image-2806" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/meta-help.jpg" alt="meta-help" width="496" height="394" />
</a></pre>
<p>An example:</p>
<pre>.ms-globallinks a#ctl00_PlaceHolderGlobalNavigation_TopHelpLink img{
    display:none;
}
.ms-globallinks a#ctl00_PlaceHolderGlobalNavigation_TopHelpLink{
    display:block;
    background:transparent url(/_layouts/images/new_help_icon.gif) no-repeat left center;
    width:10px;
    height:10px;
}</pre>
<h3>Separators</h3>
<p>It is possible to make the separators of the meta navigation hidden, because these are the only non-hyper links in the<span style="color: #ff9900;"> .ms-globallinks</span>. Because they don&#8217;t have any class names or ID&#8217;s that are unique within the meta navigation, you need to style it all. Afterwards you can style the links differently. Giving all the items in the <span style="color: #ff9900;">.ms-globallinks </span>a visibility:invisible or a display:none, and the links a visibility:visible or a display:block, will cause your links to disappear, but only in Internet Explorer. The only way to hide them for all browsers is by giving them the same color as the background color of the meta menu, which off course should have a solid background color.</p>
<pre><a href="http://sharepointmagazine.net/wp-content/uploads/2009/02/meta-separator.jpg"><img class="size-full wp-image-2541 alignnone" src="http://sharepointmagazine.net/wp-content/uploads/2009/02/meta-separator.jpg" alt="" width="500" height="372" /></a></pre>
<p>The steps are as follows: give the <span style="color: #ff6600;">.ms-globallinks</span> the same color as the background color (or any other color you wish), and give the links in the .ms-globallinks a of your choice. Like this:</p>
<pre>.ms-globallinks{
    color:#FFFFFF !important;
}
.ms-SPLink a:link,
.ms-SPLink a:visited,
.ms-globallinks,
.ms-globallinks a{
    color:green;
}</pre>
<p>You can remove some padding of the <span style="color: #ff6600;">.ms-globallinks</span> to make the spaces between the hyper links less wide.</p>
<pre><a href="http://sharepointmagazine.net/wp-content/uploads/2009/02/meta-noseparator.jpg"><img class="alignnone size-full wp-image-2543" src="http://sharepointmagazine.net/wp-content/uploads/2009/02/meta-noseparator.jpg" alt="" width="313" height="21" /></a></pre>
<p>It is not possible to style the links on multiple lines, because the &#8216;welcome&#8217;-link and the &#8216;my site&#8217;-link have the same class names, and will react the same.</p>
<h2>Top navigation with fly outs</h2>
<p>The top navigation is the horizontal navigation bar at the top of every page (inside the <span style="color: #ff6600;">bannercontainer</span>). The top navigation shows the sites or pages from the first level. This first level contains every page or site made from the homepage. The homepage is always level 0. SharePoint enables users to rename, remove or add a link.</p>
<p>The top navigation has a lot of nested tables. The table of the banner frame contains four &lt;td&gt;&#8217;s.</p>
<ol>
<li>The first is empty.</li>
<li>The second &lt;td&gt; contains the top navigation menu.</li>
<li>The third &lt;td&gt; is empty.</li>
<li>The fourth contains the site actions menu.</li>
</ol>
<p>The site actions will be discussed later. First I want to focus on the top navigation menu. In the ideal world and maybe in the future it will by default, the menu would look like this:</p>
<pre>&lt;ul class="ms-bannerframe"&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li class="ms-banner"&gt;
		&lt;ul class="ms-topNavContainer"&gt;
			&lt;li&gt; .. &lt;/li&gt;
			&lt;li&gt; .. &lt;/li&gt;
			&lt;li&gt; .. &lt;/li&gt;
		&lt;/ul&gt;
	&lt;/li&gt;
	&lt;li&gt;&lt;/li&gt;
	&lt;li&gt;siteactions menu goes here &lt;/li&gt;
&lt;/ul&gt;</pre>
<p>The second &lt;td&gt; contains a table, the <span style="color: #ff6600;">.ms-topNavContainer</span>, which contains multiple &lt;td&gt;&#8217;s. The first &lt;td&gt; is the home menu item, the menu item of level 0. The rest of the &lt;td&gt;&#8217;s are empty or contain other items of the top navigation.</p>
<pre><img class="alignnone size-full wp-image-2765" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/topnav-container.jpg" alt="topnav-container" width="625" height="573" /></pre>
<h3>Home, the first menu item</h3>
<p>The home menu item is placed into another table, the <span style="color: #ff6600;">.ms-topnav</span>. Every menu item of the top navigation is placed inside a table with the same class name. When the menu item is active, it gets another class name added, the <span style="color: #ff6600;">.ms-topnavselected</span>. By using this class name in your style sheet, it is possible to style the active menu items different. Another element contains the class name <span style="color: #ff6600;">.ms-topnav</span> as well: the &lt;a&gt;-tagtable.ms-topnav or a.ms-topnav, or use just .ms-topnav for giving them both the sames styling. The same goes for the .ms-topnavselected. of the menu item. Be sure to style the right item by styling the</p>
<pre><img class="size-full wp-image-2768 alignnone" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/topnav-mstopnav.jpg" alt="topnav-mstopnav" width="597" height="324" /></pre>
<p>It is not possible to style the home menu-item differently then the other menu items, because they all have the same class names. If you want to do it anyway, you need to edit the HTML that is rendered for this menu.</p>
<h3>Other first level menu items</h3>
<p>The &lt;td&gt; with the other menu items, contains a table with two cells. The first cell is empty, the next cell contains a table, the .ms-topnav. If the menu item does not contain any pages or sites at second level, the &lt;td&gt; only contains the &lt;a&gt;-tag, just like the home button.</p>
<pre><img class="alignnone size-full wp-image-2769" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/topnav-no2ndlevel.jpg" alt="topnav-no2ndlevel" width="544" height="438" /></pre>
<h4>Background images</h4>
<p>To style the menu items, you can use the class <span style="color: #ff6600;">table.ms-topnav</span>. You can give it a background color or background image. Be aware that the image must be repeatable on the x-axis unless the menu items have a fixed width. You cannot use an image that is different on the left and right side when the images have variable widths. This is because items with no second level have only one &lt;td&gt;. So you cannot use an image for the left side and another image for the right side.</p>
<p>If the <span style="color: #ff6600;">table.ms-topnav</span> has a fixed width, you can use one background image on the table, but be aware that menu items with a long text can be bigger then the set width. The styling of the menu item will fail.</p>
<p>The first image shows a menu item that has no arrow on the right. The second image shows the menu item when it does have an arrow on the right.</p>
<pre><img class="size-full wp-image-2767 alignnone" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/topnav-firstlevel.jpg" alt="topnav-firstlevel" width="354" height="280" /></pre>
<p>An example of how you could style the first level of the top navigation:</p>
<pre>.ms-topnav {
     background-color:#70C8D4;
     background-image:none;
     border:0px none;
     color:#FFF;
}</pre>
<pre>.ms-topnavselected {
     background:#2B9AAE url(/_layout/images/topnavselected.gif) repeat-x fixed left bottom;
     border:0px none;
}</pre>
<p>Hide the little arrow pointing down by:</p>
<pre>table.ms-topnav td img{
     visibility:hidden;
}</pre>
<h3>Second level menu items (fly outs)</h3>
<p>The second level menu items are the sub menu items that will become visible when you hover a top navigation menu item. In the HTML, the sub menu items are positioned underneath the overall table that contains the first level menu items. The whole fly out is rendered as a &lt;div&gt;, that contains a lot of nested &lt;div&gt;&#8217;s and tables, for every sub menu item and sub sub menu item.</p>
<pre><img class="alignnone size-full wp-image-2794" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/topnav-flyoutcontainer.jpg" alt="topnav-flyoutcontainer" width="897" height="328" /></pre>
<p>Every sub menu item is rendered inside the table with class name<span style="color: #ff6600;"> .ms-topNavFlyOuts.</span> This table contains a &lt;td&gt; with the link to the concerning page. When there are sub sub menu items, there are two &lt;td&gt;&#8217;s. The first one contains the &lt;a&gt;-tag. Only when there is a third level in the menu, the second one contains the little arrow image, pointing to the right.</p>
<pre><img class="alignnone size-full wp-image-2793" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/topnav-flyout.jpg" alt="topnav-flyout" width="686" height="290" /></pre>
<pre><a rel="attachment wp-att-3134" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-2/attachment/topnav-arrow-2"><img class="alignnone size-full wp-image-3134" src="http://sharepointmagazine.net/wp-content/uploads/2009/04/topnav-arrow.jpg" alt="topnav-arrow" width="202" height="126" /></a></pre>
<p>The top navigation fly outs can be styled by referring to the &lt;td&gt;&#8217;s of the <span style="color: #ff6600;">.</span><span style="color: #ff6600;">ms-topNavFlyOuts</span> table.  The arrows are not that easy to style, because the image is not on the file system, but it is generated by code. To alter this image, you need to change a property of the AspMenu in your master page. How to do this is not discussed in these articles.</p>
<p>Reset the styling of the rollover of the menu items:</p>
<pre>.ms-topNavFlyOutsHover,
.ms-topNavFlyOutsHover a{
     background-color:#000000;
}</pre>
<p>Reset the styling of the background of the flyout items:</p>
<pre>.ms-topNavFlyOuts{
     background-color:white;
}</pre>
<p>The border that comes around the whole fly out area still has a blue border. This is set on the class name of the <span style="color: #ff6600;">.zz1_TopNavigationMenu</span>. Every fly out menu has it&#8217;s own class name, with a number. The number is variable and depends on the number of menu items on that page. You will never know which numbers will be used, since you do not know how many menu items there are. This for example will only work on one of the fly outs:</p>
<pre>.zz1_TopNavigationMenu_8 {
     background-color:#F2F3F4;
     border:1px solid #A7B4CE;
}</pre>
<p>When you look closer, you see that besides this class name, every fly out area has the same class name: <span style="color: #ff6600;">zz1_TopNavigationMenu_0</span>. So, to style the border of the fly out menu, you can change the border of this class name, like this:</p>
<pre>div.zz1_TopNavigationMenu_0{
     border:1px #000000 solid;
}</pre>
<p>Do check the fly out menu on a listpage, and double check if the list header is not visible on top of the fly out menu. This could happen when the the list header (<span style="color: #ff6600;">.ms-vh </span>or <span style="color: #ff6600;">.ms-vh2</span>) is relatively positioned. The solution for this is to make it static, it will not influence the styling of the menu.</p>
<pre>.ms-vh div,
.ms-vh2 div{
     position:static !important;
}</pre>
<pre><img class="alignnone size-full wp-image-2795" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/topnav-flyoutunder.jpg" alt="topnav-flyoutunder" width="157" height="201" /></pre>
<pre><img class="alignnone size-full wp-image-2796" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/topnav-flyoutup.jpg" alt="topnav-flyoutup" width="154" height="196" /></pre>
<h2>Quick Launch navigation</h2>
<p>The quick launch navigation is also known as the left menu. The quick launch has three parts.</p>
<p>• Quick Launch header</p>
<p>• Menu items</p>
<p>• Recycle Bin</p>
<pre><img class="alignnone size-full wp-image-2780" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ql-quicklaunch.jpg" alt="ql-quicklaunch" width="148" height="239" /></pre>
<p>The set of the three items together are rendered into two containers, the <span style="color: #ff6600;">div.ms-quickLaunchouter</span> and inside that is the <span style="color: #ff6600;">div.ms-quickLaunch</span>. Because the quick launch has two containers, it is possible to give the top of the menu another background image then the bottom, for example.</p>
<pre><img class="alignnone size-full wp-image-2781" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ql-quicklaunchouter.jpg" alt="ql-quicklaunchouter" width="338" height="133" /></pre>
<h3>Hiding the quick launch menu</h3>
<p>Some customers like the portal homepage to be without the left menu. There are several ways to do this. I&#8217;ll discuss three of them.</p>
<p>1: The first is to make a special page layout for the homepage. Make sure the control for the quick launch menu is inside the page layout and not in the master page. For that you have to edit all the other page layouts. Now make sure the left menu on the page layout you made for the homepage isn&#8217;t showed or even isn&#8217;t rendered at all, by removing the menu control. This solution will cost you the most effort and time.</p>
<p>2: The second way is to give the homepage page layout an extra reference to a style sheet. That would be a style sheet you make specially for the homepage and in where you add styles to hide the left menu.</p>
<p>3: Another solution to hide the left menu on the homepage is by adding styles that will make the menu disappear. It can be done in the style sheet, so the left menu will be hidden in every page, or it can be done by adding a Content Editor Web part on the page you wouldn&#8217;t want the left menu on.</p>
<pre><img class="size-full wp-image-2773 alignnone" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ql-cew.jpg" alt="ql-cew" width="317" height="79" /></pre>
<p>First, add a Content Editor Web part to the particular page. Open the tool pane, and add some source code that will hide the left menu:</p>
<pre>&lt;style type="text/css"&gt;
.ms-navframe{
     display:none;
}
&lt;/style&gt;</pre>
<p>This way the quick launch outer is hidden and the left area is also gone, so that the content in the middle will have more space. The <span style="color: #ff6600;">.ms-navframe</span> is responsible for the width of the area the menu is in.</p>
<pre><img class="alignnone size-full wp-image-2779" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ql-noleftmenu.jpg" alt="ql-noleftmenu" width="741" height="338" /></pre>
<p>Next thing is to make sure the web part with the styling is not visible on the front end. For that, choose Chrome type &#8220;none&#8221;, in the Appearance menu and under the layout section check the check box for hiding the web part header.  The menu (and the web part that is hiding the menu) is now hidden on only this page.</p>
<pre><img class="alignnone size-full wp-image-2774" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ql-chrome.jpg" alt="ql-chrome" width="127" height="107" /></pre>
<h3>Quick Launch header</h3>
<p>The header of the quick launch is a &lt;H3&gt; with a &lt;LABEL&gt; and a &lt;SPAN&gt;.</p>
<pre><img class="alignnone size-full wp-image-2775" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ql-header.jpg" alt="ql-header" width="431" height="531" /></pre>
<p>The label contains the text &#8220;Quick Launch&#8221;, but is invisible because it is absolute positioned and placed out of sight by the core.css. The span contains a &lt;div&gt; with class name <span style="color: #ff6600;">.</span><span style="color: #ff6600;">ms-quickLaunchheader</span>. This &lt;div&gt; has a background image and background color. There&#8217;s also font-color defined here, but the text inside this &lt;div&gt; is always a link. So if you want to style that, it&#8217;s more efficient to style the &lt;a&gt;-tag.</p>
<pre><img class="alignnone size-full wp-image-2776" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ql-headera.jpg" alt="ql-headera" width="920" height="76" /></pre>
<h3>Quick Launch menu items</h3>
<p>The second part in the quick launch is the &lt;div&gt; with ID <span style="color: #ff6600;">ctl00_PlaceHolderLeftNavBar_QuickLaunchNavigationManager</span>. Inside this is a table with class name <span style="color: #ff6600;">.ms-navSubMenu1</span>. The 1 indicates the level of the menu items, The first level menu items. For every menu item there&#8217;s a &lt;td&gt; in this table.</p>
<p>Every menu item is positioned inside it&#8217;s own table, the <span style="color: #ff6600;">.ms-navheader</span>. Only the menu items on the first level are called navheader. Besides that, the &lt;td&gt;inside the table has an &lt;a&gt;-tag containing a class name <span style="color: #ff6600;">.ms-navheader</span>. So when styling the whole area of the menu item, or just the link itself, make sure you use <span style="color: #ff6600;">table.ms-navheader</span> or <span style="color: #ff6600;">a.ms-navheader</span>.</p>
<h4>Sub menu items of the quick launch</h4>
<p>As there is a &lt;td&gt; for every first level menu item, there is also a &lt;td&gt; for a collection of second level menu items. Inside that &lt;td&gt; is another table, the <span style="color: #ff6600;">.ms-subNavMenu2 </span>and every sub menu item has it&#8217;s own &lt;td&gt; in there.</p>
<pre><img class="alignnone size-full wp-image-2785" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ql-subnavmenu.jpg" alt="ql-subnavmenu" width="441" height="542" /></pre>
<p>Changing the background of the sub menu items can be done very easily, because of the<span style="color: #ff6600;"> .ms-navSubMenu2</span> class name. By default the &lt;td&gt; of this table has the bullet background image.</p>
<pre><img class="alignnone size-full wp-image-2778" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ql-navitem.jpg" alt="ql-navitem" width="752" height="482" /></pre>
<p>Removing this bullet can be done like this:</p>
<pre>table.ms-navitem td, span.ms-navitem {
	Background-image:none;
	Padding-left:0px;
}</pre>
<p>Every sub menu item has it&#8217;s own table and only one &lt;td&gt;. Therefore it is possible to use two background images underneath the text of the &lt;a&gt;-tag of a second level menu item. One image for the left and one for the right side.</p>
<pre><img class="alignnone size-full wp-image-2786" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ql-vb.jpg" alt="ql-vb" width="189" height="346" /></pre>
<h3>Recycle bin</h3>
<p>The recycle bin is the third item inside the quick launch. This table contains another table named <span style="color: #ff6600;">.ms-recyclebin</span>. Inside this table is the &lt;a&gt;-tag, containing the icon and the text &#8220;recycle bin&#8221;.</p>
<pre><img class="size-full wp-image-2783 alignnone" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ql-recyclebinvb.jpg" alt="ql-recyclebinvb" width="116" height="23" /><img class="size-full wp-image-2784 alignnone" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ql-recyslebinvb2.jpg" alt="ql-recyslebinvb2" width="140" height="34" /></pre>
<p>It is possible to hide the trash bin icon, because it is the only image inside the &lt;a&gt;-tag. There&#8217;s no padding on the &lt;a&gt;-tag, so by removing the image like this, the &lt;a&gt;-tag should automatically align with the other menu items.</p>
<pre>.ms-recyclebin a img{
	display:none;
}</pre>
<pre><img class="alignnone size-full wp-image-2782" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/ql-recyclebin.jpg" alt="ql-recyclebin" width="743" height="336" /></pre>
<h2>Site Actions navigation</h2>
<p>If you have at least editor rights, you will find the site actions button on the right top of your screen.</p>
<pre><a rel="attachment wp-att-3128" href="http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-2/attachment/sa-siteactions-2"><img class="alignnone size-full wp-image-3128" src="http://sharepointmagazine.net/wp-content/uploads/2009/04/sa-siteactions.jpg" alt="sa-siteactions" width="106" height="20" /></a></pre>
<p>The site actions button has a few nested tables and &lt;div&gt;&#8217;s. Only a few of them have ID&#8217;s or class names. From the outside to the inside:</p>
<ol>
<li>Table.ms-siteaction</li>
<li>Td#siteactiontd.ms-siteactionsmenu</li>
<li>Div</li>
<li>Div</li>
<li>Span</li>
<li>Div  (on hover it does have a class name:  .ms-siteactionsmenuhover)</li>
<li>a</li>
</ol>
<p>The &lt;a&gt;-tag for example does have an ID, but since it is an index number that points to the number of menu items, it is not wise to use this ID, because it could change per page or after a menu item was added.</p>
<p>When changing the background image of the button, refer to <span style="color: #ff6600;">.ms-siteactionsmenu div div div</span> and <span style="color: #ff6600;">.ms-siteactionsmenu div div div.ms-siteactionsmenuhover</span>.</p>
<p>Here&#8217;s some css to clear up the button and undo it from it&#8217;s (background-)colors, so that it looks like it is a textual link:</p>
<pre>.ms-siteactionsmenu div div div,
.ms-siteactionsmenu div div div.ms-siteactionsmenuhover{
    background-color:transparent;
    background-image:none;
    background-repeat:no-repeat;
    border:0px none;
}</pre>
<h3>The secret of the little arrow</h3>
<p>What is up with the little arrow in the site actions button? As you can see in the code, there is a blank.gif, which is not the image of the arrow. And there is no background image on it whatsoever. The arrow isn&#8217;t a background image of the &lt;a&gt;-tag either. So, where does this arrow come from then? It looks like it&#8217;s the &lt;a&gt;-tag&#8217;s parent &lt;div&gt;, but that one only has a background image that is responsible for the blue background.  The answer is closer than you think, because there is an image next to the &lt;a&gt;-tag, which is called whitearrow.gif. The question I cannot answer is why it is not inside the &lt;a&gt;-tag, since it should also be click-able, right? Well, it does explains why at first sight I couldn&#8217;t find the image. Mystery solved.</p>
<pre><img class="alignnone size-full wp-image-2788" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/sa-arrow.jpg" alt="sa-arrow" width="506" height="194" /></pre>
<h3>The site actions fly outs</h3>
<p>The site action button had also a fly out menu when you have clicked on it. This menu is hidden in the span by an in-line <span style="color: #ff6600;">display:none</span>.</p>
<pre><img class="alignnone size-full wp-image-2791" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/sa-span.jpg" alt="sa-span" width="391" height="213" /></pre>
<p>This menu is a bit different from the other menu&#8217;s. It has a &lt;menu&gt;tag and a &lt;ie:menuitem&gt; for each sub menu item. These objects cannot be styled in the style sheet.</p>
<pre><img class="alignnone size-full wp-image-2789" src="http://sharepointmagazine.net/wp-content/uploads/2009/03/sa-flyout.jpg" alt="sa-flyout" width="250" height="150" /></pre>
<h1>Next time in &#8220;SharePoint&#8217;s Branding Limitations&#8221;</h1>
<p>Next part of this article will contain information about web parts with text zones, lists and tables. Other topics are the graphical possibility&#8217;s of the edit mode and the news articles. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-2/feed</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<series:name><![CDATA[Partner Spotlight: Tam Tam]]></series:name>
	</item>
		<item>
		<title>SharePoint&#8217;s Branding Limitations, Part 1</title>
		<link>http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-1</link>
		<comments>http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-1#comments</comments>
		<pubDate>Tue, 21 Jul 2009 14:40:38 +0000</pubDate>
		<dc:creator>Diantha van Marion</dc:creator>
				<category><![CDATA[Customisation]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[Design Decisions]]></category>
		<category><![CDATA[Front-end]]></category>
		<category><![CDATA[Functional Designer]]></category>
		<category><![CDATA[Graphical Design]]></category>
		<category><![CDATA[Graphical Designer]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[HTML-mark up]]></category>
		<category><![CDATA[MOSS]]></category>
		<category><![CDATA[Stylesheet]]></category>
		<category><![CDATA[Styling]]></category>

		<guid isPermaLink="false">http://sharepointmagazine.net/?p=678</guid>
		<description><![CDATA[Not all graphical designs for a portal will work in a SharePoint environment. There are a couple of limitations the Graphical Designer must know. A Graphical designer needs to know the scope of the graphical design.
This article will give the graphical designers more insight into the effect of these design decisions.]]></description>
			<content:encoded><![CDATA[<h1>Introduction</h1>
<p>As a Front-end Developer with a background in designing I&#8217;ll show you how to make a graphical design that works for a default SharePoint-environment. If you want to take control over the front-end, don&#8217;t use any themes. Create your art by using style sheets!</p>
<p>Not all graphical designs for a portal will work in a SharePoint environment. There are a couple of limitations the Graphical Designer must know. A Graphical designer needs to know the scope of the graphical design. For example, if a Graphical Designer puts a border on an element like a table, that will take him about 3 minutes to design, but this simple border could take the Front-end Developer a few hours to implement.</p>
<p>It&#8217;s really important that the Graphical Designer and the Front-end Developer work together and have a clear communication about the graphical design. Making a graphical design specifically for a MOSS environment could save you days on the implementation! This article will give the Graphical Designers more insight into the effect of these design decisions.</p>
<p>This article assumes that the reader has SharePoint and basic HTML knowledge.</p>
<h2>Process description</h2>
<h3>Communication flows</h3>
<p>The communication between the Graphical Designer and the Front-end Developer is all about the graphical design for SharePoint and the ways to implement it.  The Graphical Designer discusses the design he wants to make with the Front-end Developer to check if his design ideas are implementable on a SharePoint environment. After the Graphical Designer has a first version of the graphical design, the Front-end Developer determines if it can be implemented in the available time. If the actual costs are higher than the estimated costs, the Graphical Designer and the Front-end Developer could look for another elaboration of the customers idea, one that is easier to implement, and more predictable.</p>
<p>The communication between the Graphical Designer and the Front-end Developer will continue like this until the graphical design is approved by the customer and the implementation can start. The communication between the Graphical DesignerGraphical Designer has in mind for its design. Decisions concerning the colors, fonts, margins, menu&#8217;s and links are transferred by a style guide. However, if there&#8217;s a lack of time frequently the style guide isn&#8217;t fully developed, so the Graphical Designer needs to explain the Front-end Developer about the styling guides. Disadvantage of this is that the Front-end Developer co and the Front-end Developer will change and will all be about the transfer of knowledge about what can be implemented and what can&#8217;t. It is important that the Front-end Developer knows exactly what the uld forget information or interpret it differently than the Graphical Designer has in mind, and the Front-end Developer cannot check it in the style guide. Therefore, be sure that there is always a style guide that is as extended as possible.</p>
<p>What can happen after the graphical design is implemented is that the customer decides to change a component in the graphical design. Depending on the change, the Graphical Designer must be consulted again, or the Front-end Developer can modify it, in consultation with the Graphical Designer. The ideal situation is to adapt the style guide too.</p>
<p>The style guide is made by the Graphical Designer. Since he has made the design and knows exactly how the design should look like and elements graphically should behave. Beside the style guide the Front-end Developer also needs the design files of the Graphical Designer to be able to implement the Graphical Designer, for example the PSD files.</p>
<div id="attachment_2061" class="wp-caption alignnone" style="width: 310px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/defaulthome.jpg"><img class="size-medium wp-image-2061" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/defaulthome-300x142.jpg" alt="" width="300" height="142" /></a><p class="wp-caption-text">Image of default homepage</p></div>
<h3>Knowledge transfer</h3>
<p>The graphical design is based on the requirements of the customer and its company, depending on the browsers to use and its users, and of course the estimated capacity and the creative ideas of the Graphical Designer. Graphical Designers which design for MOSS must have knowledge of SharePoint. Most Graphical Designer&#8217;s will catch the default (blue) graphical design of a MOSS portal as a basis for the graphical design. They can take the default or frequently used elements of MOSS and use them for their graphical design. They keep the location of the elements approximately the same to what they see on the default portal, their example. This is the most common way to start a graphical design for MOSS.</p>
<p>The Graphical Designer also needs to have some knowledge about how the designed elements of the graphical design will be implemented. He needs to know how the Front-end Developer will implement a graphical design. Because the Graphical Designer does not know of every table, div and so, it is important that the Front-end Developer informs the Graphical Designer about the possibilities of implementation, however the Front-end Developer does need to have this knowledge of course. Even if the Graphical Designer used a default MOSS portal for making the graphical design, it is possible that there are elements in the graphical design that cannot be implemented on a default MOSS portal, because the default HTML won&#8217;t let you. That&#8217;s why it is very important to communicate a lot and involve the Front-end Developer at an early stage of the graphic design.</p>
<h2>Design decisions</h2>
<p>In this part I will evaluate some design decisions. I will comment on a number of standard components of a SharePoint publishing portal and indicate per component how the element&#8217; HTML has been rendered and the possibilities for implementing a design on that HTML.</p>
<h3>Scaling pages</h3>
<p>The Graphical Designer needs to know how the page will behave if the visitor of the portal gives another format to the browser window. In case of a portal the Graphical Designer will generally recommend to use the complete width of the browser window, because portals are all about displaying lots of information. It is desirable to be able to use the full width to place as much information on the page as needed/possible, and make it liquid. This is default by MOSS, when widening the browser window, the middle column will become wider and more space for content will be available. The left column with the menu will keep its width, just like the right column.</p>
<p>However it is possible that the customer chooses to let the scaling behave differently. For example by dividing the available space to the left and right column. In this case the fixed width of the right column is put on a certain percentage in the style sheet instead of a fixed number of pixels, mostly 20 or 30%. The middle column should also get a width in a certain percentage. For making another partitioning it is desirable to make a custom page layout.</p>
<div id="attachment_1173" class="wp-caption alignnone" style="width: 250px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/verdeling-31.jpg"><img class="size-medium wp-image-1173" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/verdeling-31-300x180.jpg" alt="" width="240" height="144" /></a><p class="wp-caption-text">Example of page with variable width</p></div>
<div id="attachment_1172" class="wp-caption alignnone" style="width: 250px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/verdeling-31.jpg"><img class="size-medium wp-image-1172" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/verdeling-21-300x180.jpg" alt="" width="240" height="144" /></a><p class="wp-caption-text">Example of page with variable width</p></div>
<div id="attachment_968" class="wp-caption alignnone" style="width: 250px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/verdeling-11.jpg"><img class="size-medium wp-image-968" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/verdeling-11-300x180.jpg" alt="" width="240" height="144" /></a><p class="wp-caption-text">Example of page with variable width</p></div>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/verdeling-31.jpg"></a></p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/verdeling-31.jpg"></a></p>
<h3>Header</h3>
<p>The area positioning on a page consists out of several rows. First there is the header, then a content area and then the footer. All visual elements of SharePoint are in one of those zones. The elements of the edit console are underneath the header, they will be discussed later.</p>
<p>The header itself is also built out of rows, with in every row a few SharePoint elements. In the header every row has a class name or unique ID name. The header is built with tables, and nested tables, who together are responsible for the area positioning.</p>
<h4>Global breadcrumb</h4>
<p>The global breadcrumb, which is the first row of the header, contains two tables, each with its own class name. This aligns the text to the left and the meta menu to the right. Therefore the global links on the left side and the global links on the right side can be styled and positioned differently.</p>
<div id="attachment_1179" class="wp-caption alignnone" style="width: 613px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/globalbreadcrumb.jpg"><img class="size-full wp-image-1179" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/globalbreadcrumb.jpg" alt="" width="603" height="142" /></a><p class="wp-caption-text">Global breadcrumb</p></div>
<p>The menu items of the meta menu can be styled separately. However, frequently it is desirable to style all meta menu items the same. The styling can be done by using the class name of the common parent element. This way the styling isn&#8217;t influenced by any nested tables or divs that may be in the menu table.</p>
<div id="attachment_1182" class="wp-caption alignnone" style="width: 157px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/help-icon.jpg"><img class="size-full wp-image-1182" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/help-icon.jpg" alt="" width="147" height="28" /></a><p class="wp-caption-text">Customized metamenu</p></div>
<pre>.ms-SPLink a:link,
.ms-SPLink a:visited {
                color:green;
}</pre>
<p>The icon that is used for the help function can be styled too. Just keep the width and height of the new image the same as the original, so that a replacement can be done easily. Always keep a copy of the original image, for back-up.</p>
<h4>Global title area</h4>
<p>The global title area is the second row of the header. It contains a table with three cells, the global title area image, the site title and the search function.</p>
<div id="attachment_1180" class="wp-caption alignnone" style="width: 613px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/globaltitlearea.jpg"><img class="size-full wp-image-1180" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/globaltitlearea.jpg" alt="" width="603" height="142" /></a><p class="wp-caption-text">Global title area </p></div>
<p>The global title area image can be used to display the logo, because this element has a link with a reference to home. Therefore it is important to hide the image, stretch the a-tag to the dimensions of the logo and make the logo disappear as the background image of the &lt;a&gt;-tag. Then, the text of the &lt;a&gt;-tag will be placed outside the view of the browser with a negative indent. This way the logo will still have a textual link for users that use screen readers.</p>
<div id="attachment_1181" class="wp-caption alignnone" style="width: 44px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/globaltitleareaimage.jpg"><img class="size-full wp-image-1181" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/globaltitleareaimage.jpg" alt="" width="34" height="30" /></a><p class="wp-caption-text">Global Title Area Image</p></div>
<pre>.ms-globalTitleArea {
    background:blue url(/_layouts/images/logo.gif) no-repeat left top;
}</pre>
<pre> .ms-globalTitleArea #GlobalTitleAreaImage img{
    visibility:hidden;
}</pre>
<pre>.ms-sitetitle h1 a{
    display:block;
    height:30px;
    width:100px;
    text-indent:-2000px;
}</pre>
<p>The last cell with the search functionality doesn&#8217;t have a class name or ID. To style the search function you&#8217;ll need to dig deeper into the HTML-structure. It is possible to style the search function in the header differently than the other search functions that could appear on the portal, even if they are built the same way. That&#8217;s why you&#8217;ll need to find a unique class name combination or unique ID name or a combination of both. It is possible to style the search function in the header differently, but the other search functions, in the content zone will be styled the same, since they have the same structure. Do not style the search engine absolute, since the search engine needs to come down in the content zone when searching advanced.</p>
<pre>#SRSB{
	position:relative;
	top:100px;
}</pre>
<p>The icon that is used to start the search request can also be styled. Keep the width and height of the new image the same as the original, so that a replacement can be done easily. Always keep a copy of the original image, for back-up. The easiest way to style the icon is to replace the default one on the file server. A result of this is that all search icons will change, through the whole portal. As mentioned above, it is possible to style the search icon in the header differently, but the other search icons will be styled the same, since they have the same structure.</p>
<div id="attachment_1184" class="wp-caption alignnone" style="width: 399px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/search-icon.jpg"><img class="size-full wp-image-1184" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/search-icon.jpg" alt="" width="389" height="28" /></a><p class="wp-caption-text">Customized search engine</p></div>
<h4>Banner Container</h4>
<p>The third row from above is the banner container or oneidtopnavbar container. In here is the banner frame wherein there is a section for the top navigation menu, the banner and the site actions menu.</p>
<h5>Top navigation menu</h5>
<p>The top navigation menu is built out of a table, whereof the first cell contains the first menu item and the second cell contains a set of other menu items. In each of these cells is a table with a class name that marks it as topnav and if selected, it marks it also as selected. In the first cell of this table is the a-tag, the link. If the menu item contains any child elements, there is a second cell in this table to place the little arrow pointing down. This arrow is an indicator for any child menu items available, the fly outs.</p>
<p>The &lt;td&gt;&#8217;s of this table do not have a unique class name combination or ID. This means the &lt;td&gt; of the text link cannot be styled differently than the &lt;td&gt; of the arrow. This could lead to difficulties when implementing background images on the menu items. A background image cannot be placed on the &lt;td&gt;, because this will cause it to disappear twice. Once for the text link &lt;td&gt; and once for the arrow td. The image must be placed as a background image on the table. This means the image will be visible underneath the text link all the way to the arrow on the right. So there can only be one background image on a menu item. It isn&#8217;t possible to use two images, like when the left side of the menu item has a different ending as the right side of the menu item, when the image isn&#8217;t repeatable on the x axis. It isn&#8217;t possible to make two images out of one, so make it a background image of the table. It is always unsure how wide the menu item will be, and so how wide the background image must be. The arrow is rendered by the code, so you cannot style the arrow or replace it with an image, though.</p>
<p>It is possible to give the first menu item a different styling then the others, because this menu item is considered as the top level menu item and is rendered a bit different then the other menu items. For this menu item also counts that you do not know how wide the menu item will be, so be cautious about it when making the graphical design.</p>
<p>If you need to use background images on the top navigation menu, use images that are repeatable on the x axis and have the same pattern at the outer left pixels and at the outer right pixels. This of course also counts for the hover states and active states of the menu items.</p>
<p>Next thing to style are the fly outs. These child menu items are inside a table, and there is one table, &lt;tr&gt; and &lt;td&gt; for every child menu item. Only the table has a class name, so all the &lt;td&gt;&#8217;s, that is all the child menu items will have the same styling. The menu item that has a mouse hover can be styled differently though. For the fly outs there is the same rule, you do not know how wide the content inside it will become. Use that information wisely when making the graphical design. You can use these class names to style the fly outs:</p>
<pre>.ms-topNavFlyOutsContainer{}
.ms-topNavFlyOuts{}
.ms-topNavFlyOuts a{}
.ms-topNavFlyOutsHover{}
.ms-topNavFlyOutsHover a{}
.zz1_TopNavigationMenu_8 {}</pre>
<h5>Banner</h5>
<p>The banner &lt;td&gt; is empty, and does not contain anything. Therefore, it will not be discussed here.</p>
<h5>Site actions menu</h5>
<p>The cell that contains the site action button has a table with a class name for its own. Inside that, there is one cell wherein there are different kinds of nested &lt;div&gt;&#8217;s. The a-tag inside does not have a class name or ID, just like the nested &lt;div&gt;&#8217;s. But it could be referenced using this declaration:</p>
<div id="attachment_2041" class="wp-caption alignnone" style="width: 104px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/siteactions.jpg"><img class="size-full wp-image-2041" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/siteactions.jpg" alt="Default siteactions button" width="94" height="22" /></a><p class="wp-caption-text">Default siteactions button</p></div>
<pre>.ms-siteactionsmenu div div div a {...}</pre>
<p>The site action button usually isn&#8217;t restyled, but only made blank, by removing its colors and background image. Most of the time it is repositioned by giving the table a relative or absolute position. This button is only visible for users with editor rights, so only a select group of users will see the site actions button.</p>
<div id="attachment_2040" class="wp-caption alignnone" style="width: 104px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/siteactions1.jpg"><img class="size-full wp-image-2040" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/siteactions1.jpg" alt="" width="94" height="30" /></a><p class="wp-caption-text">Customized site actions button</p></div>
<pre>.ms-siteactionsmenu div div div,
.ms-siteactionsmenu div div div.ms-siteactionsmenuhover{
    background-color:transparent;
    background-image:none;
    background-repeat:no-repeat;
    border:0px none;
}</pre>
<p>The fly out of the site actions button is a default SharePoint fly out, and usually isn&#8217;t styled. This fly out is reused throughout the whole portal, so styling it could give some unwanted results. In the next part, I&#8217;ll tell more about the menu&#8217;s and fly outs.</p>
<h3>Web part zones</h3>
<p>Underneath the header is the content part. In here are the left menu and the content container. The number of web part zones in the content container depends on which <span class="__mozilla-findbar-search" style="inherit;">page layout</span> is chosen when creating the page. Most of the <span class="__mozilla-findbar-search" style="inherit;">page layout</span>s contain two columns, a wide one in the middle and a smaller one on the right. Other <span class="__mozilla-findbar-search" style="inherit;">page layout</span>s do not contain a left or right column, just one big zone for the content.</p>
<h4>Page layout</h4>
<p>The partitioning of the web part zones depends on the <span class="__mozilla-findbar-search" style="inherit;">page layout</span> that is chosen. There are a few default <span class="__mozilla-findbar-search" style="inherit;">page layout</span>s in SharePoint, but these can easily be made custom.</p>
<p>Not all the default <span class="__mozilla-findbar-search" style="inherit;">page  layout</span>s have got a left and right separation; some <span class="__mozilla-findbar-search" style="inherit;">page layout</span>s use the whole width to show the content. The <span class="__mozilla-findbar-search" style="inherit;">page layout</span>s that do have a partitioning, not always do have a class name or ID on the &lt;td&gt; that separates the zones. The page is then partitioned by a table with two or more columns, were for example the first cell has a hard coded width of 70% and the second cell a hard coded width of 30%. If the cells do not contain a class name or ID, you cannot overrule the width and it makes it impossible to style them separately or give them another width.</p>
<div id="attachment_2048" class="wp-caption alignnone" style="width: 510px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/variable_width.jpg"><img class="size-full wp-image-2048" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/variable_width.jpg" alt="" width="500" height="338" /></a><p class="wp-caption-text">Example of page layout with variable widths</p></div>
<p>Since these class names and ID&#8217;s are the hand dishes for the styling, it makes it difficult to style a particular column or web part zone. Not only the width but also the other styling like headers, links and content could need to be styled differently, dependent on which column or zone they are in. Creating a custom page layout has the advantage that you can style the columns or web part zones differently.</p>
<h4>Web part zone</h4>
<p>Except the fact that a columns separation can be made easily when creating custom <span class="__mozilla-findbar-search" style="inherit;">page layout</span>s, web part zones can be added if wished. It is possible to provide every web part zone width a class name or ID, which means that the web parts can be styled differently depending on the web part zone they are in. If web parts are dragged to another web part zone, they will adjust to the styling of that particular web part zone.</p>
<div id="attachment_2051" class="wp-caption alignnone" style="width: 280px"><img class="size-medium wp-image-2051" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/top-bottom-separation-300x227.jpg" alt="" width="270" height="204" /><p class="wp-caption-text">Two column page with two web part zones in the right zone</p></div>
<p>This cannot be done with SharePoint&#8217;s default page layouts. So if there&#8217;s no budget for creating page layouts, the Graphical Designer should take notice of that and style all the web parts the same. By default there&#8217;s no way to separate styling for particular web parts or web parts in particular columns.</p>
<div id="attachment_2049" class="wp-caption alignnone" style="width: 280px"><img class="size-medium wp-image-2049" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/tp-300x213.jpg" alt="" width="270" height="192" /><p class="wp-caption-text">Two column page with one web part zone in the right zone</p></div>
<h3>Footer</h3>
<p>The content container contains the columns with web part zones and the menu and is as wide as the whole page. Underneath this container is the footer. By default, SharePoint does not have a real footer. Actually there are a few table cells, which make the optical margin, just like the left and right margin of the page. These cells can be used to create a footer.</p>
<h4>Position of the footer</h4>
<p>The lower down cells of the page, the footer, always are down under on the page. Even if the page does not contain a lot of content and the content does not fill the page, the footer is always at the bottom of the page, against your browser window. It speaks for itself that the footer is also on the bottom of the page when there is a lot of content and the used needs to scroll.</p>
<div id="attachment_2052" class="wp-caption alignnone" style="width: 218px"><img class="size-medium wp-image-2052" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/low-footer-300x150.jpg" alt="" width="208" height="104" /><p class="wp-caption-text">The footer sticks to the browser</p></div>
<p>The footer is built like this:</p>
<div id="attachment_2056" class="wp-caption alignnone" style="width: 510px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/pagebottommarginleft.jpg"><img class="size-full wp-image-2056" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/pagebottommarginleft.jpg" alt="" width="500" height="149" /></a><p class="wp-caption-text">Page Bottom Margin Left</p></div>
<div id="attachment_2055" class="wp-caption alignnone" style="width: 510px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/pagebottommargin.jpg"><img class="size-full wp-image-2055" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/pagebottommargin.jpg" alt="" width="500" height="149" /></a><p class="wp-caption-text">Page Bottom margin</p></div>
<div id="attachment_2054" class="wp-caption alignnone" style="width: 510px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/bodyareapagemargin.jpg"><img class="size-full wp-image-2054" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/bodyareapagemargin.jpg" alt="" width="500" height="149" /></a><p class="wp-caption-text">Body Area Page Margin</p></div>
<div id="attachment_2057" class="wp-caption alignnone" style="width: 510px"><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/pagebottommarginright.jpg"><img class="size-full wp-image-2057" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/pagebottommarginright.jpg" alt="" width="500" height="149" /></a><p class="wp-caption-text">Page Bottom Margin Right</p></div>
<p>When you remove the background color and image of these cells, you&#8217;ll keep an empty space, which is a nice margin for the bottom of the page. It is also possible to use these cells for a footer image.</p>
<div id="attachment_2059" class="wp-caption alignnone" style="width: 510px"><img class="size-full wp-image-2059" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/footer-with-code.jpg" alt="" width="500" height="251" /><p class="wp-caption-text">Example of footer with rounded corners</p></div>
<p>Since every cell has its own class name, it is possible to make a colored bar for example with small rounded corners. Such a footer can be placed underneath the menu and content, or just underneath the content. The width of the image depends on the cells you use to display the image in, as a background image. The height of the footer is also adjustable. To place text in the footer, the master page must be edited. Making the master page custom allows you to make the custom footer instead of using the default margin cells at the bottom of the page.</p>
<h1><strong>Next time in &#8220;SharePoint&#8217;s Branding Limitations&#8221;</strong></h1>
<p>Part two of this article will contain information about the menus. The meta menu and the top navigation with fly outs in the header and the quick launch menu and site actions menu. What are the possibilities for styling this menu&#8217;s? And how is it implemented? Stay tuned!</p>
<p>This post is from the SharePoint Magazine <a href="http://sharepointmagazine.net/announcements/sharepoint-magazine-partner-spotlight">Partner Spotlight</a> Week, where our featued partner is <a href="http://sharepointmagazine.net/companies/partner-spotlight-tam-tam">Tam Tam</a></p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointmagazine.net/technical/development/sharepoints-branding-limitations-part-1/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<series:name><![CDATA[Partner Spotlight: Tam Tam]]></series:name>
	</item>
		<item>
		<title>Everything You Need to Know about BDC: Part 5 of 8</title>
		<link>http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-5-of-8</link>
		<comments>http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-5-of-8#comments</comments>
		<pubDate>Tue, 03 Mar 2009 06:00:56 +0000</pubDate>
		<dc:creator>Wen He</dc:creator>
				<category><![CDATA[Administration]]></category>
		<category><![CDATA[Customisation]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[adf]]></category>
		<category><![CDATA[Application Definition]]></category>
		<category><![CDATA[BDC]]></category>
		<category><![CDATA[Business Data]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[Enterprise Search]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[Search Center]]></category>
		<category><![CDATA[User Experience]]></category>

		<guid isPermaLink="false">http://sharepointmagazine.net/?p=2512</guid>
		<description><![CDATA[In this article, we will be focusing on BDC Search. Specifically we’ll be focusing on how to enable BDC Search, how to enable full and incremental crawls of BDC data sources, and how to create a search content source and search scopes. ]]></description>
			<content:encoded><![CDATA[<p><span>Welcome back to Part 5 of our 8 Business Data Catalog (BDC) series. In this article, we will be focusing on BDC Search. </span><span>Specifically we’ll be focusing on how to enable BDC Search, how to enable full and incremental crawls of BDC data sources, and </span><span>how to create a search content source and search scopes. We’ll then walk you through how to make our customer </span><span>data searchable and how to make the search results &#8220;actionable&#8221;.</span></p>
<p><span>If you’ve been following our BDC series, we’ve previously gone through the following topics:</span></p>
<ol>
<li><span><span><span><span><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-1-of-8">Part 1</a></span></span></span>, BDC Technical Architecture</span></li>
<li><span><span><span><span><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-2-of-8">Part 2</a></span></span></span>, Application Definition File (ADF) and its Development</span></li>
<li><span><span><span><span><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-3-of-8">Part 3</a></span></span></span>, Developing an ADF to Connect to Web Services</span></li>
<li><span><span><span><span><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-4-of-8">Part 4</a></span></span></span>, Using BDC Web Parts to Consume BDC Data</span> and Embedding BDC Data in Lists</li>
</ol>
<div><span>Now consider the following scenarios:</span></div>
<ul>
<li>How can I find the customer information for Great Lake Good Market in CRM?</li>
<li>How can I find the projects and resources details in Project Server 2007?</li>
<li>How can I find an employee&#8217;s legal name in HR system?</li>
</ul>
<p>With the help of the BDC Search, these all become possible. The Enterprise Search in MOSS can gather, index, and offer full-text search on all business data (entity instances) from applications registered in the BDC. Not only does it enable us to find answers in MOSS, but also it allows us to do so without having to leave SharePoint to go to these systems individually.  It makes integrating search into existing line of business (LOB) applications like a CRM solution easier.</p>
<p>For example, if we register the <strong>Northwind</strong> sample database in the BDC, Enterprise Search can crawl it and return customer data in search results. In addition, the Enterprise Search feature’s extensibility enables us to create customized search experiences. We can create a custom search tab in the Search Center where our users can search for customers in the database, and we can also create a custom UI for the search results based on which we can also take action.  So let&#8217;s dive right into it.</p>
<h3>BDC Search Overview</h3>
<p>As we&#8217;ve covered in prior articles, surfacing the BDC data to SharePoint using BDC Web Parts and lists is just first part of the BDC saga, it can also enable you to index and search on the BDC data. The following figure is an example of searching for information about a customer and then displaying both structured data from the database and unstructured documents and content stored within SharePoint.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image23.png"><img style="0px" src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb23.png" border="0" alt="image" width="644" height="370" /></a><br />
<strong>Figure 1:  Enterprise Search with BDC</strong></p>
<p>Here&#8217;s another example of leveraging BDC to index Project Server data and enable us to search the different objects (projects, tasks, resources, custom fields, lookup tables, and so on).  This is of great value because out of the box the Project Server data is not indexed. Only the objects in project workspace are indexed such as Issues, Risks, Documents, etc. For instance, if we are looking for project detail information for the Enterprise resource planning (ERP) project, we can search our Project Server and find the answers as shown in <strong>Figure 2</strong>:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image22.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb22.png" border="0" alt="image" width="644" height="402" /></a><br />
<strong>Figure 2: Search Project Server with BDC</strong></p>
<p>The BDC is truly a catalog of business applications that helps bridge the gap between MOSS and business applications by bringing in key data from various applications to SharePoint sites, lists, searches, and user profiles.  Let&#8217;s revisit the BDC architecture from <span><span><span><span><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-1-of-8">Part 1</a></span></span></span></span> with <strong>both XML</strong> <strong>Metadata</strong> and <strong>Search</strong> components highlighted in <strong>Figure 3</strong>.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image87.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb86.png" border="0" alt="image" width="644" height="450" /></a><br />
<strong>Figure 3:  BDC architecture with emphasis on the Search</strong></p>
<p>Firstly, we&#8217;ve highlighted the XML Metadata because it is the key element in the Application Definition that makes the BDC Search possible. BDC operates off of an XML-based Application Definition File (ADF). The metadata in ADF enables MOSS to crawl the BDC data source and add them to the search index.</p>
<p>Secondly, we highlight the Search component because the search engine uses a protocol handler to crawl and a security trimmer to filter results. BDC uses these just like third party implementations when supporting BDC searching.</p>
<p>BDC Search enables us to quickly find content in business data through search queries. It also integrates with search scopes and search center to become an integral part of MOSS Enterprise Search. Here I&#8217;ve created a custom search tab and a search scope for the BDC data to create a unique search experience in which the BDC search results are segregated from the rest of SharePoint search results. See <strong>Figure 4</strong>.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image88.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb87.png" border="0" alt="image" width="644" height="454" /></a><br />
<strong>Figure 4: Customized BDC Search Experience in Search Center</strong></p>
<p>By enabling the search of BDC data, BDC Search extends the SharePoint search capabilities. This extends the reach of the back-end LOB systems.  Today most LOB systems don’t have Full-Text search capability and BDC Search can serve for that purpose.</p>
<p>However, out of the box the BDC Search does not support indexing unstructured data like documents in a document management system. This is because the protocol handler for BDC is meant to connect to external structured data only. With custom protocol handlers, it&#8217;s possible to make MOSS index unstructured data . For example, using Web services to directly support BDC we can enable SharePoint to search, list, and retrieve documents from an external document management system via Web services.</p>
<p>Now let&#8217;s look into how to enable BDC Search.</p>
<h3>Enabling BDC Search</h3>
<p>One might think once we import an ADF, we can start to search.  BDC Search doesn&#8217;t come automatically, and we must enable it.  To enable BDC Search, we must first make sure these two methods exist in the ADF for the entity you want to crawl:</p>
<ol>
<li>SpecificFinder</li>
<li>IdEnumerator</li>
</ol>
<p>These are the only required metadata for Enterprise Search to use BDC to index the business application&#8217;s data.</p>
<p>In <span><span><span><span><a href="http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-2-of-8">Part 2</a></span></span></span>,</span> we’ve covered the ADF and its vocabulary: System (data source), Entity (table), Method (operation on entity), and Association (relationship). There are three primary types of methods: Finder, SpecificFinder and IdEnumerator. An IdEnumerator method returns a searchable list of unique IDs for an entity. This list enables indexing of the entities and SpecificFinder is then used to find details for the entity instance based on the specific ID. Therefore, IdEnumerator and SpecificFinder work together to enable Enterprise Search to use BDC to crawl the business data.</p>
<p>Now since we have a good understanding of what it takes, let&#8217;s put it in action. We&#8217;re going to use <a href="http://msdn.microsoft.com/en-us/library/bb736296.aspx"><strong>Business Data Catalog Definition Editor</strong></a>, a free tool from the <a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=6D94E307-67D9-41AC-B2D6-0074D6286FA9&amp;displaylang=en"><strong>MOSS SDK</strong></a>, to create our ADF (shown in <strong>Figure 5</strong> below). Though one of the limitations of this tool is that it doesn&#8217;t create a <strong>Finder</strong> method, BDC Search doesn&#8217;t need use this anyway, so it works very well for creating an ADF that&#8217;s just used for searching. You can learn how to use this tool <a href="http://msdn.microsoft.com/en-us/library/bb736296.aspx">here</a>.</p>
<p><span><span><span><span><span><span><span><span><span>Incidentally, both <a href="http://www.simego.net/MOSS_BDC_Design_Studio.aspx">MOSS BDC Design Studio</a> and <a href="http://www.lightningtools.com/bdc-meta-man/default.aspx">BDCMetaMan</a> will create these methods necessary to implement BDC searching.</span></span></span></span></span></span></span></span></span></p>
<p>We begin by adding a LOB system for our sample database, a modified version of <strong>Northwind</strong> database. We&#8217;re going to use the <strong>Customers</strong> entity that resembles one in a CRM system (or the like).</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image89.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb88.png" border="0" alt="image" width="644" height="380" /></a><br />
<strong>Figure 5: </strong><strong>Create Application Definition</strong></p>
<p>To index and search for Customers entity in the database, we&#8217;re performing the following tasks:</p>
<ol>
<li>Define an IdEnumerator method in the BDC definition (<strong>Figure 6</strong>)</li>
<li>Define a SpecificFinder method in the BDC definition (<strong>Figure 7</strong>)</li>
</ol>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image90.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb89.png" border="0" alt="image" width="644" height="138" /></a><br />
<strong>Figure 6: Define a special type of MethodInstance method IdEnumerator</strong>.</p>
<p>The <strong>IdEnumerator </strong>method returns a list of CustomerID records, which will be indexed by MOSS Search. So now we know that the sole purpose of <strong>IdEnumerator </strong>here is to enable Search.  Here&#8217;s the SQL query:</p>
<div><span style="Courier New;">Select CustomerID from Customers</span></div>
<div><span><br />
</span></div>
<div><span> <a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image91.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb90.png" border="0" alt="image" width="644" height="218" /></a><br />
</span><strong>Figure 7: Define a SpecificFinder</strong></div>
<div>
<p>The <strong>SpecificFinder</strong> method then uses the CustomerID returned from above IdEnumerator method as a parameter (<strong><span class="kwrd">where</span> CustomerID=@CustomerID</strong>) to retrieve the fields for this particular customer. This is how the BDC search is able to search the entire Customers entity. So to make a field searchable, we just include it in the query and return as type <strong>string</strong>.  Here&#8217;s the SQL Query:</p>
<p><span style="x-small;">Select CustomerID,CompanyName,ContactName,ContactTitle,Address,City,Region,PostalCode,Country,Phone,Fax<br />
</span><span style="x-small;">from Customers<br />
</span><span style="x-small;">where customerID=@CustomerID</span></p>
<h3>Import Application Definition</h3>
<p>Now we have our required metadata well-defined in the ADF, we are ready to export the XML metadata to an ADF file and then import it to MOSS.  Once we have it imported, we can confirm that our Customers entity implements the two methods in SSP Administration page by viewing application and then entity. The Crawlable property under Entity Information means our Customers entity is available to be crawled, as shown in <strong>Figure 8</strong>.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image92.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb91.png" border="0" alt="image" width="644" height="209" /></a><br />
<strong>Figure 8: View Entity Information in SSP</strong></p>
<p>So far we have started from creating the ADF to importing it to enable searching. Since we can enable searching on any entity that has an IdEnumerator and SpecificFinder defined, we don&#8217;t have to start from scratch to set this up specifically for search.  We can just go straight to configuring the Enterprise Search.</p>
<h3>Configuring the Enterprise Search</h3>
<p>Configuring the Enterprise Search consists of the following steps:</p>
<ol>
<li>Create a content source</li>
<li>Perform a full crawl</li>
<li>Create a search scope (optional)</li>
<li>Add scope rule (optional)</li>
</ol>
<p>We start by creating a content source for our BDC application and performing a full crawl, then optionally create a search scope and scope rule.  These steps are very straight forward so I will focus on the main points. If you&#8217;re interested in each and every detail, check out the <a href="http://sharepointmagazine.net/technical/customisation/customizing-search-series-new-content-and-scope-from-a-bdc-application">Customizing Search Series</a> by Steve Mann.</p>
<p><strong>Step 1: Create a content source (Figure 9)</strong></p>
<p>In order to create a content source, go to SSP Administration page –&gt; Search Settings under Search section, and click on &#8220;Content Sources and Crawl Schedules&#8221;. Click on &#8220;New Content Source&#8221; and give a name for this content source; specify &#8220;Business Data&#8221; as the type of the content to be crawled. Additionally, if we wish to index the content at regular intervals we could create a Crawl schedule that defines our full crawl schedules. Here is how my screen looks:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image93.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb92.png" border="0" alt="image" width="308" height="484" /></a><br />
<strong>Figure 9: Create a content source</strong></p>
<p><strong>Step 2: Perform a full crawl (Figure 10)</strong></p>
<p>In the above step, since I&#8217;ve checked the Start full crawl of this content source, it will initiate a full crawl of the new content source, and we should now see the content source crawling as shown below:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image94.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb93.png" border="0" alt="image" width="563" height="197" /></a><br />
<strong>Figure 10: Perform a full crawl</strong></p>
<p>We can also check the crawl log to make sure that the BDC data has been indexed correctly. At this point, we should be able to search our customers table. If we search for &#8220;great lakes&#8221;, we get search results as shown in <strong>Figure 1 </strong>above.</p>
<p>As we can see, both documents and BDC Search Results are listed together. This demonstrates some of the real power behind Enterprise Search. That is, we’re seeing SharePoint content side by side with external BDC content. This is great especially when we intend to search everything including both documents and BDC sources.</p>
<p>Another real power of Enterprise Search is its extensibility. We can create customized search experiences by creating a custom search tab in the Search Center where our users can search for customers in the database, and we can create a custom UI for the search results. This is what we’re going to do to separate the BDC Search results from other content. We can achieve this by performing the following two additional steps: 1) creating a search scope for BDC and 2) adding a scope rule.</p>
<p><strong>Step 3: Create a search scope (Figure 11)</strong></p>
<p>In order to create a search scope, go to the SSP Administration page, under Search section, click on Search settings. In the &#8220;Scopes&#8221; area, click on &#8220;View Scopes&#8221;.  Click on &#8220;New Scope&#8221;, give it a name.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image95.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb94.png" border="0" alt="image" width="644" height="302" /></a><br />
<strong>Figure 11: Create a search scope</strong></p>
<p><strong>Step 4: Add scope rule </strong></p>
<p>Click on &#8220;Add Rules&#8221; where it says &#8220;Empty &#8211; Add Rules&#8221; on the newly added scope (<strong>Figure 12</strong>).</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image96.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb95.png" border="0" alt="image" width="644" height="276" /></a><br />
<strong>Figure 12: Add scope rule</strong></p>
<p>Specify a Content Source as shown below (<strong>Figure 13</strong>):</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image97.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb96.png" border="0" alt="image" width="644" height="233" /></a><br />
<strong>Figure 13: Add scope rule &#8211; specifying a content source</strong></p>
<p>Our BDC Search scope has been created and is now available in the search drop-down as shown in <strong>Figure 14</strong>. If we now search for &#8220;great lakes&#8221;, we get search results back from the existing database as shown in <strong>Figure 4 </strong>above.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image98.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb97.png" border="0" alt="image" width="644" height="137" /></a><br />
<strong>Figure 14: BDC Search scope is available for use</strong></p>
<p>As you have seen, the last two steps, even though optional, do give us additional value.  That is, to segregate the BDC search results from the rest of SharePoint search results so that we can focus on just business data. Thus better search relevance is accomplished through the extensibility!</p>
<h3>BDC Search Access Permission</h3>
<p>It is a good time for us to know how to configure BDC Search access permission so that it will work out-of-the-gate. Often times we forget about it or ignore it, and only when the crawling fails or when the search returns no results, do we go in and dig the logs, even though it is not a bad troubleshooting methodology.</p>
<p>In these examples, we’ve been using &#8220;PassThrough&#8221; authentication in the ADF. That means additional settings have to be configured so that the &#8220;Default Content Access Account&#8221; (the account used to crawl) has access to the database. Also the “Default Content Access Account” must have appropriate rights to the BDC application and entity.</p>
<p>We’ll achieve that in the following steps:</p>
<ol>
<li>Create a new Active Directory account for BDC search. We’ll call ours MOSS.Search.</li>
<li>Change the default content access account to that account in search settings (<strong>Figure 15</strong>).</li>
<li>Change search crawler account to that account under Operations –&gt; Services –&gt; Office SharePoint Server Search.</li>
<li>Grant this account db_datareader access to the database in SQL Server.</li>
<li>Grant this account Execute, Selectable in clients in Manage permissions for the ADF (<strong>Figure 16</strong>).</li>
</ol>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image100.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb99.png" border="0" alt="image" width="644" height="344" /></a><br />
<strong>Figure 15:  Specify the Default Content Access Account</strong></p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image101.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb100.png" border="0" alt="image" width="644" height="208" /></a><br />
<strong>Figure 16:  Grant Execute, Selectable permissions</strong></p>
<p><strong>Note:</strong> there might be a delay of a few minutes after the permission is changed on BDC application. You may delete and re-import the BDC application definition at when needed &#8212; no need to re-crawl as long as the BDC name is not changed.</p>
<h3>Enabling Incremental Crawling</h3>
<p>Next, we’re going to show you how create an enhancement to our ADF to support incremental crawling through the use of the __BdcLastModifiedTimestamp entity property.</p>
<p>To optimize search performance, it’s important to have incremental crawl. As you may know, Incremental Crawl is a process of crawling only new or changed content from the previous full or incremental crawl. This means that we have to let BDC know what has changed since its last crawl.</p>
<p>To ensure that incremental crawls can be performed in the database when indexing, we’ll need to enhance the IdEnumerator method that has a return field that represents the last update time for that particular row. The Type attribute of the __BdcLastModifiedTimestamp property must be System.String and its value must be set to the value of the Name attribute of the TypeDescriptor for the field returned by the IDEnumerator method that contains the last modified date and time of the entity instance. This is illustrated below.</p>
<p>In our Customers table, we start by adding a column called LastUpdated of data type DateTime to indicate the last modified time of a single row. SharePoint indexing service will use that as a time stamp and incremental crawling is enabled. SQL-knowledgeable people should not confuse this with a timestamp data type. The example we are walking through is specific to SQL Server, but the concept will apply to other databases or Web Service methods.</p>
<p>Here are the specific steps to enable incremental crawling:</p>
<ol>
<li>Update the database table to add a LastUpdated column of datetime data type (<strong>Figure 16</strong>).</li>
<li>Ensure the value of LastUpdated column is set to the current date and time when the row changes. (This can be accomplished with an Update trigger.)</li>
<li>Update ADF to have the __BdcLastModifiedTimestamp property of the entity set to LastUpdated (<strong>Figure 17).</strong></li>
<li>Update ADF to have IdEnumerator mothod return LastUpdated field (<strong>Figure 18</strong>).</li>
<li>Update ADF to have a TypeDescriptor with its TypeName attribute set to System.DateTime (<strong>Figure 19</strong>).</li>
</ol>
<p>The following figures are the screens for performing the above tasks:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb.png" border="0" alt="image" width="228" height="244" /></a><br />
<strong>Figure 16: Create a LastUpdated column of datetime type in SQL Server</strong></p>
<p><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image102.png" alt="" /><br />
<strong>Figure 17: Add the __BdcLastModifiedTimestamp property</strong></p>
<p><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image103.png" alt="" /><br />
<strong>Figure 18: Have IdEnumerator method return LastUpdated field</strong></p>
<p><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image104.png" alt="" /><br />
<strong>Figure 19: Add a TypeDescriptor with its TypeName attribute set to System.DateTime</strong></p>
<p>To compare the performance, I then performed an incremental crawl.  This is shown in <strong>Figure 20</strong> below.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image105.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb104.png" border="0" alt="image" width="644" height="249" /></a><br />
<strong>Figure 20: Comparison between the incremental crawling and the full crawling.</strong></p>
<p>In our sample, it took significantly less time in the incremental crawling than the full crawl (35 seconds vs. 54 seconds).  Depending on the size of the database and the number of changes that need to be processed with each crawl, the difference in crawl times will vary. The key of enabling incremental crawl here is performance so that the back-end systems are not unnecessarily burdened by the crawling.</p>
<h3>Actions</h3>
<p>Lastly, let’s show you how we can make our BDC search results &#8220;actionable&#8221; by creating a custom action on the Customers entity. There are two ways to create a custom action. It can be defined either in the ADF or added after the ADF is imported by going to SSP administration page (View Application –&gt; View Entity).</p>
<p>By default through the <strong>SpecificFinder</strong> method, we get a default view Profile action that links to a simple page with your search results. This is where the customization comes in, and you could create custom Web Parts to provide more user-friendly and richer user experience. We’ll dedicate Part 8 of this series to Custom Actions so you have the best for last. For this article, let&#8217;s quickly create a custom action to map the customer using Live Search Maps (maps.Live.com).</p>
<p>Here are the specific steps to enable custom action with Live Search Maps:</p>
<ol>
<li>Add Action and set parameters (<strong>Figure 21)</strong></li>
<li>Check action<strong> (Figure 22</strong>)</li>
</ol>
<p>Go to SSP administration page (View Application –&gt; View Entity), add action and configure URL parameters.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image106.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb105.png" border="0" alt="image" width="518" height="484" /></a><br />
<strong>Figure 21:  Create a custom action in SSP</strong></p>
<p>The parameter &#8220;Address&#8221; will be substituted at index &#8220;0&#8243;, which is specified as a querystring URL to maps.live.com. If you have already deployed your ADF before creating a custom action, you will need to redeploy it if you use this approach to adding a custom action.</p>
<p>Check the custom action to ensure it&#8217;s configured and ready for use <strong>(Figure 22</strong>).</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image107.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb106.png" border="0" alt="image" width="644" height="125" /></a><br />
<strong>Figure 22: Live Map Action appears under Actions</strong></p>
<p>Now let&#8217;s test-drive our search and custom action in the following two steps:</p>
<ol>
<li>Search any customer in the Search Center (<strong>Figure 23</strong>)</li>
<li>Perform the custom action based on the search result (<strong>Figure 24</strong>)</li>
</ol>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2009/01/image2.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2009/01/image-thumb2.png" border="0" alt="image" width="644" height="217" /></a><br />
<strong>Figure 23: Search result of a customer entity</strong></p>
<p>Clicking on &#8220;The Big Cheese<strong>&#8220;</strong> will take us to the default profile page, where we can see and act upon the custom action <strong>Live Map (maps.live.com)</strong> as shown below. Clicking on <strong>Live Map</strong> will issue a search on maps.live.com using the address of &#8220;The Big Cheese&#8221;. Here&#8217;s the live map (<strong>Figure 26</strong>). Neat!</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image108.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb107.png" border="0" alt="image" width="240" height="322" /></a><br />
<strong>Figure 24: BDC Search Results with Live Map action available</strong></p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/image109.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/12/image-thumb108.png" border="0" alt="image" width="644" height="439" /></a><br />
<strong>Figure 25:  Live Map of the searched customer</strong></p>
<h3>Conclusion</h3>
<p><span style="x-small;">In this article we have covered the concepts behind BDC search and how to enable it. We&#8217;ve then walked you through how to make our Customer data searchable, and how to make a custom action on search results. In doing so, we&#8217;ve demonstrated the power behind BDC and MOSS Enterprise Search. Even though we have only used a database in our example, this is also all possible with Web Services, provided the SpecificFinder and IdEnumerator methods are still in place. Hope you have enjoyed reading it as much as I have enjoyed writing it. Look forward to your comments and suggestions.  Aloha!</span></div>
]]></content:encoded>
			<wfw:commentRss>http://sharepointmagazine.net/technical/administration/everything-you-need-to-know-about-bdc-part-5-of-8/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Incorporating a Master Page into a SharePoint site definition</title>
		<link>http://sharepointmagazine.net/technical/development/incorporating-a-master-page-into-a-sharepoint-site-definition-master-pages-and-sharepoint-part-6-of-6</link>
		<comments>http://sharepointmagazine.net/technical/development/incorporating-a-master-page-into-a-sharepoint-site-definition-master-pages-and-sharepoint-part-6-of-6#comments</comments>
		<pubDate>Mon, 08 Dec 2008 14:35:37 +0000</pubDate>
		<dc:creator>ggalipeau</dc:creator>
				<category><![CDATA[Customisation]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Branding]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[experiance]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[master]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[User]]></category>

		<guid isPermaLink="false">http://sharepointmagazine.net/?p=1999</guid>
		<description><![CDATA[Learn how to incorporate a master page into the SharePoint site definition. Also learn how to utilize tools such as WSPBuilder to deploy your SharePoint code through Visual Studio extensions.]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>This is the sixth article in a six-part series on ASP.NET Master Pages and SharePoint.</p>
<ol>
<li><a href="http://sharepointmagazine.net/technical/development/introduction-to-master-pages">Introduction to Master Pages.</a></li>
<li><a href="http://sharepointmagazine.net/technical/development/examining-the-out-of-the-box-master-pages-in-sharepoint">Examining the out of the box Master Pages in SharePoint.</a></li>
<li><a href="http://sharepointmagazine.net/technical/customisation/developing-a-custom-master-page-master-pages-and-sharepoint-part-3-of-6">Developing a custom Master Page for SharePoint.</a></li>
<li><a href="http://sharepointmagazine.net/technical/development/deploying-the-master-page">Deploy a Master Page for a production ready system.</a></li>
<li><a href="http://sharepointmagazine.net/technical/development/customizing-application-master-pages-masterpages-and-sharepoint-part-5-of-6">Customizing the Application.master Page.</a></li>
<li><strong>Incorporating a Master Page into a SharePoint site definition</strong></li>
</ol>
<p>In the previous article of this series we discussed how to build a customized master page and deploy it with a feature. However, the manual process of deploying the feature to each server in the farm and activating it isn&#8217;t as seamless as most developers would like. It would be nice to have the features automatically activate themselves when a new site in SharePoint is created from a template.</p>
<p>This article will discuss the creation of SharePoint site definitions, which are templates for SharePoint sites that will automatically create the master page feature on the site when created.</p>
<h2>Site Definition</h2>
<p>Site Definitions are templates that developers can build in SharePoint. You might also hear the term Site Template in SharePoint, which is a customization of a Site Definition. In order to clear up any confusion on these two terms, you can just think of them like this:</p>
<p>Site Definitions &#8211; SharePoint template that developers can create to manipulate how a site should be created. These are stored in the 12 hive of SharePoint and are referenced during site creation.</p>
<p>Site Templates &#8211; Customization of a Site Definition that administrators of the SharePoint site can create from the UI screens. These are stored in the content database and these are not meant for developers to manipulate.</p>
<p>When you create a SharePoint site and use one of the out of the box templates, you are actually using a Site Definition that Microsoft created and shipped with the SharePoint product. For more information about how SharePoint constructs the out of the box Site Definitions, please refer to the second article in this series: <a href="http://sharepointmagazine.net/technical/development/examining-the-out-of-the-box-master-pages-in-sharepoint">Examining the out of the box Master Pages in SharePoint </a>.</p>
<h2>WSP Solutions</h2>
<p>In the fourth article of this series: <a href="http://sharepointmagazine.net/technical/development/deploying-the-master-page">Deploy a Master Page for a production ready system </a>, we discussed the manual process of creating a feature, placing it in the 12 hive and deploying it with stsadm commands. While that is a valid process to deploy to SharePoint, it is a very manual process. Also, we are now bringing another factor into our project (i.e.: the Site Definition). So, we could manually deploy the site definition in addition to the feature, but now we are starting to have a lot of manual steps. Plus, if we have a large SharePoint farm, we are going to have to repeat these steps on each server.</p>
<p>Thus, SharePoint created a way to incorporate all your features, site definitions, etc&#8230; into one deployable solution. These solutions are called WSP files. WSP files are basically CAB files with an extension SharePoint understands so it can deploy to a SharePoint farm. These solutions automatically get deployed to all appropriate servers in the farm. Thus, you only have to install the WSP against the SharePoint web application in order to install all your features, site definitions, etc&#8230;</p>
<h2>What are we showing in this article?</h2>
<p>In this article we are going to show how to create a Feature, Site Definition and WSP solution.</p>
<p>The Feature will deploy the master page to the master page gallery of our site, just like in article four of this series: <a href="http://sharepointmagazine.net/technical/development/deploying-the-master-page">Deploy a Master Page for a production ready system</a>.</p>
<p>The Site Definition will create the template for our site. This template tells SharePoint which aspx pages to create, which web zones to create, what features to activate, etc&#8230;</p>
<p>Lastly, the WSP solution will wrap everything up into one deployable package.</p>
<p>One question that undoubtedly comes up is &#8220;why are you incorporating the feature into the site definition instead of using feature stapling?&#8221;  Feature stapling is the process of creating features and stapling them to Site Definitions that already exist. For example: let&#8217;s say you created a web part in a feature and you wanted that feature to be activated on all sites created with the WSS team site definition that comes out of the box in SharePoint. However, you want to keep all the other parts of that site definition intact, all you want to do is add one more feature onto it. With feature stapling you can create a feature and tell it to attach itself to pre-existing site definitions (even the ones that come out of the box in SharePoint).</p>
<p>The decision to use feature stapling versus custom site definitions has to deal with the amount of customizations you need to make. There might be times when you want to use feature stapling instead of brand new site definitions. However, in a lot of cases you need to make changes that go above and beyond just the features in a site definition. Thus, it is good to create custom site definitions to manipulate these functionalities. Plus, custom site definitions activate the features when the site collection is getting created, while feature stapling activates the features after the site has been created. This timing is important to understand in some complicated situations.</p>
<p>So, for this particular demo I am going to activate my master page feature in a custom site definition to show the process. But, I am not saying this is the best way. If you already have a site created and just need to deploy the master page feature, you might want to look into feature stapling as an option.</p>
<h2>What tools are we going to use?</h2>
<p>One of the more difficult things to understand when you first learn how to create WSP solutions is the install files that are needed to build the WSP solution. These files are called the manifest and the ddf files. These files basically explain to SharePoint what features, site definitions, etc&#8230; is part of your solution so that SharePoint can install the solution to the web application.</p>
<p>Since these files are difficult to understand, there are a lot of third party tools available that will build the manifest and ddf files for you. These tools are usually extensions to Visual Studio. Microsoft built one called Visual Studio Extensions for WSS. Plus, there are many open source ones on CodePlex including STSDEV, SPBuilder, WSPBuilder, etc&#8230; Each of these tools provides a different approach to building SharePoint solutions.</p>
<p>My personal favorite is WSPBuilder. The way this product works is it mimics the 12 hive in a Visual Studio solution. As long as your Visual Studio solution has the same folder structure as the 12 hive, it will build the correct files to create the WSP solution. This is very powerful and flexible. I like this over the Visual Studio Extensions for WSS because I feel that I am restricted in what I can do with Visual Studio Extensions for WSS.</p>
<p>The choice of the solution builder tools you want to use is a personal choice. For this article I am going to work with the WSPBuilder add-in for Visual Studio.</p>
<p>Here is an example of how WSPBuilder works. Notice that the servers 12 hive matches the Visual Studio solution:</p>
<p><span style="underline;">Servers 12 hive</span></p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/servers12hive.jpg"><img class="alignnone size-medium wp-image-2000" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/servers12hive-248x300.jpg" alt="" width="248" height="300" /></a></p>
<p><span style="underline;">Visual Studio Solution</span></p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/vs12hive.jpg"><img class="alignnone size-medium wp-image-2001" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/vs12hive.jpg" alt="" width="225" height="234" /></a></p>
<p>As long as the 12 hive matches, you can right click on your project and use the WSP Builder menu options to build your WSP file.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/wspbuilderbuild.jpg"><img class="alignnone size-medium wp-image-2002" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/wspbuilderbuild-300x69.jpg" alt="" width="300" height="69" /></a></p>
<p>Also, when you are developing on a SharePoint server, you can right click on your project and use the WSPBuilder menu options to deploy your WSP file to the local server. This will deploy it to all web applications on your development machine.</p>
<p>Thus, when you are developing, you should be developing on a SharePoint server. Virtual machines such as VPC or VMWare are great for this. Then, every time you make a change you can just go to the deploy menu option of the WSPBuilder menu. After you are finished developing, you can build the WSP file using the menu options and it will physically place the WSP file in your projects folder. At this point you can copy that WSP file to the production machine and deploy it with stsadm commands.</p>
<h2>Walkthrough</h2>
<h4>Create The Structure</h4>
<ul>
<li>Start Visual Studio and choose a new WSPBuilder project.</li>
</ul>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/newproject.jpg"><img class="alignnone size-medium wp-image-2003" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/newproject.jpg" alt="" width="300" height="211" /></a></p>
<ul>
<li>Create a folder structure for the solution that <strong>matches </strong>the folder structure for the SharePoint 12 hive (this is really important &#8211; WSPBuilder works on the premise that the Visual Studio solution matches the structure of the SharePoint 12 hive). For now we are just going to create the following folders:
<ul>
<li>Template &#8211; subfolder under 12 that holds the other subfolders</li>
<li>1033 &#8211; holds the xml files that will tell SharePoint about our new site definitions</li>
<li>Features &#8211; holds the new features we are going to build (i.e.: lists, webparts, master pages, etc&#8230;)</li>
<li>Layouts &#8211; holds our reference files (i.e.: images, css, js, etc&#8230;)</li>
<li>Site Templates &#8211; holds our site definitions</li>
</ul>
</li>
</ul>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/demositestructure.jpg"><img class="alignnone size-medium wp-image-2004" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/demositestructure.jpg" alt="" width="228" height="233" /></a></p>
<h4>Create a Site Definition</h4>
<ul>
<li>Create a new site definition based off the team site definition in SharePoint.</li>
<li>Copy the team site definition folder from the 12 hive:</li>
</ul>
<p>C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\SiteTemplates\sts</p>
<ul>
<li>
<ul>
<li>Paste the folder in the Visual Studio solutions SiteTemplates folder.</li>
<li>Rename the sts folder to something unique (DemoCompanySiteDef for this example)</li>
<li>Delete the defaultdws.aspx file because we aren&#8217;t going to use it for this example.</li>
</ul>
</li>
</ul>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/demositestructure2.jpg"><img class="alignnone size-medium wp-image-2005" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/demositestructure2.jpg" alt="" width="235" height="211" /></a></p>
<ul>
<li>
<ul>
<li>Open the default.aspx file and change the master page to a new master page. Call this custom.master (yes, I know that this is not the name of our master page. We are going to configure SharePoint to do a string replacement of custom.master with DemoCompany.master in later steps). We will create this master page in the next step.</li>
</ul>
</li>
</ul>
<p>&lt;%@ Page language=&#8221;C#&#8221; MasterPageFile=&#8221;~masterurl/custom.master&#8221;</p>
<h4>Modify the Onet.xml file of the Site Definition for initial preparation</h4>
<ul>
<li>Open the Onet.xml file (located in the xml folder) and clean it up for our simple site definition.</li>
</ul>
<p style="30px;">The Onet.xml file is the file that tells SharePoint how to create the site definition. Whenever you create a new site in SharePoint it reads from the Onet.xml file to determine how to create the site. It is important to note that SharePoint is reading from the Onet.xml file when the site is being created. So, if you already have created a site, you can&#8217;t go back to the Onet.xml file, make changes, and expect it to show up on your already created sites.</p>
<ul>
<li>Scroll down to the Configurations XML nodes and remove 2 configurations:
<ul>
<li>ID=1 &#8211; Blank</li>
<li>ID-2 &#8211; DWS</li>
</ul>
</li>
</ul>
<p style="30px;">Be very careful not to remove ID=0 &#8211; Default, because this is the configuration we are going to use for this site definition. When removing the other two get rid of the whole xml tag as well as everything within their xml tag.</p>
<ul>
<li>Scroll down to the Modules XML nodes and remove 2 modules:
<ul>
<li>DefaultBlank</li>
<li>DWS</li>
</ul>
</li>
</ul>
<p style="30px">Once again, be very careful not to remove the Default module because this is the module we are going to use for this site definition. When removing the other two get rid of the whole xml tag as well as everything within their xml tag.</p>
<h4>Create the new master page feature</h4>
<p>The master page will be created as a feature. The reason for this is that if the master page is in a feature the master page can be added to the master page gallery of SharePoint. This allows you to set out-of-the-box pages to the master page or your own custom site definitions. It also allows you to turn on or turn off the master page features on specific sites. Basically, having it in a feature (rather than directly in the site definition or in the layouts folder) gives you much more flexibility.</p>
<ul>
<li>Create a new folder under &#8220;FEATURES&#8221; and call it something unique for your master page. For this example we will call it DemoCompanyMasterPage.</li>
<li>Create a folder under the DemoCompanyMasterPage called &#8220;MasterPages&#8221;.
<ul>
<li>Copy the general SharePoint master page from the 12 hive: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\GLOBAL\default.master</li>
<li>Paste the file under the &#8220;MasterPages&#8221; folder in the Visual Studio solution.</li>
<li>Rename the file to something unique (DemoCompany.master for this example).</li>
</ul>
</li>
<li>Create two xml files under the DemoCompanyMasterPage folder.
<ul>
<li>feature.xml &#8211; this will give a unique GUID to the feature (which we will reference later). This file also gives some important information about the Scope of the feature. Lastly, this file tells SharePoint where all the other files that make up this feature lives. This file must be called feature.xml (this is because SharePoint will read all files called feature.xml from the Features folder).</li>
</ul>
</li>
</ul>
<p>&lt;Feature Id=&#8221;95F25D4A-D256-4158-96FE-010F599149CC&#8221; Title=&#8221;Demo Master Page&#8221;<br />
Scope=&#8221;Site&#8221; Version=&#8221;1.0.0.0&#8243; Hidden=&#8221;FALSE&#8221; DefaultResourceFile=&#8221;core&#8221; xmlns=&#8221;http://schemas.microsoft.com/sharepoint/&#8221;<br />
Description=&#8221;This Feature contains the demo master page&#8221;&gt;<br />
&lt;ElementManifests&gt;<br />
&lt;ElementManifest Location=&#8221;elements.xml&#8221; /&gt;<br />
&lt;ElementFile Location=&#8221;MasterPages\DemoCompany.master&#8221; /&gt;<br />
&lt;/ElementManifests&gt;<br />
&lt;/Feature&gt;</p>
<p>Please note that the Scope=&#8221;Site&#8221;. This is very important. This is telling SharePoint that this feature is for the site collection. If that Scope=&#8221;Web&#8221; then it would be telling SharePoint that this feature is for an individual site.</p>
<ul>
<li>elements.xml &#8211; this file is telling SharePoint to place the new master page into the master page gallery. This file does not have to be called elements.xml (unlike the feature file which has to be called feature.xml). It just has to match the name located in the &#8220;ElementManifest&#8221; of the feature.xml file.</li>
</ul>
<p>&lt;Elements xmlns=&#8221;http://schemas.microsoft.com/sharepoint/&#8221;&gt;<br />
&lt;Module Name=&#8221;DemoCompanyMasterPage&#8221; Url=&#8221;_catalogs/masterpage&#8221; Path=&#8221;MasterPages&#8221; RootWebOnly=&#8221;FALSE&#8221;&gt;<br />
&lt;File Url=&#8221;DemoCompany.master&#8221; Type=&#8221;GhostableInLibrary&#8221; /&gt;<br />
&lt;/Module&gt;<br />
&lt;/Elements&gt;</p>
<h4>Modify Onet.xml file of the Site Definition</h4>
<p>We are modifying the Onet.xml file of the Site Definition in order to tell this Site Definition to activate our Master Page feature when the site is created and to use our custom master page with the dynamic url replacement technique.</p>
<p><strong><span style="underline;">Dynamic Token URL replacement</span></strong></p>
<p>To learn more about Dynamic URL replacement please refer to the second article in this series: <a href="http://sharepointmagazine.net/technical/development/examining-the-out-of-the-box-master-pages-in-sharepoint">Examining the out of the box SharePoint Master Pages</a>.</p>
<ul>
<li>Open the onet.xml file in Visual Studio (located at SiteTemplates/DemoCompanySiteDef/xml).</li>
<li>Find the xml node that says Configuration ID=0 Name=&#8221;Default&#8221;.</li>
<li>Add in a reference for the new master page:</li>
</ul>
<p style="30px;">&lt;Configuration ID=&#8221;0&#8243; Name=&#8221;Default&#8221;                           CustomMasterUrl=&#8221;~SiteCollection/_catalogs/masterpage/DemoCompany.master&#8221;<br />
MasterUrl=&#8221;~SiteCollection/_catalogs/masterpage/DemoCompany.master&#8221;&gt;</p>
<p><strong>Note</strong>: SharePoint will do a string replacement of any aspx page with ~masterurl/custom.master with the reference in CustomMasterUrl. And, it will replace any aspx page with ~masterurl/default.master with the reference in MasterUrl.</p>
<p><strong><span style="underline;">Activate the Feature</span></strong></p>
<ul>
<li>Find the SiteFeatures XML node.</li>
<li>Add a new Feature node in there that matches the GUID of the feature.xml file we created for our master page.</li>
</ul>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/activatefeature.jpg"><img class="alignnone size-medium wp-image-2010" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/activatefeature-300x103.jpg" alt="" width="300" height="103" /></a></p>
<p>This section of the onet.xml tells the site to <strong>activate </strong>this particular feature on this particular site when it is being created. The reason it goes into the SiteFeatures (instead of the WebFeatures) is because this particular feature was scoped for a Site Collection. If the feature was scoped for an individual site then it would go in the WebFeatures.</p>
<h4>Create the WebTemp*.xml file</h4>
<p>WebTemp*.xml files tell SharePoint about site definitions. When a new site is being created in SharePoint the &#8220;Select Templates&#8221; list box is populated by anything it can find in the WebTemp*.xml files. There can be multiple of these files in SharePoint as long as they are in the 12/Template/1033/XML folder. SharePoint will basically read this folder for any file that starts with the word WebTemp.</p>
<ul>
<li>Add a new folder under 12/Template/1033 in our Visual Studio solution called XML.</li>
<li>Add a new file to the 12/Template/1033/XML folder in our Visual Studio solution. This file must start with WebTemp. We will call this file WebTempDemoCompany.xml.</li>
</ul>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/webtemp.jpg"><img class="alignnone size-medium wp-image-2011" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/webtemp-300x114.jpg" alt="" width="300" height="114" /></a></p>
<ul>
<li>Add in the proper xml to tell SharePoint about our new site definition</li>
</ul>
<p>&lt;Templates xmlns:ows=&#8221;Microsoft SharePoint&#8221;&gt;<br />
&lt;Template Name=&#8221;DemoCompanySiteDef&#8221; ID=&#8221;10051&#8243;&gt;<br />
&lt;Configuration ID=&#8221;0&#8243; Title=&#8221;Demo Company Site&#8221;<br />
Hidden=&#8221;FALSE&#8221;                                                                                                         ImageUrl=&#8221;/_layouts/images/stsprev.png&#8221;<br />
Description=&#8221;A site for the Demo Company&#8221;<br />
DisplayCategory=&#8221;Demo Company&#8221; &gt;<br />
&lt;/Configuration&gt;<br />
&lt;/Template&gt;<br />
&lt;/Templates&gt;</p>
<p><strong>A few things to note:</strong><strong></strong></p>
<ul>
<li>The &#8220;Name&#8221; must match the site definition folder exactly. We used the name DemoCompanySiteDef. This matches our site definition name exactly.</li>
<li>The Configuration ID must match the configuration ID in our onet.xml file of our Site Definition. We used configuration id 0.</li>
<li>The display category will create a new tab on the new site screen in SharePoint.</li>
<li>The ID has to be unique and SharePoint has already reserved certain IDs. To be safe use an ID over 10000 and make sure it is unique.</li>
</ul>
<h4>Use WSP Builder to build and deploy the solution</h4>
<p>Now, at this point (in a regular SharePoint solution) we would create manifest.xml and ddf files. These are files SharePoint needs to install the solution properly. However, since we are using WSPBuilder, it will do that for us.</p>
<ul>
<li>Right click the project and click WSPBuilder &#8211; Build</li>
</ul>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/wspbuilderbuild.jpg"><img class="alignnone size-medium wp-image-2002" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/wspbuilderbuild-300x69.jpg" alt="" width="300" height="69" /></a></p>
<ul>
<li>Verify your Web Application is created on your local SharePoint environment. Note: the Site Collection should not be created at this point, just the Web Application. And, you only need to do this once.</li>
<li>If the build is successful, right click the project and click WSPBuilder &#8211; Deploy.</li>
</ul>
<p>This is needed because the build command in WSPBuilder just builds a wsp file. This file can be sent to other machines and you can use stsadm scripts to install it on other SharePoint farms. However, in development, we need a quick way to deploy it to the current SharePoint farm. The WSPBuilder &#8211; Deploy command will deploy the wsp file on all the Web Applications in the local SharePoint farm.</p>
<h4>Use the Site Definition</h4>
<p>Open up SharePoint Central Administration and create a new Site Collection with the site definition we just created.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/12/selecttemplate.jpg"><img class="alignnone size-medium wp-image-2012" src="http://sharepointmagazine.net/wp-content/uploads/2008/12/selecttemplate-300x180.jpg" alt="" width="300" height="180" /></a></p>
<p>Now you can go back and modify the master page or default.aspx page as you wish. Just be careful not to mess with the ContentPlaceHolders too much. SharePoint reserve these for certain actions on some of its internal pages. After every change you make you can rebuild by clicking WSPBuilder &#8211; Build and update the solution by clicking WSPBuilder &#8211; Deploy. Then you can just go to the website and see your changes. Just be aware that everytime you deploy WSPBuilder does an app pool recycle (to ensure the changes get pushed out through IIS), so you might have to wait a few seconds to see your changes (during that few seconds the site could say Service Unavailable).</p>
<p>It is also important to note that the first time you deploy with WSPBuilder it does a true SharePoint install. However, every subsequent time it does a SharePoint solution update. Solution updates work for most changes, however, there are some things it can&#8217;t do. So, if you run into errors it is sometimes good to do WSPBuilder &#8211; Uninstall and then WSPBuilder-Deploy to do a real install in certain situations when you are making changes.</p>
<p>If you are curious to what a SharePoint solution is doing, then just check out the files in the 12 hive:</p>
<p>C:\Program Files\Common Files\Microsoft Shared\web server extensions\12</p>
<p>You will notice that all the files we created in our Visual Studio solution have been &#8220;pushed&#8221; down to the folders in the 12 hive. The WSP knows to &#8220;push&#8221; these files there. The WSP also knows to tell SharePoint that these files exist. This is exactly how SharePoint develops it&#8217;s out of the box site definitions.</p>
<p><span style="underline;">Side Notes:</span></p>
<p>1. Any file you place in the Layouts folder can be reference in the aspx pages as &#8220;/_layouts/{filename}&#8221;. I usually recommend placing another folder under Layouts in the Visual Studio solution (just because it makes it easy to find later &#8211; you can call this folder the name of your company or the name of your project or anything that is obvious that it contains your custom reference files). Then you can reference everything in there by &#8220;/_layouts/{folder}/{filename}&#8221;. An example of this is css files in the master page. This is possible because SharePoint sets an IIS path up to the Layouts folder in the 12 hive and calls it _layouts.</p>
<p>2. If you want to create a custom webpart with WSPBuilder just click Add &#8211; new item&#8230; WSPBuilder &#8211; WebPartFeature. This will create the feature folder, for your webpart, and the .cs class for your webpart. This way you can go directly into coding and not have to worry about the Feature creation. Once you are done coding the webpart just make sure it is in the appropriate scope of your onet.xml file (SiteFeatures or WebFeatures) and it will become available to you in your webpart gallery. Then all you have to do is worry about your dll being installed in the Bin or GAC. If you choose GAC I recommend post-build scripts to move it.</p>
<p>3. Do not remove Content Place Holders from your master page if you start doing customizations. The reason for this is if you assign other files in SharePoint (such as list pages) to use your master pages, they will assume certain Content Place Holders exist. If they are not there, your site will just break.</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointmagazine.net/technical/development/incorporating-a-master-page-into-a-sharepoint-site-definition-master-pages-and-sharepoint-part-6-of-6/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Customizing Application Master Pages &#8211; part 5 of 6</title>
		<link>http://sharepointmagazine.net/technical/development/customizing-application-master-pages-masterpages-and-sharepoint-part-5-of-6</link>
		<comments>http://sharepointmagazine.net/technical/development/customizing-application-master-pages-masterpages-and-sharepoint-part-5-of-6#comments</comments>
		<pubDate>Fri, 31 Oct 2008 10:17:41 +0000</pubDate>
		<dc:creator>ggalipeau</dc:creator>
				<category><![CDATA[Customisation]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[application]]></category>
		<category><![CDATA[Application Master]]></category>
		<category><![CDATA[custom]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[layouts]]></category>
		<category><![CDATA[master]]></category>
		<category><![CDATA[Master Page]]></category>
		<category><![CDATA[page]]></category>

		<guid isPermaLink="false">http://sharepointmagazine.net/?p=1449</guid>
		<description><![CDATA[This is the fith article in a six-part series on ASP.NET Master Pages and SharePoint. In this series we have discussed master pages and we have shown how to customize a master page.]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>This is the fith article in a six-part series on ASP.NET Master Pages and SharePoint.</p>
<ol>
<li><a href="http://sharepointmagazine.net/technical/development/introduction-to-master-pages">Introduction to Master Pages.</a></li>
<li><a href="http://sharepointmagazine.net/technical/development/examining-the-out-of-the-box-master-pages-in-sharepoint">Examining the out of the box Master Pages in SharePoint.</a></li>
<li><a href="http://sharepointmagazine.net/technical/customisation/developing-a-custom-master-page-master-pages-and-sharepoint-part-3-of-6">Developing a custom Master Page for SharePoint.</a></li>
<li><a href="http://sharepointmagazine.net/technical/development/deploying-the-master-page">Deploy a Master Page for a production ready system.</a></li>
<li><strong>Customizing the Application.master Page.</strong></li>
<li>Incorporating a Master Page into a SharePoint site definition<strong></strong></li>
</ol>
<p>In this series we have discussed master pages and we have shown how to customize a master page. Before we finish up the process (i.e.: incorporating master pages into a SharePoint site definition), I would like to diverge and talk about a frustrating subject &#8211; application master pages. Customizing application master pages is a little different than other master pages within SharePoint. Thus, I wanted to break this out into its own article to describe the subtle complexities of them and why they exist.</p>
<h2>What is the application master page?</h2>
<p>The application master page is the master page for application pages (also called layout pages). Thus, to answer the question &#8220;what is the application master page?&#8221;, we will discuss what an application page is. In previous articles we discussed how SharePoint web pages are a mix of templates and content data from the database. This combination is merged behind the scene and the end user sees the page. This gives us the ability to create custom pages on the fly. However, there are some pages in SharePoint that are static and used across all web applications, site collections and sites. These pages are stored in the 12 hive and are not dynamically generated with content from the database (even though they might have webparts or user controls on them). These pages are usually used for setting or admin pages. A good example is the site setting page of your site. There is an easy way to tell if a page is an application page: it will contain the word &#8220;_layouts&#8221; in the url.</p>
<p>Most articles or posts on how to customize SharePoint web pages ignore the fact that these application pages exist. The reason is that the argument can be made that only adminstrators can access these pages. Well&#8230; that can be true in certain situations, but it is all about how the site is set up out of the box. If you don&#8217;t take the necessary steps to make sure that application pages don&#8217;t show up, then they will. A good example of this is the search page (I am talking about the site search page, not the Search Center). When you do a search in SharPoint and the search scope is set to the current site, then SharePoint will display the results on a search page that is an application page. Thus, the end user will see an application page in this instance. So, as you can see, it is important to customize the application master page unless you remove all references to all application pages that the end user of the system might see. This is very important if you are trying to customize an entire portal to change the look so it doesn&#8217;t look like a SharePoint site.</p>
<p>The out of the box application master page can be found at: %Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS.</p>
<h2>Microsoft&#8217;s recommendations for customizing application.master</h2>
<p>According to this support site: <a href="http://support.microsoft.com/kb/944105">http://support.microsoft.com/kb/944105</a> &#8211; there is two ways to modify/customize the application.master page.</p>
<ul>
<li>Modify the application.master page in the 12 hive &#8211; Now&#8230; if you have been following this series of articles (or any other best practice article about SharePoint), then you will know you are NEVER suppose to modify files in the 12 hive. Other than the obvious issues this causes, including breaking the best practices Microsoft lays out, it also means we have to have the same application.master page for all web applications of a server. This means we can&#8217;t have two web applications on a server that have different look and feels.</li>
<li>Create a custom layouts folder &#8211; In my opinion this is a maintenance nightmare. You are copying your entire layouts folder to do this &#8211; not just the things that deal with application master pages. This seems like an extreme way to do something that I do not recommend.</li>
</ul>
<p>For the reasons listed above, I don&#8217;t particularly agree with either of these recommendations.</p>
<p>Luckily others in the SharePoint community agree with my thoughts here and a common solution has been introduced throughout the SharePoint community. The solution is to implement custom HttpModules.</p>
<p>This approach is a non-supported approach, but the SharePoint framework leaves us little options. And, the &#8220;supported&#8221; approaches above seem to do more damage than good, so I can live with non-supported for now.</p>
<h2>HTTP Modules</h2>
<p>Http modules intercept page requests and allow custom code to run before the page actually renders. Thus, we can intercept the request and check if it is an application page. Then we can change the master page reference dynamically as the page renders.</p>
<p><strong><em>Note</em></strong>: I originally learned the steps below from this blog by David Wise &#8211; <a href="http://www.sharepointblogs.com/dwise/archive/2007/01/08/one-master-to-rule-them-all-two-actually.aspx">http://www.sharepointblogs.com/dwise/archive/2007/01/08/one-master-to-rule-them-all-two-actually.aspx</a> . I would like to thank David to allow me to use his steps in this article posting. David would also like to give credit to K. Scott Allen whom he originally got the dynamic replacement of master pages idea for regular asp.net applications.</p>
<p><strong>Step 1 &#8211; build the project</strong></p>
<ol>
<li>Open Visual Studio</li>
<li>Create a New Project</li>
<li>Choose a Class Library project (for this walkthrough I am referring to a C# class library, but the steps are the same for other types)</li>
<li>Call it ApplicationHttpModule</li>
<li>Rename Class1 to ApplicationMasterModule</li>
<li>Change the code in ApplicaitonMasterModule to look like this:</li>
<p>using System;<br />
using System.Web;<br />
using System.Web.UI;<br />
using System.IO;</p>
<p>namespace ApplicationHttpModule<br />
{<br />
public class ApplicationMasterModule: IHttpModule<br />
{<br />
public void Init(HttpApplication context)<br />
{<br />
context.PreRequestHandlerExecute += new EventHandler(context_PreRequestHandlerExecute);<br />
}<br />
void context_PreRequestHandlerExecute(object sender, EventArgs e)<br />
{<br />
Page page = HttpContext.Current.CurrentHandler as Page;<br />
if (page != null)<br />
{<br />
page.PreInit += new EventHandler(page_PreInit);<br />
}<br />
}</p>
<p>void page_PreInit(object sender, EventArgs e)<br />
{<br />
Page page = sender as Page;<br />
if (page != null)<br />
{<br />
if (page.MasterPageFile != null)<br />
{<br />
if (page.MasterPageFile.Contains(&#8220;application.master&#8221;))<br />
{<br />
page.MasterPageFile = &#8220;/_layouts/MasterPages/Custom.master&#8221;;<br />
}<br />
}<br />
}<br />
}</p>
<p>public void Dispose()<br />
{<br />
}<br />
}<br />
}</p>
<li>Sign the project &#8211; this is needed to add the dll to the GAC
<ul>
<li>Right click on the ApplicationHttpModule project and go to the properties</li>
<li>Go to the &#8220;Signing&#8221; link on the right side</li>
<li>Click the checkbox to &#8220;Sign the assembly&#8221;</li>
<li>In the &#8220;Choose a strong name key file&#8221; dropdown, choose &#8220;&lt;New&#8230;&gt;&#8221;</li>
<li>Enter a &#8220;Key file name&#8221;.</li>
<li>Uncheck the &#8220;Protect my key with a password&#8221; checkbox</li>
<li>Click &#8220;Ok&#8221;</li>
</ul>
</li>
<li>Build the project</li>
<li>Place the dll in the GAC
<ul>
<li>If you built in Debug mode then the dll will be at: &lt;project path&gt;/bin/debug/ApplicationHttpModule.dll</li>
<li>Drag the dll (do not copy and paste) into the GAC: C:\Windows\assembly</li>
</ul>
</li>
</ol>
<p><strong>Step 2 &#8211; Register the module</strong></p>
<ol>
<li>Find the web config for your site. If you did not specify a path when you created your web application then this is located at C:\Inetpub\wwroot\wss\VirtualDirectories\&lt;port&gt;. If you did specify a different path and don&#8217;t remember where it is, the best way to figure it out is to go into IIS, find your website, go to the properties, click on the &#8220;Home Directory&#8221; tab. Your path will be in the &#8220;Local path&#8221; text box.</li>
<li>Add this into the web.config file within the &#8220;httpModules&#8221; section</li>
</ol>
<p>&lt;add name=&#8221;CustomApplicationHttpModule&#8221; type=&#8221;ApplicationHttpModule.ApplicationMasterModule, ApplicationHttpModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=e04811459cf7ea00&#8243; /&gt;<strong> </strong></p>
<p>Note a few things:</p>
<ul>
<li>Type=&lt;class name including namespace&gt;, &lt;name of assembly&gt;</li>
<li>PublicKeyToken &#8211; this can be found by going to the dll in the GAC (C:\Windows\assmebly), then right click and look at the properties of the dll.</li>
</ul>
<p><strong>Step 3 &#8211; Put a custom master page in the layouts folder</strong></p>
<p>In Step 1 we told the code to look for the master page in /_layouts/MasterPages/Custom.master. Thus, we need to actually have a master page there.</p>
<ol>
<li>Copy the application.master from %Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS</li>
<li>Create a new folder called &#8220;MasterPages&#8221; under %Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS</li>
<li>Paste the application.master page in the newly created MasterPages folder</li>
<li>Rename the application.master page in the MasterPages folder to Custom.master</li>
</ol>
<p><strong>Step 4 &#8211; Make changes to the Custom.master</strong></p>
<p>Now that you have built an HttpModule to redirect to the Custom.master page you can customize your Custom.master page however you want. But, you still have to be careful about keeping the content place holders around per the articles I have been writing in this series.</p>
<h2>Be Careful</h2>
<p>Just like the regular SharePoint master pages you must still be careful when you start modifying application master pages. Here are a couple of things to make sure you do:</p>
<ul>
<li>Don&#8217;t remove content place holders. The pages that implement the application master page assume these content place holders are there. So, any content place holder from application.master must be in your custom application master page. If you are sure you have a content place holder that is not needed, then don&#8217;t remove it &#8211; just wrap it in a tag and turn the visible property to false.</li>
<li>You can&#8217;t have a search control on the application master pages. I am not sure of the reason for this, but you can&#8217;t have the out of the box search control on the application master pages.</li>
<li>Some of the application pages are actually formatted incorrectly. Thus, when you build a custom application master page you could inadvertently mess up an out of the box application page. This can happen even if your application master page is formatted perfectly. Please read my blog post on this subject for more information: <a href="http://greggalipeau.wordpress.com/2008/07/30/custom-applicationmaster-working-around-microsoft-bugs/">http://greggalipeau.wordpress.com/2008/07/30/custom-applicationmaster-working-around-microsoft-bugs/</a></li>
<li>Do not use this method if your install has the SSP on the same server as the main SharePoint application. There has been reported issues of the SSP having issues with this approach because the system master pages they use have a different setup.</li>
</ul>
<h2>Conclusion</h2>
<p>This is not as much of a conclusion, as it is a plea to the developers at Microsoft who are creating the next version of SharePoint. Please make sure we have a clear path to change application master pages. Hopefully the highly anticipated 14 hive will help with the current situation.</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointmagazine.net/technical/development/customizing-application-master-pages-masterpages-and-sharepoint-part-5-of-6/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Customizing the user experience: Overview of the default interface (Part 1 of 6)</title>
		<link>http://sharepointmagazine.net/technical/development/customizing-the-user-experience-of-sharepoint-overview-of-the-default-sharepoint-interface-from-a-technical-point-of-view-part-1-of-6</link>
		<comments>http://sharepointmagazine.net/technical/development/customizing-the-user-experience-of-sharepoint-overview-of-the-default-sharepoint-interface-from-a-technical-point-of-view-part-1-of-6#comments</comments>
		<pubDate>Thu, 09 Oct 2008 01:00:12 +0000</pubDate>
		<dc:creator>furuknap</dc:creator>
				<category><![CDATA[Customisation]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Branding]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[User]]></category>
		<category><![CDATA[ux]]></category>

		<guid isPermaLink="false">http://sharepointmagazine.net/?p=719</guid>
		<description><![CDATA[Have you ever wondered how the built in interface actually works? Why is a list item shown the way it is? How are the input forms built and how can you change how they work and look? This series will introduce you to a wide variety of customization options not usually covered in books or online articles.]]></description>
			<content:encoded><![CDATA[<p><strong>Have you ever wondered how the built in interface actually works? Why is a list item shown the way it is? How are the input forms built and how can you change how they work and look?</strong></p>
<p>This series will introduce you to a wide variety of customization options not usually covered in books or online articles.</p>
<p>Most articles will have rather high pre-requisites. Basically you should be very familiar with ASP.Net, SharePoint and CAML. You should, for instance, understand very well how master pages and content placeholders work, you must absolutely be able to create a feature from scratch and you should have some experience with working with content types.</p>
<p>So, if you are up for it, here is an article outline for the six parts:</p>
<p><strong>Part 1: Overview of the default SharePoint interface from a technical point of view </strong></p>
<p>In the first article we will look at how the default SharePoint interface is built. We will look at a site, going from top-down, explore some of the the default lists, the fields used to create the basic field types, which content types are available, and how list forms are rendered.</p>
<p><strong>Part 2: Modifying the default experience </strong></p>
<p>This article will show you which options are available for you to modify and improve the default setup. Learn how to override the default rendering of fields or forms without voiding your supported state.</p>
<p><strong>Part 3: Lists and custom list forms </strong></p>
<p>The third article will cover the basics of customizing lists using different views, custom list forms, and fields.</p>
<p><strong>Part 4: Content types user interface </strong></p>
<p>The next article will explore how you can utilize content types to display different input forms and display forms.</p>
<p><strong>Part 5: Custom fields deep dive </strong></p>
<p>Ever wanted to create a new field type? SharePoint enables you to do this and it is a very powerful tool for customizing the user experience.</p>
<p><strong>Part 6: Fast track to feature generation </strong></p>
<p>Writing custom lists with content types by hand can take a massive amount of time. In the final installment I will share with you some tools and techniques that makes list, field, and content type generation very fast.</p>
<p>So, what are your waiting for? Let&#8217;s get going&#8230;</p>
<h3>Disclaimer</h3>
<p>Before we go any further, be advised that any changes you make to files in the 12-hive may void your warranty and cause damage to your SharePoint installation. I will come back to changes you can make and what you cannot change in the next article, but for now, feel free to experiment only in your non-supportable lab environment. I would ask you to take backups of anything you change, but we both know you won&#8217;t do that anyway, so let&#8217;s cut the crap and just admit that we are and can be renegade cowboys, or cowgirls, as long as we do so in a lab where we will not be needing Microsoft&#8217;s rescue if something goes wrong.</p>
<p>Also, I won&#8217;t be covering everything. Simply not enough time, and I want to keep the article to at least below a day&#8217;s worth of reading.</p>
<p>That&#8217;s it.</p>
<p>Nothing else to see here, move along.</p>
<h3>Overview of the default SharePoint interface from a technical point of view</h3>
<p>Actually, the term overview may be a bit inaccurate. Be aware that we will go deep into some topics. However, each of the topics we will investigate are worthy of books and books of even deeper diving. While it may seem that this article covers a lot, it does not by far cover everything, but only gives an, you guess it, overview of a whole range of aspects.</p>
<p>Let&#8217;s start our journey of exploration right away and get to know our 12-hive a bit better. You know what the 12-hive is, right? If not, feel free to read up on it and come back to the group later. (Ok, I just wanted to sound a bit arrogant, the 12-hive is just another name of the file structure that usually resides in c:\Program Files\Common Files\Microsoft Shareed\web server extentions\12)</p>
<p>Oh, and by the way, from now on I will address the 12-hive as [12], so whenever you see [12] you should know where to go.</p>
<h4>Sites</h4>
<p>We want to know of what a site is actually made. How are the different lists made, how are the .aspx files created and from where do they come, why do you get all those _catalogs folders, and a lot of other things. For this I will use the Basic Meeting workspace site definition and really dive deep into how it is created. In the following articles we will use our knowledge to create new lists, pages, and definitions, but we need to know what is going on first.</p>
<p>The [12]\TEMPLATE\1033-folder, or the numbered folder that corresponds to the language pack you have installed, contains a few different things related to the language pack in question. For starters you will find your webtemp.xml files in the XML folder there. The &#8216;temp&#8217; part of that filename is short for template, not temporary, by the way.</p>
<p>The webtemp.xml file, or files if you have created your own site templates, contain the templates available for site and site collection creation. The webtemp.xml is actually just the list of templates and some minor configuration data, the bulk of the site template definition is actually in the SiteTemplates folder in the [12]\TEMPLATE folder. We will get there later.</p>
<p><strong>webtemp.xml</strong></p>
<p>If you want to create your own site templates you need to add at least one file here, called webtempXXXXX.xml, where XXXXX is something of your choosing. You cannot modify the webtemp.xml file that ships with your language pack or you will void warranty. A notable exception to this is to change the hidden attribute. You can use this to hide any templates you do not want users to see during the site collection creation process.</p>
<p>If you open the default webtemp.xml file you will see both Template elements and one or more Configuration elements within those Template elements. The Configuration elements are the actual site definitions, and for each of these Configuration elements there must be a matching Configuration section in an onet.xml file somewhere.</p>
<p>Where? We will get there later, I told you! Be patient.</p>
<p>Look, for instance, in the Template element named MPS having an ID of 2, this being the template for the meeting workspaces. There are five different configurations there, each being a different type of meeting workspace. To properly reference a specific site definition you need both the name section and the ID, in the format of &#8220;NAME#ConfigurationID&#8221; . So, if you want to programmatically create a site you would use, for instance:</p>
<div style="courier new">

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;">SPWeb newWeb <span style="color: #008000;">=</span> web.<span style="color: #0000FF;">Webs</span>.<span style="color: #0000FF;">Add</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;NewMeetingSite&quot;</span>, <span style="color: #666666;">&quot;My new basic meeting workspace&quot;</span>, <span style="color: #666666;">&quot;My description&quot;</span>, <span style="color: #FF0000;">1033</span>, <span style="color: #666666;">&quot;MPS#0&quot;</span>, <span style="color: #0600FF;">false</span>, <span style="color: #0600FF;">false</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span></pre></div></div>

</div>
<p>Now it is time to award your first bit of patience. You see, all the configurations in webtemp*.xml are very basic, but still you get a lot of stuff happening when you create a site using that configuration. There must be more stored somewhere, right?</p>
<p>Let&#8217;s head out of the 1033-folder and to [12]\Template\SiteTemplates for a while.</p>
<p>Notice anything in particular? Three are folders there, true, but what are they named? Exactly the same as the names of the site templates in webtemp*.xml! There must be a connection in there, we must press on if we are to discover the true secret of the site definitions.</p>
<p>Open the MPS folder. Now we are getting somewhere. Look at the default.aspx file using your favorite editor. If you dissect this file you will see that it is actually the file used to render the front page of the new meeting space. Not just that, but changes made to this file will alter any Meeting Workspace in your entire site collection. I can feel the power rushing to my head. Delete it an no one will be able to hold a meeting any longer! Muhahaha! (Cue music from Stargate SG-1 or your favorite evil ruler movie scene) Obey me, office slaves, kneel before your master! I rule your meeting life from this day and until eternity! Muhahaha!</p>
<p>Oh, sorry about that.</p>
<p>Actually, this is only partially cool. If you modify a page in SharePoint, for instance the default.aspx page of a meeting workspace, your page becomes &#8216;Customized&#8217; meaning it is no longer the same as it was when it was created from the site definition. In practice, what happens when you customize a page is that SharePoint retrieves the page from the site definition, ie the page we just deleted (no, you really shouldn&#8217;t delete it, unlimited power does not come from getting yelled at from your users). Then it stores a copy of that file in the database. When you then make changes to the file you only change the file stored in the database, not the actual file on the file system.</p>
<p>If you use a function to restore the file to the site definition, for instance from the web interface under site settings or using a SharePoint compatible editor such as SharePoint Designer, you just say to SharePoint that you do no longer want to use the file stored in the database but want to use the one on the file system, which you should have restored from backup now if you deleted it earlier.</p>
<p>You know, that backup&#8230;</p>
<p>Oh, bother&#8230;</p>
<p>We still need to find out more about our site, and the really good stuff is still ahead.</p>
<p><strong>onet.xml</strong></p>
<p>Back in your MPS folder you will also find a folder named XML, and inside you will find a file called ONET.XML. onet.xml is the file that actually holds the details of the different configurations, amongst other things. It follows the wss.xsd schema so you can get intellisense if you are using Visual Studio as well and this is a real life saver when you start writing your own site definitions. You can check out the instructions for getting intellisense in onet.xml in my blog at <a title="http://furuknap.blogspot.com/2008/04/intellisense-in-onet.html" href="http://furuknap.blogspot.com/2008/04/intellisense-in-onet.html" target="_blank">http://furuknap.blogspot.com/2008/04/intellisense-in-onet.html</a>.</p>
<p>If you close all the first-level nodes in Visual Studio you can get a quick overview of what is inside the Project root node. In the MPS onet.xml you will find NavBars, ListTemplates, DocumentTemplates, Configurations, Modules, Components, and ServerEmailFooter.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/08/mpsonetxml3.png"><img style="0px" src="http://sharepointmagazine.net/wp-content/uploads/2008/08/mpsonetxml-thumb.png" border="0" alt="MPS.onet.xml" width="640" height="131" /></a></p>
<p>The NavBars element contain the NavBars, go figure. NavBars are the navigational elements of a site, such as the quick launch and the top navigation bar of a team site. The navbar elements are the places where you define navbars and create and modify the links that appear in each of these navbars. More on that in a later article.</p>
<p>The ListTemplates section contains the list templates that will be made available with the site definition. If you go to a newly created Basic Meeting workspace and click Create from the site actions menu you will see some additional custom lists that are not available in, for instance, the Team Site template. The ListTemplates section describes the basics of these custom lists.</p>
<p>Note that, as for the webtemp.xml and the configuration section there, the ListTemplates are only the list of listtemplates, not the actual list templates. Hang on a bit and we&#8217;ll dig even deeper to find the detailed list templates, just like we found onet.xml from our webtemp.xml file.</p>
<p>The DocumentTemplates section contains the document templates you can chose when you create a new document library. In your own onet.xml you can add document templates here and they will appear for all document libraries for all the configurations in your site template.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/08/mpsdoctemplates1.png"><img style="0px" src="http://sharepointmagazine.net/wp-content/uploads/2008/08/mpsdoctemplates-thumb.png" border="0" alt="MPS.DocTemplates" width="735" height="213" /></a></p>
<p>The next section, Configurations, is where the brunt of the work is done in onet.xml. Notice the ID of each Configuration element? These IDs correspond to the configuration elements of webtemp.xml. Our code snippet above created a site based on the site definition MPS#0. We know that the MPS refers to the onet.xml file in the MPS folder under SiteTemplate and now we find what the 0 means.</p>
<p>Open the Configuration element with ID 0 and name Basic. Note that it uses a CustomMasterUrl attribute that refers to &#8220;_catalogs/masterpage/MWSDefault.master&#8221;. We will explore how that file is actually created when we come to the modules section.</p>
<p>The Lists element and its children List elements tells SharePoint that we want lists of a certain type. Remember the ListTemplates section? The Type of the List elements refers to the ListTemplate of the ListTemplates section.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/08/mpslisttemplatereference1.png"><img style="0px" src="http://sharepointmagazine.net/wp-content/uploads/2008/08/mpslisttemplatereference-thumb.png" border="0" alt="MPS.ListTemplateReference" width="828" height="450" /></a></p>
<p>ListTemplates may also exist in other places than in the onet.xml file. If you look a bit further down you see that the Lists section contains a List of type 101, and we do not have a 101 type in out ListTemplates section. So, where is list 101 located?</p>
<p>Well, first of all, lists with numbers in the 100s, 200s and 300s are so-called built-in list templates. 101 happens to refer to the generic Document Library list template. You can find a complete list of the built-in template types at <a title="http://msdn.microsoft.com/en-us/library/ms462947.aspx" href="http://msdn.microsoft.com/en-us/library/ms462947.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms462947.aspx</a>. But where is it?</p>
<p>I&#8217;ll keep you on the tip of your seats a bit longer. We&#8217;ll get there soon, I promise.</p>
<p>Next you will find a Modules section with two Module elements named BasicHome and MWSMasterPage. These module elements tells SharePoint what files, for some reason termed modules, should be provisioned with the site. We only see the name of each module here, though, not which files are actually copied. The modules are defined in the Modules section of the root element so we will get there soon as well.</p>
<p>You will also find a SiteFeatures and a WebFeatures section. Each section refers to features that are site or web scoped, respectively. These section defines which features should be activated with the site definition. If can be confusing to know which features are actually activated since only their Guid reference is used so you would need to search in the Features folder of your [12]\Template folder to find the correct names. The two features activated with MPS#0 are the three-state workflow (Guid FDE5D850-671E-4143-950A-87B473922DC7) and team collaboration feature (Guid 00BFEA71-4EA5-48D4-A4AD-7EA5C011ABE5<strong>). </strong></p>
<p>There is one more element of the configuration section that is not included in any of the MPS definitions, and it can be extremely useful so I will include it here. I am talking about the ExecuteUrl element. The ExecuteUrl is a URL that will be launched when the site is created. This can be incredibly powerful because it allows you to perform additional tasks such as further configuring your site, inviting users, giving users intructions on how to manage their new site, or any other task that you may want to accomplish. You can redirect the user to the Create new content page, for instance, or you can create your own configuration page tailored to your needs.</p>
<p>The ExecuteUrl is only launched when a user creates the site through the web interface, though, not when created by other means such as through custom code. Still, it can be extremely useful for creating a richer user experience. Use it. I do. And you want to be like me, right?</p>
<p>Don&#8217;t answer that.</p>
<p>Moving along, we can now close the Configuration section and look at the Modules section.</p>
<p>The modules are where many of the files for our site are defined. Remember we had two modules in our MPS#0 definition, named BasicHome and MWSMasterPage? This is where we find out what these two modules actually comprise. The reason we only needed to include the names of the modules in our configuration is that the rest is defined here.</p>
<p>A module can comprise multiple files, which may be why they are not simply called &#8216;Files&#8217;, and when a module is used by a site configuration all the files of the module are provisioned according to the module definition.</p>
<p>Open the BasicHome module. Notice that there is a Url and a path attribute. The Url attribute says where the files should be stored on the site. For BasicHome it is empty, but it is defined for the actual files that are stored in the module.</p>
<p>The path attribute of the module tells SharePoint where to find the file. So, if it is empty, where is the file? The path is actually relative to the feature or the site definition, so an empty path tells SharePoint that the file is in the root folder of the feature or the site definition. In our case that would be in [12]\TEMPLATE\SiteTemplates\MPS.</p>
<p>If you look at the only File in this module, default.aspx, you will see that it has a URL but no path. The rule here is that if no path is set then Url will be used as path, so if your file has a physical name that is the same as you want it to be on the site then you can skip the path attribute.</p>
<p>See now how SharePoint mapped the default.aspx of our site to the physical file store in the MPS root, and why editing or deleting that file (no, you shouldn&#8217;t this time either) will modify all the sites that use this definition? Pretty cool, eh?</p>
<p>Now, contained in the default.aspx File element you will also find a few View elements and a NavBarPage element. All of these are useful. The View elements puts webpart with views of our lists into our file. Each view element has a list, which refers to one of the lists was created in the Lists section of the configuration, a BaseViewId which states which view will be displayed for the list as well as what webpartzone should host that view. There can also be a WebPart order if you have multiple views in the same webpartzone. We will get back to how the lists and their views are defined later. Using the View elements you can thus populate your webpart page with webparts during the site creation.</p>
<p>The NavBarPage is also useful. NavBarPages tells SharePoint where in the navbar this page should be placed, as well as the name which should be used when linking to that page. Note that several of the navigational options available in a site definition does not behave as expected. In fact, the NavBarHome attribute of a file  in a module doesn&#8217;t work at all. An exhaustive investigation is beyond the scope of this article, though, and I must leave some goodies for my book <img src='http://sharepointmagazine.net/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Note that the name itself is stored in a resource file. That&#8217;s another show.</p>
<p>There is one more very useful thing I would like to mention regarding the File element, and that is the AllUsersWebPart element. It is not present in this module, or even in the MPS onet.xml at all, but look at the STS onet.xml, located at [12]\TEMPLATE\SiteTemplates\STS\XML\onet.xml, under the module named Default:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/08/stsonetxmldefaultmodule1.png"><img src="http://sharepointmagazine.net/wp-content/uploads/2008/08/stsonetxmldefaultmodule-thumb.png" border="0" alt="STS.onet.xml.defaultmodule" width="684" height="268" /></a></p>
<p>Ever been annoyed by the SharePoint logo that appears on every new team site? Well, there&#8217;s your culprit. Inside the AllUsersWebPart is an XML CDATA containing the straight-up webpart code to add a regular ImageWebPart webpart containing that image.</p>
<p>You can use this to your advantage, though, to add any webpart, not just views of lists, to your page. I will share with you some simple tricks for working with this in the last article of this series. And you know that when I ask you to wait so long it must be good.</p>
<p>The last thing we should explore in the onet.xml file for now is the MWSMasterPage module. It is a bit different from the default.aspx module, but there are some notable differences.</p>
<p>The first thing that may catch your eye is that there is a SetupPath pointing to &#8220;global&#8221;. Now, for the BasicHome module we learned that path refers to the path in the site definition, but we do not have any global folder, do we? How will we find the MWSdefault.master file in the only File element of this module?</p>
<p>The key here is that this is not Path, but SetupPath. Setup refers to the SharePoint template folder, otherwise known as [12]\TEMPLATE, so SetupPath is not relative to the site definition folder but rather the [12]\Template folder. If you go there now you will see a global folder, and inside there, guess what, there is a file called MWSdefault.master.</p>
<p>The module element also has a Url attribute with a value of _catalogs/masterpage. This simply tells SharePoint where the files in this module should be stored. However, if the folder does not exist you will not get your file provisioned. How, then, does SharePoint know how to create the _catalogs/masterpage directory? The plot thickens. More on that later.</p>
<p>The file for MWSdefault.master contains an attribute called Type with a value of GhostableInLibrary. This tells SharePoint that the file should be cached in a library and that you should be able to work with the file as you would any other file in a library. If you go to the masterpage gallery of a site you will notice that each masterpage is a file like any other in a library. This is because they are provisioned as GhostableInLibrary rather than just Ghostable. A Ghostable file, like default.aspx, does not reside in a library. GhostableInLibrary files have version history, created by and modified by properties, and any other column that the library provides. A simply Ghostable file one does not. A GhostableInLibrary file can be checked out, approved, deleted, and anything else a library file can. A simply Ghostable file can not. Bascially, if you want to work with a module provisioned file through the web interface, use GhostableInLibrary.</p>
<p>The last two sections of the onet.xml file are Components and ServerEmailFooter. The latter is self-explanatory, but the former is quite strange and potentially incredibly cool. It contains a FileDialogPostProcessor with an ID. What this actually is is a class that is used to modify the file open and save dialogs on a document library. You know, when you save a file from Office directly to a SharePoint site you get a cool web interface in the Save dialog? In the FileDialogPostProcessor you can declare a class that will modify that dialog web interface. Pretty obscure, even for this series, but I may cover it in a later article if there is sufficient interest.</p>
<p>Done with onet.xml, time for some patience reward again.</p>
<h4>Lists</h4>
<p>Before we really dive into the list template goodies I want to answer the question about where the list with type 101, the Document Library, resides.</p>
<p>The Document Library list type is actually a feature, located in the [12]\TEMPLATE\Features\DocumentLibrary folder. Go ahead and open that folder. The contents of that folder is the actual SharePoint feature. Open the feature.xml file at the root of the DocumentLibrary folder.</p>
<p><strong>feature.xml and element manifests</strong></p>
<p>Every feature that actually does something has at minimum two files, the feature definition file and one or more feature elements files. The first file, by convention called feature.xml, defines the configuration of the feature, such as the scope, ID, name, description and such.</p>
<p>The feature.xml does not actually do anything by itself, though, it only configures the feature and lists element files that should do the heavy lifting. In our case we have only one file, an element manifest, contained in our feature.xml. The location listed for the element manifest is relative to the root of the feature, and if you look in the root of our DocumentLibrary feature you will in fact find the file listed (ListTemplates\DocumentLibrary.xml). Open that file now and note that the documentlibrary.xml contains a ListTemplate element with a type of 101. Suddenly we now see where the list template type 101 gets created.</p>
<p>Still, there must be something more. I mean, where are all the columns and views and content types&#8230; We are getting closer to finding the treasure but we are not quite there yet.</p>
<p>Notice the name attribute of the ListTemplate element with a value of doclib. SharePoint uses the name of the template to search for an XML file called [name]\schema.xml in the root of the feature. So, it makes sense to look, in the DocumentLibrary root folder, for a folder named doclib containing a file called schema.xml. If you do there now you will find the main part of the list definition, the schema that defines almost everything about the list template. Open it now, and be prepared for the grand tour of list schemas.</p>
<p><strong>schema.xml</strong></p>
<p>Actually, there is not to much about the schema.xml. Sure, it looks scary because of its sheer mass, but if you break it down there are really not that many aspects to it. There is a List root element containing a MetaData element, and inside the MetaData section are only five elements that make up the entire list. Nothing scary at all.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/08/doclibschemaxml1.png"><img style="0px" src="http://sharepointmagazine.net/wp-content/uploads/2008/08/doclibschemaxml-thumb.png" border="0" alt="DocLib.Schema.xml" width="482" height="195" /></a></p>
<p>See how tiny it is? We&#8217;ll get through that in no time at all! Actually, we will go deeper into schema.xml in the third article of this series, so for now we will just skim through to grasp the basic outline of this file.</p>
<p><strong>ContentTypes</strong></p>
<p>The ContentTypes section contains content types or references to content types. We will go deeper into content types defined here in the third and fourth part of the series, but for now, I want to explain the difference between ContentType and ContentTypeRef. You see the ContentTypeRef variety references a site content type while the ContentType is a content type defined in the list. I know that may sound confusing, especially since <a href="http://msdn.microsoft.com/en-us/library/aa544130.aspx" target="_blank">the documentation</a> does not include anything to suggest that you can actually define a content type in a list, but you can, and the wss.xsd schema for schema.xml let&#8217;s you do so. We will come back to how this can be used to create some really powerful customization in part three.</p>
<p><strong>ListForms</strong></p>
<p>Next comes the Fields and the Views, but I would like to skip these for a moment and go the the Forms section. Open that now.</p>
<p>There are four forms in the Document Library schema.xml, and you may have heard these names before. As these are very relevant to the user experience I would like to spend a little time getting to know them. We will again come back to this in part three.</p>
<p>The three basic forms of a list item are DisplayForm, EditForm and NewForm, and I am going to assume you are smart enough to figure out which role each plays. What is relevant, though, is how these forms are created when we provision a list such as the document library. We will come back to that in great detail in part three, but for now, know that you can customize each of these forms just as you want. This means that you can have your default forms look and behave exactly how you want, including adding AJAX, custom field controls, visual elements, heck, you can even add a Tetris minigame half-way down the page to give your users a rest while they are editing an article.</p>
<p>If you look at the Form elements you find that the display and edit forms have a SetupPath attribute, as well as a Url attribute. The SetupPath works in the same way that the module SetupPath does, in that it references a file located somewhere in [12]\TEMPLATE. So, if you look in the [12]\TEMPLATE\pages directory you will find a form.aspx, again a rather plain vanilla ASPX page. This form.aspx is use to render the outline of the page used for entering, displaying and updating item data. However, note that there are no actual fields in the form.aspx file. The only thing even close to something unusual is the presence of a web part zone with an ID of Main. Strangely enough, this is also referenced in the Form element. How does all this add up?</p>
<p><strong>Content types and list forms</strong></p>
<p>All the forms can be configured on the list level, but what is also cool is that you can do this on the content type level as well. As I said earlier, we will explore content types in greater detail later, but the ability to connect a given form to the content type rather than where the information is stored gives you incredible control over the user experience. In fact, you have seen this in action plenty of times, but you may not have known how this actually works.</p>
<p>Every content type has a set of forms that matches the listforms. You may not have specified any particular form if you have written your own content types, but that only means that one is provided for you by inheritance. You see, every content type ultimately inherits from the Item content type, with an ID of 0&#215;01. Every content type you see or create will have 0&#215;01 in the beginning of its ID, meaning it inherits at least from the Item parent type.</p>
<p>The Item parent content type defines the default forms to be used for rendering the final form. By default all formtemplates are set to use a template called ListForm for rendering. I will show you where this is done later in this article.</p>
<p>The ListForm in turn is stored in a file called defaulttemplates.wscx, locaed in [12]\TEMPLATE\ControlTemplates. If you open that file and search for the rendering template with an ID of ListForm, you will see the actual code used to render any content type form that does not override the default forms.</p>
<p><strong>Fields</strong></p>
<p>Back to the fields section, and it is time to blow our minds a bit, because we are going to explore a slightly complex aspect of our list schema. Open up the fields section. You should see a lot of caml, with intermixed queries, XML, javascript, the lot.</p>
<p>Before you assume that this will get messy and you will never be able to create this by yourself, listen a bit longer. You see, most of the time you do not have to mess about with fields code by hand. I will show you, in part six, how to generate this code real easy. We will explore in greater depth the fields section in part three, however, you should know that you can do incredibly much with a field if you are willing to spend a little time learning the basics. In part three. And some more in part five. For now, close the entire fields section and start breathing again.</p>
<p>And now, for the final trick of the evening I will take ten years off your life from the shock you are about to receive. Be warned that you should notify your next of kin before reading on. Make sure you settle any scores, pay all your bills, and wear clean underwear. Behold, the most scary piece of any SharePoint list, the nightmare of many a SharePoint developer, the bane of projects small and large, I would like you to open:</p>
<p><strong>The Views Section!</strong></p>
<p>Still alive? No aching chest pains? No bright white light inviting you to enter?</p>
<p>SharePoint views are scary. Real scary. Sort of like a bunch of zombies outside your door, and all your shotgun shells are in the garage. Or, like a massive rumbling in the background when you are paddling down a river just as your only oar breaks clean off.</p>
<p>However, after the initial shock has resided, you will find that views are cool. And probably one of your most powerful tools for customizing the user experience. And don&#8217;t worry, we will cover a lot of the basics of views in part three. And, if you are really good, I will share with you some great techniques for creating views fast and easy in part six.</p>
<p>But know this, by the time we are finished exploring views you will know CAML like you know the back of your hand, or you will be in misery.</p>
<p>For now, close the views section. If you have loved ones, call them and let them know you are all right.</p>
<p>There really is only one more section of relevance in the schema.xml file, and it is not present in the document library schema, the Toolbar. However, the Toolbar element is covered to some extent in part three so we won&#8217;t go into that here.</p>
<h4>But wait, there is more!</h4>
<p>Ok, we have gone some depth into  a site and seen how the site it built, but we haven&#8217;t by far covered everything, and a few more things must be part of our exploration.</p>
<p>You see, we looked at the Document Library list template that we found in our Basic Meeting Workspace, or most any other out-of-the-box site template, but what about the other list templates? It would be logical that these were also features, just like Document Library, but now matter how hard you look, you will not find a feature that defines the Master Page library, the user information list, or the site-, webpart or list template galleries. These have list types of 116, 112, 111, 113, and 114 respectively.</p>
<p>We know these must be provisioned from somewhere because they are lists, just like any other list, but where are they located?</p>
<p>Not to mention the default.master page. That seems to appear out of nowhere, as none of our out-of-the-box site templates even mentions a module containing default.master.</p>
<p>And how are the &#8216;default&#8217; content types, such as Document and Folder actually provisioned? And the built-in fields such as Title and Modified by?</p>
<p><strong>Global site definition</strong></p>
<p>Well, there is one more place we have not looked yet. Actually, we were there for a short moment earlier, but we didn&#8217;t stop to see what was there. I am talking about the [12]\TEMPLATE\global directory where we found our mwsdefault.master. If you open that directory now you will indeed find something that resembles a site definition, including an XML directory containing an onet.xml file. Open that file and let your eyes feast on the secret of the remaining automatically deployed lists and files.</p>
<p>You will find, not only the list templates of the missing lists, but also a configuration with ID=&#8221;0&#8243; that activates two site features with IDs of CA7BD552-10B1-4563-85B9-5ED1D39C962A and 695B6570-A48B-4A8E-8EA5-26EA7FC1D162. If you search in your [12]\TEMPLATE\features folder for these two Ids you will find that they belong to the fields and ctypes features respectively. These features in turn contain fieldswss.xml that defines all the built-in fields and ctypeswss.xml that contain the default content types.</p>
<p>The global site definition is applied to every site definition. So, whenever we create a new definition we get the global definition and all its goodness for free. If we were to modify that definition, every new site created from that point on would have our modifications.</p>
<p>But we won&#8217;t do that since that voids our warranty and supportability, right? Just thought I&#8217;d let you know.</p>
<p><strong>Columns and fields</strong></p>
<p>Now, the final thing I want you to see are fields and columns. The terms are often mixed up, which can lead to some confusion. Fields are basically templates for columns, with a column being the field when it is added to a list or a content type. At least that is the way I use the terms. Fields are the text, multi-line, date/time, yes/no, choice value that you can select when you add a new column to a list or a content type. Columns are instantiations of these fields, such as Title, Modified, Created by, etc.</p>
<p>You can think of fields in much the same way as a site or list template, and columns much in the same way as a site and list. Just as a site template, say the STS teamsite template, becomes a site that you can name almost whatever you want, a field, say Text, becomes a column that you can name almost whatever you want. The doclib, or document library list template becomes a list named Shared Documents.</p>
<p>The fields, even the built-in fields such as text, multi-line text, date/time, and choice, are defined through XML. This means that you can add new field types or even, if you are crazy enough, change the default types. I will show you a whole lot more on fields in part five where we will also dive into how we can create new fields that completely changes how the user enters data and thus their experience of how SharePoint works.</p>
<p>For now we wont go into too much detail, but I would like you to know where you can find the built-in fields. A second reason for why I will not go through this like I have done with the other files is that I would like to give you some homework. More on that in a few moments.</p>
<h4>Wrapping your head around all this</h4>
<p>I realize that there may be plenty of stuff here that seems overwhelming. I know, I felt the same thing when I started going deep into the SharePoint model. And to scare you a bit more, even though we have looked at a great deal in this article we have only barely scratched the surface. And even if we will dive quite deep into some of these topics in the later articles we have still only looked at the user experience. There is a lot to learn about SharePoint, in the sense that there are a lot of atoms in the universe.</p>
<p>I would like to offer you some advice, though, on how to cope with all this.</p>
<p><strong>1. SharePoint is a platform, not a product</strong></p>
<p>If you think of SharePoint more as a platform than as a finished, turnkey product it will likely be easier to understand how everything fits together. Forget the teamsite, forget the basic meeting workplace, forget the default content types, lists, and everything, and start thinking of these things as demonstrations that Microsoft has provided for you. What are they demonstrating? SharePoint as a platform. Everything you see is built on that platform, and if you start to see how they built these things, using only tools that are available to you as well, you will see how powerful SharePoint really is.</p>
<p><strong>2. Get a good reference</strong></p>
<p>Every good developer knows that they do not know everything. Even the most dedicated senior developers and architects cannot know every intricate detail about every attribute of every element of every schema. What you should lean, right away, is how to find information. The best developers I know are not those who know everything, but those who can find and understand information quickly. The secret tool of a good developer? Get a good reference.</p>
<p>The best reference for SharePoint I know is the SDK. Granted, there are a lot of missing stuff there, and some things are even plain wrong, but the majority of the SDK is good. Get the SDK today and familiarize yourself with it. You can view it online at <a title="http://msdn.microsoft.com/en-us/library/ms441339.aspx" href="http://msdn.microsoft.com/en-us/library/ms441339.aspx">http://msdn.microsoft.com/en-us/library/ms441339.aspx</a> or download it from the same address. The download link is in the first section of the Community Content.</p>
<p><strong>3. Learn how a feature works, don&#8217;t copy what everyone else does</strong></p>
<p>There are plenty of more-or-less turnkey solutions for SharePoint out there. You can basically get most anything at least semi-done by googling and copying what someone else has already done. In my blog I intentionally write non-production code, with the notable exception of the <a href="http://furuknap.blogspot.com/2008/07/send-sharepoint-document-library-file.html" target="_blank">Send Document Library file as email</a> solution I wrote for a forum user, and I do this because I want to teach the users how something works rather than giving them something they can copy-and-paste but not understand at all.</p>
<p>Resist the urge to copy code. You may be productive and deliver a solution, but you wont know how or what the heck you are doing. Take the time to learn how a feature works. Why does the author add this or that, how will this be rendered to the user, where does this information go when I updated the item? In the long run you will be a far better developer and create far more stable and supportable solutions.</p>
<h4>Homework</h4>
<p>To prove a point, as mentioned, I would like to offer you an exercise to do before the next part of this series. Don&#8217;t worry, you wont get graded and if you skip this it won&#8217;t go on your permanent record. It is simply an exercise to help you find information and explore a bit on your own.</p>
<p>The built-in fields of SharePoint are located in [12]\TEMPLATE\XML, in a file called FLDTYPES.XML. Use the SDK link I showed you above and go through this file and look up the elements that make up a field. Don&#8217;t worry about the details of the rendering templates, we will get to those later. For now, understand what the elements do. We will come back to these fields in part five of this series.</p>
<h4>Conclusion</h4>
<p>This has been a long journey, but we have only just begun investigating how everything works. We have gone from the top down, exploring how sites are built, how lists work, how lists are rendering using information both from the list and the content type attached to that list, and a short tour by the fields and columns. Our focus has been on understanding the schemas of these elements because the schemas give us a glimpse into how a SharePoint site work.</p>
<p>Next week we will go into some completely new stuff when we explore techniques such as overriding rendering templates that can be used to modify the default user experience without voiding your warranty.</p>
<p>You can take a deep breath now. We are done. See you next time.</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointmagazine.net/technical/development/customizing-the-user-experience-of-sharepoint-overview-of-the-default-sharepoint-interface-from-a-technical-point-of-view-part-1-of-6/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Developing a Custom Master Page (Master Pages and SharePoint part 3 of 6)</title>
		<link>http://sharepointmagazine.net/technical/customisation/developing-a-custom-master-page-master-pages-and-sharepoint-part-3-of-6</link>
		<comments>http://sharepointmagazine.net/technical/customisation/developing-a-custom-master-page-master-pages-and-sharepoint-part-3-of-6#comments</comments>
		<pubDate>Mon, 06 Oct 2008 10:30:55 +0000</pubDate>
		<dc:creator>ggalipeau</dc:creator>
				<category><![CDATA[Customisation]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[Branding]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Customization]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[master]]></category>
		<category><![CDATA[Master Page]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[sharepoint]]></category>
		<category><![CDATA[SharePoint Designer]]></category>

		<guid isPermaLink="false">http://sharepointmagazine.net/?p=749</guid>
		<description><![CDATA[This is the third article in a six-part series on ASP.NET Master Pages and SharePoint. In the previous two articles of this series we discussed master pages and how SharePoint uses them to create it's out of the box pages. Now that we have an understanding of how master pages work and how SharePoint uses them, we can start showing how to develop custom master pages. In this article we are going to concentrate on editing master pages in SharePoint Designer. ]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>This is the third article in a six-part series on ASP.NET Master Pages and SharePoint.</p>
<ol>
<li><a href="http://sharepointmagazine.net/technical/development/introduction-to-master-pages">Introduction to Master Pages</a>.</li>
<li><a href="http://sharepointmagazine.net/technical/development/examining-the-out-of-the-box-master-pages-in-sharepoint">Examining the out of the box Master Pages in SharePoint</a>.</li>
<li><strong>Developing a custom Master Page for SharePoint.</strong></li>
<li>Options to deploy a Master Page for a production ready system.</li>
<li>Customizing the Application.master Page.</li>
<li>Incorporating a Master Page into a SharePoint site definition</li>
</ol>
<p>In the previous two articles of this series we discussed master pages and how SharePoint uses them to create it&#8217;s out of the box pages. Now that we have an understanding of how master pages work and how SharePoint uses them, we can start showing how to develop custom master pages.</p>
<p>There are two supported scenarios for customizing master pages in SharePoint:</p>
<ol>
<li>Edit the master page in SharePoint Designer</li>
<li>Create a custom master page and upload it to the master page gallery</li>
</ol>
<p>Please notice that modifying the existing master page file is not one of the supported options. Microsoft rarely supports changing files in SharePoint unless it is done from SharePoint Designer.</p>
<p>In this article we are going to concentrate on the &#8220;Edit the master page in SharePoint Designer&#8221; option. This will show us how to develop a custom master page. In the next article we will learn how to deploy this custom master page for a production ready system.</p>
<h2>UnGhosting (Customizing)</h2>
<p>When a new site in SharePoint is created it uses the default.master for its master page, which is located at %Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\Global.</p>
<p><strong>Note</strong>: This is true for WSS team sites and standard MOSS team sites (MOSS publishing sites might use a different master page to start with).</p>
<p>SharePoint keeps a reference to this one file no matter how many sites are created. This is a process called Ghosting, or Uncustomized. Thus, every site collection and/or site in SharePoint point to one file.</p>
<p>If a master page is customized in SharePoint Designer, SharePoint stores a modified version of the master page in the content database (this is a technique called &#8220;Unghosting&#8221; or &#8220;Customizing&#8221;). This process basically breaks the reference SharePoint keeps to the default.master file on the 12 hive. The reason for this is that changes will not affect the other content pages that refer to it.</p>
<p>SharePoint Designer can&#8217;t modify the default.master page in the 12 hive because it would modify a file that multiple site collections and/or sites use. Instead, it goes through the &#8220;UnGhosting&#8221;, or &#8220;Customizing&#8221;, process. This is the process of removing the link to the 12 hive and making a copy of the default.master in the content database.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/ghostedunghosted.jpg"><img class="alignnone size-medium wp-image-750" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/ghostedunghosted-300x108.jpg" alt="" width="300" height="108" /></a></p>
<h2>SharePoint Designer</h2>
<p>SharePoint Designer knows about the SharePoint architecture. Since the SharePoint architecture is a mixture of physical files (on the 12 hive) and content (from the database), a web design tool for SharePoint must know about this architecture. SharePoint Designer is the only tool currently available that knows about this architecture. SharePoint Designer knows how to render the structure of the SharePoint site and how to allow for changes using the UnGhosting, or Customizing, techniques.</p>
<p>To modify a master page in SharePoint Designer first open SharePoint Designer on your SharePoint box. Next open the SharePoint site by going to File &#8211; Open Site. In the Site Name field put the url to the home page of your SharePoint site, without the actual page in it (i.e.: don&#8217;t keep default.aspx in the string).</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/opendesignersite.jpg"><img class="alignnone size-medium wp-image-754" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/opendesignersite-300x187.jpg" alt="" width="300" height="187" /></a></p>
<p>After you open a site in SharePoint Designer, Designer will create the folder structure for the SharePoint site:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/designerfolderlist.jpg"><img class="alignnone size-medium wp-image-755" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/designerfolderlist.jpg" alt="" width="202" height="191" /></a></p>
<h2>Create a new master page</h2>
<p>The master page gallery is located in the _catalogs folder. Within the master page gallery you will find the default.master page. You can modify this file directly, but it is good practice to make a copy of this file and modify the copied file. I am going to call this copied master page &#8220;customDefault.master&#8221;.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/designerfolderlistwithmasterpageopen.jpg"><img class="alignnone size-medium wp-image-757" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/designerfolderlistwithmasterpageopen.jpg" alt="" width="204" height="257" /></a></p>
<p>After you make a copy of the master page, the content pages will not know that this is the master page they should use. So, default.aspx is the content page. And if you open default.aspx in SharePoint Designer, you will notice this in the upper right corner:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/defaultpagemasterpagepointer.jpg"><img class="alignnone size-medium wp-image-758" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/defaultpagemasterpagepointer.jpg" alt="" width="212" height="32" /></a></p>
<p>Notice that it is still pointing to the default.master page. If you want it to point to the new customDefault.master page, then right click on customDefault.master (in the Folder List) and choose &#8220;Set as Default Master Page&#8221;. After doing this, open the default.aspx page again and notice that the master page referenced changed:</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/designerfolderlistwithcustommasterpageopen.jpg"><img class="alignnone size-medium wp-image-756" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/designerfolderlistwithcustommasterpageopen.jpg" alt="" width="234" height="21" /></a></p>
<p>So, why does this reference pointer change, but the MasterPageFile still points to default.master (MasterPageFile=&#8221;~masterurl/default.master&#8221;). The reason is dynamic tokens. SharePoint replaces &#8220;masterurl/default.master&#8221; with the dynamic token value at run time. The reference pointer we are seeing is that dynamic token. So, when you click &#8220;Set as Default Master Page&#8221; in SharePoint Designer, you are changing the dynamic token for the SharePoint site. For more information on dynamic tokens, refer to the second article in this series &#8211; <a href="http://sharepointmagazine.net/technical/development/examining-the-out-of-the-box-master-pages-in-sharepoint">Examining SharePoint Master Pages</a>.</p>
<h2>Customize the customDefault.master</h2>
<p>Open up the new customDefault.master page. If you are using MOSS, SharePoint Designer might ask you to check it out at this point. If you are in WSS, you shouldn&#8217;t have to check the file out.</p>
<p>SharePoint Designer has three different modes for customization:</p>
<ol>
<li>Design &#8211; WYSIWYG editor</li>
<li>Code &#8211; html editor</li>
<li>Split &#8211; keeps the design and code modes open</li>
</ol>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/splitcodemode.jpg"><img class="alignnone size-medium wp-image-759" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/splitcodemode.jpg" alt="" width="172" height="57" /></a></p>
<p>I prefer to keep SharePoint Designer in split or code mode. The reason is that when you customize a SharePoint master page you have to be careful where you put customizations. If you place a customization in a ContentPlaceHolder, there is a chance the customization won&#8217;t show on the final page because the implementing content page might take care of filling in the particular ContentPlaceHolder. So, if you make changes in design mode, it is beneficial to see what is happening in the html.</p>
<p>So, let&#8217;s make some customizations so you can see some things that can be done.</p>
<h3>Create a footer</h3>
<ol>
<li>Find the tag &lt;/Body&gt; in your code view and put your cursor right before it.</li>
<li>Type the some footer text &#8211; ex: Copywrite RDA all rights reserved 2008.</li>
<li>Wrap the footer text in a div tag.</li>
<li>Set a class to the div tag. For example purposes we can use an out of the box css class from SharePoint</li>
<p>&lt;div class=&#8221;ms-CommentFooter&#8221;&gt;Copywrite RDA all rights reserved 2008&lt;/div&gt;</p>
<li>Save the file.</li>
<p><strong>Note</strong>: SharePoint Designer should give you a popup telling you that you are about to UnGhost, or Customize, your SharePoint master page. This is your warning that you are going to break that reference to the 12 hive and make a separate master page in the content database. Click Yes.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/unghostwarning.jpg"><img class="alignnone size-medium wp-image-761" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/unghostwarning-300x99.jpg" alt="" width="300" height="99" /></a></p>
<li>Optional: if you are in MOSS, you might have to check the file back in at this point. Right click on the customDefault.master in the Folder list and choose &#8220;Check In&#8221;.</li>
<li>Open your site in your web browser to see the change.</li>
</ol>
<h3>Create a new style</h3>
<p>Our footer example uses the out of the box &#8220;ms-CommentFooter&#8221; for our css class. This example will show you how to change that to one of your own custom css classes.</p>
<ol>
<li>Change &#8220;ms-CommentFooter&#8221; to &#8220;custom-footer&#8221; in the code view</li>
<p>&lt;div class=&#8221;custom-footer &#8220;&gt;Copywrite RDA all rights reserved 2008&lt;/div&gt;</p>
<li>Select the &#8220;new style&#8221; link from the Apply Styles toolbar on the right</li>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/applystyles.jpg"><img class="alignnone size-medium wp-image-763" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/applystyles-157x300.jpg" alt="" width="157" height="300" /></a></p>
<li>Set the properties of the style
<ul>
<li>Selector = .custom-footer</li>
<li>Font
<ul>
<li>Font-family = Verdana</li>
<li>Font-size = x-small</li>
<li>Font-style = italic</li>
</ul>
</li>
</ul>
</li>
<li>Click Ok on the style popup</li>
<li>Save the file</li>
<li>Optional: if you are in MOSS, you might have to check the file back in at this point. Right click on the customDefault.master in the Folder list and choose &#8220;Check In&#8221;.</li>
<li>Open your site in a web browser to see the changes</li>
</ol>
<h3>Modify a SharePoint Control</h3>
<ol>
<li>Find the top menu in the code view</li>
<p>&lt;SharePoint:AspMenu<br />
ID=&#8221;TopNavigationMenu&#8221;sdgds<br />
&#8230;</p>
<li>Change the Orientation to Vertical</li>
<p>Orientation=&#8221;Vertical&#8221;</p>
<li>Save the file</li>
<li>Optional: if you are in MOSS, you might have to check the file back in at this point. Right click on the customDefault.master in the Folder list and choose &#8220;Check In&#8221;.</li>
<li>Open your site in a web browser to see the changes. Your menu control should be vertical now.</li>
</ol>
<p><em>(Please not the intent of the above change is to show that the out of the box SharePoint controls can be changed. I understand that the actual change we made is not user friendly).</em></p>
<h3>Modify out of the box css classes</h3>
<ol>
<li>Find the text &#8220;ms-globalbreadcrumb&#8221; in the code.</li>
<li>Right click on it.</li>
<li>Click &#8220;Follow Code Hyperlink&#8221;
<ul>
<li>a. It will take you to one of the sections for this css class</li>
<li>b. The section right above it contains the code for the background color.</li>
<li>c. Change the background color to #000000</li>
</ul>
</li>
<blockquote><p>.ms-globalbreadcrumb{<br />
font-size:8pt;<br />
text-align:right;<br />
background-color:#000000;<br />
padding:2px 10px 2px 5px;<br />
}</p></blockquote>
<li>Save the css file</li>
<p><strong>Note</strong>: SharePoint Designer should give you a popup telling you that you are about to UnGhost, or Customize, your css file. This is your warning that you are going to break that reference to the 12 hive and make a separate css file in the content database. Click Yes.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/unghostwarning.jpg"><img class="alignnone size-medium wp-image-761" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/unghostwarning-300x99.jpg" alt="" width="300" height="99" /></a></p>
<li>Open your site in a web browser to see the changes. The top bar should be black now.</li>
</ol>
<p><em>(Please not the intent of the above change is to show that the out of the box SharePoint controls can be changed. I understand that the actual change we made is not user friendly).</em></p>
<p><em></em></p>
<h2>Be careful with your power</h2>
<p>These are just a few examples of some customizations that can be done to the master page through SharePoint Designer. The customizations you can do are endless. However, you must be careful that you do not customize something that is required for SharePoint to work.</p>
<p>Some examples of controls you don&#8217;t want to remove are:</p>
<ul>
<li>Site Actions</li>
<li>Search (if you want search capabilities)</li>
<li>Navigation menus (unless you want to replace them with your own navigation)</li>
<li>Etc&#8230;</li>
</ul>
<p>Also, be careful where you make your changes. In the previous articles we talked about how making changes to content within ContentPlaceHolders might get overridden by the implementing content page. Thus, if you make a change to a ContentPlaceHolder, you might not see it on your page. My recommendation is to put SharePoint Designer into Split mode or Code mode so you can edit the html directly and you can be sure that you are not editing html within ContentPlaceHolders.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/splitcodemode.jpg"><img class="alignnone size-medium wp-image-759" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/splitcodemode.jpg" alt="" width="172" height="57" /></a></p>
<p>And remember; don&#8217;t remove any of the ContentPlaceHolders. The content pages in SharePoint already have references to these place holders. If you remove them the content pages might break.</p>
<h2>Undo your Customizations</h2>
<p>After making the change notice the default.master in the folder list on the left side. It now has a symbol next to it. If you mouse over that symbol it will tell you that the page has been customized. This is telling you that you have UnGhost, or Customized, this page at one point.</p>
<p><a href="http://sharepointmagazine.net/wp-content/uploads/2008/09/customizedmouseover.jpg"><img class="alignnone size-medium wp-image-767" src="http://sharepointmagazine.net/wp-content/uploads/2008/09/customizedmouseover.jpg" alt="" width="196" height="240" /></a></p>
<p>If you decide that you made a mistake by UnGhosting, or Customizing, your file &#8211; then you can undo your changes by &#8220;re-Ghosting&#8221; the file. To do this, right-click on the default.master file and choose &#8220;Reset to Site Definition&#8221;.</p>
<h2>SharePoint Designer Pros</h2>
<p><strong>Easy</strong> &#8211; SharePoint designer provides an easy experience to customize SharePoint master pages. Any user with html experience should be able to use SharePoint designer to make changes to a master page. As the steps above show &#8211; you can just open your master page up, make your changes and then save your changes in SharePoint Designer.</p>
<p><strong>UI experience</strong> &#8211; SharePoint designer gives you a WYSIWYG (what you see is what you get) UI experience. This means you can make changes to the website through an interface that looks like the website. The other techniques we are going to mention do not allow for this.</p>
<h2>SharePoint Designer Cons</h2>
<p><strong>Unghosting/Customizing</strong> &#8211; the Unghosting, or Customizing, technique keeps all changes scoped to the respective site collection. There is no real way to point the master page to another site collection. This can hurt maintainability if you are creating multiple site collections on one SharePoint box and want to keep a consistent master page.</p>
<p><strong>Not Deployable</strong> &#8211; SharePoint Designer forces you to make changes directly against a SharePoint site collection. This makes it hard to move from a development, to QA, to production environment. This also makes it so the customized master page cannot be used against multiple site collections.</p>
<h2>Conclusion</h2>
<p>SharePoint Designer provides us a quick way to customize master pages in SharePoint. This is a great tool to design master pages and/or customize an existing SharePoint site. However, SharePoint Designer does not provide a clear deployment path for projects using a development lifecycle. The next article in this series will show how to create custom master pages that can be uploaded to any SharePoint site for easy deployments.</p>
]]></content:encoded>
			<wfw:commentRss>http://sharepointmagazine.net/technical/customisation/developing-a-custom-master-page-master-pages-and-sharepoint-part-3-of-6/feed</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>
