<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Microsoft Enterprise Content Management (ECM) Team Blog : How To</title><link>http://blogs.msdn.com/ecm/archive/tags/How+To/default.aspx</link><description>Tags: How To</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Building a real world extranet application with MOSS 2007 (Part 2 of 3)</title><link>http://blogs.msdn.com/ecm/archive/2007/03/07/building-a-real-world-extranet-application-with-moss-2007-part-2-of-3.aspx</link><pubDate>Wed, 07 Mar 2007 08:43:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1824959</guid><dc:creator>ecmblog</dc:creator><slash:comments>10</slash:comments><comments>http://blogs.msdn.com/ecm/comments/1824959.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ecm/commentrss.aspx?PostID=1824959</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ecm/rsscomments.aspx?PostID=1824959</wfw:comment><description>&lt;p&gt;&lt;b&gt;Introduction&lt;/b&gt;&lt;/p&gt; &lt;p&gt;In the &lt;a href="http://blogs.msdn.com/ecm/archive/2007/02/17/building-a-real-world-extranet-application-with-moss-2007-part-1-of-3.aspx"&gt;first installment&lt;/a&gt; of this blog series, we introduced the project and its requirements and started creating the basic site and content structure. In this installment, we’ll cover the customization and branding choices that we made, venture into the slightly gray areas that needed some additional thinking, and discuss some of our “off the beaten path” customization tactics. &lt;p&gt;&lt;b&gt;Site and content customization (i.e. branding)&lt;/b&gt; &lt;p&gt;The new file management system was to replace an existing model, which users were already familiar with. This coupled with the fact that an already well established corporate brand existed meant that creating a consistent and familiar experience would be very important towards encouraging speedy user adoption of and efficient transition to the new system. &lt;p&gt;Once the UI was established visually, we began the process of matching best practices with both customer requirements and the new MOSS 2007 design and development experience.&lt;/p&gt; &lt;p&gt;The customization process was divided into two major sections in an attempt to offer maximum scalability while separating the majority of presentation from the content and code base.&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Master Page Customization&lt;/li&gt; &lt;li&gt;Cascading Style Sheet Customization&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;b&gt;The art of creating a custom Master Page in MOSS 2007&lt;/b&gt; &lt;p&gt;MOSS 2007 adopted the ASP.NET 2.0 master pages model, a model which allows you to separate the chrome (UI elements) from the content. The second major benefit of using master pages in MOSS 2007 is that you can control the UI of a site or entire site collection with a single page, the master page.&lt;/p&gt; &lt;p&gt;&lt;i&gt;Before creating our custom Master Page, it was important for us to fully understand the following concepts:&lt;/i&gt;&lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;b&gt;Content Place Holders and Content Controls, and how they are used in MOSS 2007&lt;/b&gt;&lt;/li&gt; &lt;ul&gt; &lt;li&gt;There are several pages behind a rendered page that you would see in SharePoint. The Master Page which holds the UI chrome as well as content place holders where content can later be “plugged in” from other pages. These other pages, known as Content Pages have Content Controls with IDs matching those on the placeholders in the master page.&lt;/li&gt; &lt;li&gt;When requested, the content from the Content Control is merged into the Content Place Holder of the Master Page, finally presenting you with a single rendered page. Understanding this concept is very important when customizing a Master Page because removal of a content place holder that is later called on will result in an error. It’s important the content place holders exist on the page – even if not visible. For a list of content place holders, which reside in the default Master Page of a SharePoint site, see &lt;a href="http://msdn2.microsoft.com/en-us/library/ms467402.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ms467402.aspx&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt; &lt;li&gt;&lt;b&gt;Creating a minimal Master Page&lt;/b&gt;&lt;/li&gt; &lt;ul&gt; &lt;li&gt;Unlike standard design, there is no blank slate from which to start a site in SharePoint. There is no magic “File New” button in SharePoint Designer 2007 that will allow you to just begin coding your UI and have the SharePoint functionality just work. Instead, you will need to understand how to work with SharePoint’s default Master Page and to minimize it by leaving only the placeholders that are required for SharePoint to function. Luckily for us, MSDN has been kind enough to post a minimal Master Page complete with comments, which you can use as a starting point for your own sites: &lt;a href="http://msdn2.microsoft.com/en-us/library/aa660698.aspx"&gt;http://msdn2.microsoft.com/en-us/library/aa660698.aspx&lt;/a&gt;.&lt;/li&gt;&lt;/ul&gt;&lt;/ul&gt; &lt;p&gt;Armed with information on the preceding topics and the tool of choice, SharePoint Designer 2007, we set out to create our custom branded application. SharePoint Designer 2007 allows you to connect to and work with your SharePoint sites, so the first thing we did was fire up SharePoint Designer 2007 and connected to our site via the &lt;i&gt;File, Open Site menu.&lt;/i&gt; &lt;p&gt;MOSS 2007 introduces a new concept of “publishing features”. Publishing features represent the CMS 2002 integration into SharePoint, now known as Web Content Management or WCM. When enabled, publishing features allow you to do things like enable content approval workflow or change the Master Page and style sheet on the fly, both of which we utilized and proved useful in creating a custom branded application. &lt;p&gt;After combining our custom UI (graphics and code) with the minimal Master Page from MSDN, we uploaded our custom Master Page to the _catalogs/masterpage folder. This is a good time to point out that with a blank starting Master Page (and page layouts), we were able to vastly reduce the number of tables, and take advantage of our CSS based UI. &lt;p&gt;After uploading our custom Master Page, we added some final tweaks such as adding the company logo to the Master Page. While there is an out of the box method for adding a logo (Site Settings &amp;gt; Title, Description and Icon), doing this does not automatically carry the logo down to new sub-sites as they are created; instead, you would need to re-specify the logo on each site. This is by design just in case you want to specify a different logo on the subsites, which normally makes perfect sense, but in our project, a requirement was that all sites are to be created using the parent company’s corporate logo unless otherwise specified. To accomplish this, we created a custom picture library labeled “site images” and uploaded the corporate logo (named companylogo.gif) to the library. Next we replaced the default mechanism for switching the logo in the Master Page:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;lt;SharePoint:SiteLogoImage id="onetidHeadbnnr0" LogoImageUrl="/_layouts/images/titlegraphic.gif" runat="server"/&amp;gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;replacing it with some key new functionality in SharePoint 2007:&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&amp;lt;asp:Image runat="server" id="Logo" ImageUrl="&amp;lt;% $SPUrl: ~site/site images/companylogo.gif %&amp;gt;"/&amp;gt; &lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;What this change does is tell the image control to check in the site’s site images library for companylogo.gif. Because this is specified in the Master Page, the change is seen on subsites, which inherit this Master Page. Also, because we have specified the “site” site images library in SPURL, changing the company logo on a sub site is simply a matter of over writing the default companylogo.gif image in the specific site's site images library. We mimicked this approach when adding a header image to the page, allowing even further customization on a site by site basis.&lt;/p&gt; &lt;p&gt;To apply our custom Master Page, we went to the root site's Site Settings, Master Page section where we were able to select and apply it to the site and subsites right from the browser, completely transforming the UI into an intuitive and branded application. &lt;p&gt;&lt;b&gt;Separating the presentation&lt;/b&gt; &lt;p&gt;To separate the content, mark-up, and presentation as much as possible, we opted to use the alternate style sheet approach. By default, the core style sheet, appropriately named CORE.CSS controls the majority of the sites, colors, fonts, and positioning. &lt;p&gt;To over-ride these default values, we took advantage of the “AlternateCSS”, an option which can be specified from the browser under Site Settings, Master Page, Specify “AlternateCSS” URL. &lt;p&gt;We started by creating a blank style sheet and saving it to the style library, a library created by default with all publishing portals. After adding our style sheet and specifying it using the method described above, any styles/properties we add which exist in the default (CORE.CSS) will be overwritten because our alternate style sheet is read last. &lt;p&gt;To figure out what classes we needed to override, we took advantage of a free tool from Microsoft’s Internet Explorer Team, the Internet Explorer Developer Toolbar.&amp;nbsp;Download the beta &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=E59C3964-672D-4511-BB3E-2D5E1DB91038&amp;amp;displaylang=en" target="_blank"&gt;here&lt;/a&gt;.  &lt;p&gt;Using the “Select Element by Click” option in the IE Developer Toolbar, we were able to click on any element of our screen and instantly see what class should be changed in our alternate style sheet. In the example below, we clicked on the Recycle Bin link. &lt;p&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="221" alt="IE Developer Toolbar" src="http://blogs.msdn.com/blogfiles/ecm/WindowsLiveWriter/Buildingarealworldextranetapplicationwit_126C6/clip_image002%5B1%5D.jpg" width="624" border="0"&gt; &lt;p&gt;In the example above, we could add .ms-recyclebin to the alternate style sheet to change its properties. Tip: Make sure you copy all properties specified in the CORE.CSS; otherwise, they will not be overwritten. &lt;p&gt;Using “AlternateCSS”, we were able to isolate the presentation to a single style sheet, overriding the default styles when applied.  &lt;p&gt;Because subsites can be set to inherit the Master Page and alternate style sheets of their parent, this method also allows for sweeping brand changes by editing a single file. Just as it can be set to inherit, you can also choose not to in which case subsites are free to use a completely different Master Page or style sheet. &lt;p&gt;In this installment, we covered the key customization methods which allowed us to brand our sites as well as keep a familiar and intuitive UI for our application. In the next and final installment, we will take a look at Search as well as how we overcame multilingual obstacles before wrapping up with a look at our template system and our finished product. We'll also provide a summary of the MOSS 2007 specific features that were utilized for our project. &lt;p&gt;&amp;nbsp; &lt;p&gt;Shane Perran – User Experience Lead, SharePoint MVP&lt;br&gt;Jared Rypkema – Lead Software Architect&lt;br&gt;&lt;a href="http://www.infotechcanada.com/"&gt;Infotech Canada&lt;/a&gt; | Information Worker Solutions &lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1824959" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ecm/archive/tags/Web+Content+Management/default.aspx">Web Content Management</category><category domain="http://blogs.msdn.com/ecm/archive/tags/branding/default.aspx">branding</category><category domain="http://blogs.msdn.com/ecm/archive/tags/Master+Page/default.aspx">Master Page</category><category domain="http://blogs.msdn.com/ecm/archive/tags/Customer+Evidence/default.aspx">Customer Evidence</category><category domain="http://blogs.msdn.com/ecm/archive/tags/How+To/default.aspx">How To</category></item><item><title>Customizing Content Query RSS feeds</title><link>http://blogs.msdn.com/ecm/archive/2006/12/09/customizing-content-query-rss-feeds.aspx</link><pubDate>Sat, 09 Dec 2006 03:59:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1242810</guid><dc:creator>ecmblog</dc:creator><slash:comments>18</slash:comments><comments>http://blogs.msdn.com/ecm/comments/1242810.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ecm/commentrss.aspx?PostID=1242810</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ecm/rsscomments.aspx?PostID=1242810</wfw:comment><description>&lt;P&gt;One of the great features of the Content Query web part is that, once you configure it and have it showing the content that you want, you can have it emit an RSS feed of the same content.&amp;nbsp; So, if you have a Content Query web part showing the latest news articles published on the site, you can offer readers an RSS feed of this same content for them to subscribe to.&lt;/P&gt;
&lt;P&gt;One question that comes out of this is, "How can I change the output of the RSS feed?"&amp;nbsp; For example, let's say you want to emit a different column of your data as the feed item title or description.&amp;nbsp; Or, let's say you wanted to offer the feed in a different format, such as Atom.&lt;/P&gt;
&lt;P&gt;Let's first take a closer look at the feed that is emitted by the Content Query web part.&amp;nbsp; Here, I have a CQWP showing the latest news articles on my site, and it has a feed enabled.&amp;nbsp; By the way, to enable a feed on a Content Query web part, simply edit the web part, expand the Presentation section, and check the Enable Feed box.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/1242813/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/1242813/original.aspx"&gt;&lt;/P&gt;
&lt;P&gt;If I click through to the feed, I see a preview of it in IE7, and I can subscribe to it from here.&amp;nbsp; The URL of the feed in this case is http://&amp;lt;servername&amp;gt;/_layouts/feed.aspx?xsl=1&amp;amp;web=%2FNews%2FEnglish&amp;amp;page=fe5ab523-46d2-4285-a095-d590ca8975a5&amp;amp;wp=4144557a-1f5e-4ebf-9ec7-9b1525df1e43&lt;/P&gt;
&lt;P&gt;The query string parameters after the feed.aspx page are the key here.&amp;nbsp; They are:&lt;/P&gt;
&lt;TABLE class="" border=1 cellSpacing=0 cellPadding=0&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=205&gt;
&lt;P&gt;&lt;B&gt;Parameter name&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=207&gt;
&lt;P&gt;&lt;B&gt;Description&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=179&gt;
&lt;P&gt;&lt;B&gt;Valid values&lt;/B&gt;&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=205&gt;
&lt;P&gt;Xsl&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=207&gt;
&lt;P&gt;The xsl to use to produce the feed&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=179&gt;
&lt;P&gt;Registered xsls in the web.config file&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=205&gt;
&lt;P&gt;Web&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=207&gt;
&lt;P&gt;The web where the CQWP lives that is emitting this feed&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=179&gt;
&lt;P&gt;Server-relative url&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=205&gt;
&lt;P&gt;Page&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=207&gt;
&lt;P&gt;The page where the CQWP lives that is emitting this feed&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=179&gt;
&lt;P&gt;GUID&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=205&gt;
&lt;P&gt;Wp&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=207&gt;
&lt;P&gt;The CQWP ID&lt;/P&gt;&lt;/TD&gt;
&lt;TD class="" vAlign=top width=179&gt;
&lt;P&gt;GUID&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P mce_keep="true"&gt;Feed.aspx effectively "looks up" the Content Query web part that is emitting the feed, figures out the query it runs, runs the same query, but instead of outputting HTML, it outputs feed xml by using the XSL in question.&lt;/P&gt;
&lt;P&gt;Now, you may be wondering what "XSL=1" is referring to.&amp;nbsp; That's not a path to an XSL file.&amp;nbsp; Instead of feed.aspx supporting the ability to run XSLs here, we wanted to make it something that the admin could manage.&amp;nbsp; So, only XSLs that are registered in the web.config file can be used by feed.aspx.&amp;nbsp; Looking at the web.config for this site, you'll find the following line:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;appsettings&amp;gt;
&amp;nbsp;...
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add key="FeedXsl1" value="/Style Library/Xsl Style Sheets/Rss.xsl" &amp;gt;
&amp;nbsp;...
&amp;lt;/appsettings&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is the out of box registered XSL.&amp;nbsp; You'll notice it lives in the Style Library, right next to the XSLs used to render content in the Content Query web part.&lt;/P&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/1242815/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/1242815/original.aspx"&gt;&lt;/P&gt;
&lt;P&gt;If I wanted to have my own XSL be used for CQWP RSS feeds, I could do a couple of things.&amp;nbsp; First, I could edit this XSL file.&amp;nbsp; Then, all CQWPs would use this updated XSL file to render the feeds.&amp;nbsp; However, if I want something custom that pertains to just one Content Query web part, it makes more sense to add my own XSL file.&lt;/P&gt;
&lt;P&gt;To do that, you need to do the following:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;1. First, add the XSL file that you want your Content Query web part to use for the feed in the Style Library. You can place it in the same folder as the out-of-box rss.xslt.&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/1242819/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/1242819/original.aspx"&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;2. Next, add a line to the web.config file to register this XSLT file. The important thing is what number(s) or letter(s) you use after the "FeedXsl" token. I'm going to stick to numbers, so I'll use a "2":&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;appSettings&amp;gt;
&amp;nbsp;...
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;add key="FeedXsl1" value="/Style Library/Xsl Style Sheets/Rss.xsl" /&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;add key="FeedXsl2" value="/Style Library/Xsl Style Sheets/Rss-custom.xsl" /&amp;gt;
&amp;nbsp;...
&amp;lt;/appSettings&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;UL&gt;
&lt;LI&gt;3. Now we'll need to modify the XSLT that emits the RSS feed link in the Content Query web part. Again, if I edit the shared ContentQueryMain.xsl, it'll affect all Content Query web parts. Since I only care to modify only one, I'm going to make a copy of this file:&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/1242822/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/1242822/original.aspx"&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;4. And then, I'm going to change one line in it, from:&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;xsl:variable name="FeedUrl1" select="concat($SiteUrl,$FeedPageUrl,'xsl=&lt;B&gt;1&lt;/B&gt;&amp;amp;amp;web=',$WebUrl,'&amp;amp;amp;page=',$PageId,'&amp;amp;amp;wp=',$WebPartId)" /&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;xsl:variable name="FeedUrl1" select="concat($SiteUrl,$FeedPageUrl,'xsl=&lt;B&gt;2&lt;/B&gt;&amp;amp;amp;web=',$WebUrl,'&amp;amp;amp;page=',$PageId,'&amp;amp;amp;wp=',$WebPartId)" /&amp;gt;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;UL&gt;
&lt;LI&gt;5. Now, I'll need to ensure my CQWP is using the ContentQueryMain-custom.xsl. To do that, I'll need to edit the web part property that determines which Main file is used. One easy way to do that is to find my web part on a page, export it, edit the property, and re-import it.&lt;/LI&gt;&lt;/UL&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/1242830/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/1242830/original.aspx"&gt;&lt;/P&gt;
&lt;P&gt;The property in question here is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;property name="MainXslLink" type="string" /&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;For my web part, I'd say:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;lt;property name="MainXslLink" type="string"&amp;gt;/Style Library/XSL Style Sheets/ContentQueryMain-custom.xsl&amp;lt;/property&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That's it!&amp;nbsp; I now have the ability to have a Content Query web part that's emitting an feed in a custom way.&amp;nbsp; Hopefully people find this helpful.&amp;nbsp; And, if people do customize the Content Query web part feeds in this manner, please post a comment and tell us what you did.&lt;/P&gt;
&lt;P&gt;&lt;I&gt;--George Perantatos, Program Manager&lt;/I&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1242810" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ecm/archive/tags/How+To/default.aspx">How To</category><category domain="http://blogs.msdn.com/ecm/archive/tags/Content+Query+Web+Part/default.aspx">Content Query Web Part</category></item><item><title>Long awaited "Customizing and Branding SharePoint Sites" technotes are now published</title><link>http://blogs.msdn.com/ecm/archive/2006/11/15/long-awaited-customizing-and-branding-sharepoint-sites-technotes-are-now-published.aspx</link><pubDate>Wed, 15 Nov 2006 11:38:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:1080255</guid><dc:creator>LLiu</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/ecm/comments/1080255.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ecm/commentrss.aspx?PostID=1080255</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ecm/rsscomments.aspx?PostID=1080255</wfw:comment><description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;A class="" name=_MailAutoSig&gt;&lt;/A&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;I recall reviewing a few months ago the following MSDN articles written by &lt;/SPAN&gt;&lt;A href="http://blog.u2u.info/DottextWeb/patrick"&gt;&lt;SPAN style="mso-bookmark: _MailAutoSig"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;Patrick Tisseghem&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: _MailAutoSig"&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;SPAN style="mso-bookmark: _MailAutoSig"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt; (a long time SharePoint MVP), and I’ve been waiting anxiously ever since to see them published:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/aa830818.aspx"&gt;Customizing and Branding Web Content Management-Enabled SharePoint Sites (Part 1 of 3): Understanding Web Content Management and the Default Features&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/aa830815.aspx"&gt;Customizing and Branding Web Content Management-Enabled SharePoint Sites (Part 2 of 3): Extending WCM&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoListParagraph style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: -0.25in; mso-list: l0 level1 lfo1"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Symbol; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol"&gt;&lt;SPAN style="mso-list: Ignore"&gt;·&lt;SPAN style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/aa830817.aspx"&gt;Customizing and Branding Web Content Management-Enabled SharePoint Sites (Part 3 of 3): Creating and Configuring WCM-Enabled Sites&lt;/A&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;These articles are relatively lengthy, but they’re definitely well worth reading especially since they’re the ideal complements to the recent series of technical posts by the WCM feature team on this blog.&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'"&gt;&amp;lt;Lawrence /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=1080255" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ecm/archive/tags/Web+Content+Management/default.aspx">Web Content Management</category><category domain="http://blogs.msdn.com/ecm/archive/tags/branding/default.aspx">branding</category><category domain="http://blogs.msdn.com/ecm/archive/tags/How+To/default.aspx">How To</category></item><item><title>Configuring and Customizing the Content Query Web Part</title><link>http://blogs.msdn.com/ecm/archive/2006/10/25/configuring-and-customizing-the-content-query-web-part.aspx</link><pubDate>Wed, 25 Oct 2006 21:25:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:874211</guid><dc:creator>ecmblog</dc:creator><slash:comments>228</slash:comments><comments>http://blogs.msdn.com/ecm/comments/874211.aspx</comments><wfw:commentRss>http://blogs.msdn.com/ecm/commentrss.aspx?PostID=874211</wfw:commentRss><wfw:comment>http://blogs.msdn.com/ecm/rsscomments.aspx?PostID=874211</wfw:comment><description>&lt;P mce_keep="true"&gt;
&lt;P&gt;&lt;B&gt;&lt;/B&gt;&lt;/P&gt;Hi everyone, George Perantatos here.&amp;nbsp; Last time I posted on this blog, I discussed how &lt;A href="http://blogs.msdn.com/ecm/archive/2006/06/13/629525.aspx" mce_href="http://blogs.msdn.com/ecm/archive/2006/06/13/629525.aspx"&gt;Smart Client Authoring&lt;/A&gt; can be used to convert documents into web pages.&amp;nbsp; This time I want to switch gears a bit and talk about how you can aggregate content from various places in your web site and present it all in one place. 
&lt;P&gt;So, let's imagine that you've built out a web site using Office SharePoint Server 2007.&amp;nbsp; Your web pages, documents, and images are stored in SharePoint libraries.&amp;nbsp; Content types define the schemas of discrete items, and sub-sites are used for organization and navigation.&amp;nbsp; Now, the question is: how do I aggregate interesting slices of this information on places like my web site's home page?&lt;/P&gt;
&lt;P&gt;Well, we have a great web part for doing just that right out of the box, and it's called the &lt;B&gt;Content Query Web Part&lt;/B&gt;.&amp;nbsp; This web part allows you to show items from your site based on a query, or set of rules, that you define.&amp;nbsp; You can control what part of the site the web part looks for content, what types of items it returns, and it lets you filter, sort, and group those results.&amp;nbsp; And, it lets you control how the items are rendered, so you can make these aggregations match the look and feel of the rest of your web site, both in what content is shown as well as how it's styled.&lt;/P&gt;
&lt;P&gt;The best way to show what the web part is capable of is to walk through an example.&amp;nbsp; Let's say that you've defined a type of page in your site called a "Product Page".&amp;nbsp; A Product Page has a set of common fields, like Title, Description, and Body, but it also has some additional metadata that tells you what product line the page is for.&amp;nbsp; Now, let's say that you want your home page to feature a list of the &lt;B&gt;latest 5 product pages&lt;/B&gt; from your entire site that are about the &lt;B&gt;Widget&lt;/B&gt; product line.&amp;nbsp; Furthermore, you want to show this list of product pages by displaying the &lt;B&gt;Title of the page&lt;/B&gt; as well as &lt;B&gt;a portion of the Body content&lt;/B&gt;, with a little "more..." link that takes people to the full article.&amp;nbsp; Something like:&lt;BR&gt;&lt;BR&gt;&lt;/P&gt;&lt;BR&gt;
&lt;P&gt;&lt;B&gt;Widget 2007&lt;/B&gt;&lt;B&gt;&lt;BR&gt;&lt;/B&gt;The Widget 2007 Beta 2 has recently gone to market.&amp;nbsp; This innovative... (more)&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Widget Community launches!&lt;/B&gt;&lt;BR&gt;Our first community driven application portal has just launched.&amp;nbsp; You can...(more)&lt;/P&gt;
&lt;P mce_keep="true"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;OK, let's get to work!&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Step 1: add a Content Query Web Part to the home page&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;This part is pretty basic.&amp;nbsp; I go to the home page of our site, click on Site Actions, and click Edit Page.&amp;nbsp; The page is checked out to me, and is placed in edit mode.&amp;nbsp; In one of the web part zones, I click "Add Web Part", scroll down to the Content Query Web Part, select it, and add it.&lt;/P&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874182/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874182/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;P&gt;Now, I have a Content Query Web Part on my checked-out version of the home page.&amp;nbsp; It's running a default query that shows me all of the web pages in my site collection.&lt;/P&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874183/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874183/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;P&gt;&lt;B&gt;Step 2: configure&amp;nbsp;Content Query&amp;nbsp;to rollup product pages&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Well, that's an OK query as a placeholder to show me that the web part is working correctly, but the results are not exactly what I want to show.&amp;nbsp; So, I have to edit the web part and configure it to show product pages.&amp;nbsp; First, I click on the web part menu and select Modify Shared Web Part.&lt;/P&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874184/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874184/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;P&gt;The toolpane opens and I see sections of properties.&amp;nbsp; The Query section lets me configure what content the web part will show, and the Presentation lets me configure how the content is displayed.&lt;/P&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874188/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874188/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;P&gt;Let's expand the Query section and configure this part:&lt;/P&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874190/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874190/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;UL&gt;
&lt;LI&gt;For &lt;B&gt;Source&lt;/B&gt;, I don't know (or care) where the product pages live, so I'll leave that set to the entire site collection.&lt;/LI&gt;&lt;/UL&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874192/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874192/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;UL&gt;
&lt;LI&gt;For &lt;B&gt;List Type&lt;/B&gt;, I know these are Web pages, which reside in a pages library, so I'll leave this set to Pages Library.&lt;/LI&gt;&lt;/UL&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874193/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874193/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;UL&gt;
&lt;LI&gt;For &lt;B&gt;Content Type&lt;/B&gt;, I know these are pages of a particular content type: Product Page. So, I'll pick the content type group that I created Product Page in, and then set the drop-down to Product Page.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Now, if I click Apply on my web part, I see just product pages appearing!&lt;/P&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874195/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874195/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;P&gt;OK, but my tasks is to show the &lt;B&gt;latest 5&lt;/B&gt; product pages that are about the &lt;B&gt;Widget&lt;/B&gt; product line.&amp;nbsp; Let's look further down the toolpane UI and see what we can do.&lt;/P&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874196/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874196/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;UL&gt;
&lt;LI&gt;If I expose the &lt;B&gt;Additional Filters&lt;/B&gt; drop-downs, I see the properties that are defined for the Product Page content type. Great; so if I select &lt;B&gt;Product line, is equal to&lt;/B&gt;, and type in &lt;B&gt;Widget&lt;/B&gt;, I should only get back those pages whose metadata says they're for the Widget product line.&lt;/LI&gt;&lt;/UL&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874197/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874197/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;UL&gt;
&lt;LI&gt;Down on the &lt;B&gt;Sorting&lt;/B&gt; drop-down, I see that we're sorting by created date (most recent first). I care about when people update product pages, so I'll set this to &lt;B&gt;Modified&lt;/B&gt;.&lt;/LI&gt;&lt;/UL&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874198/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874198/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;UL&gt;
&lt;LI&gt;Finally, I like to have an item limit here so the web part doesn't show too much information (it's the home page after all). I'll set the &lt;B&gt;item limit&lt;/B&gt; to 5. &lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Now, if I click Apply on my web part, I see not only just product pages, but the &lt;B&gt;latest 5&lt;/B&gt; product pages about the &lt;B&gt;Widget&lt;/B&gt; product line!&lt;/P&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874199/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874199/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;P&gt;OK, we're getting close.&amp;nbsp; But...hmm, the styles don't look quite right.&amp;nbsp; I see a title, but I don't see the body text and the "more...".&amp;nbsp; How do we fix that?&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Step 3: customize&amp;nbsp;Content Query&amp;nbsp;to ask for additional product page fields&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;Anytime you want the Content Query web part to show specific fields from the items that you're aggregating, you have to do two things:&lt;/P&gt;
&lt;UL type=disc&gt;
&lt;LI&gt;You have to tell the web part to ask for those fields&lt;/LI&gt;
&lt;LI&gt;You have to render those fields in the styles that the web part uses to show the items&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Let's tackle the first one.&amp;nbsp; So, I want to have the web part show the &lt;B&gt;Body&lt;/B&gt; &lt;B&gt;field&lt;/B&gt; from the product pages, so I have to configure the web part to ask for it.&lt;/P&gt;
&lt;P&gt;First, I export the web part that we've added.&amp;nbsp; From the web part menu, I select Export..., and pull down the .webpart file.&amp;nbsp; This is just a text file that shows all of the properties of the web part and their values.&lt;/P&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874200/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874200/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;P&gt;We look for the property called "CommonViewFields".&amp;nbsp; This property makes the web part request additional fields, on top of the "base" ones it asks for out of the box.&amp;nbsp; We can edit this property and specify one additional field to ask for, namely the Body field.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;property name="CommonViewFields" type="string"&amp;gt;Body_x0020_content, RichHTML&amp;lt;/property&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There's a few ways you can configure this property but the most common one is "Internal name of field", followed by a comma, followed by the type of the field.&amp;nbsp; If you want more than one, add a semicolon between each pair.&amp;nbsp; (Don't worry, we have an SDK article coming soon that gets into all the details of using this and other properties.)&lt;/P&gt;
&lt;P&gt;Now, all we have to do is save this .webpart file and import it back on the site.&amp;nbsp; By selecting Import from the toolpane, and browsing to the .webpart file, you can upload this new .webpart and then add it to your page.&lt;/P&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874201/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874201/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;P&gt;As soon as we add our web part, we see...&lt;/P&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG style="WIDTH: 523px; HEIGHT: 123px" src="http://blogs.msdn.com/photos/ecmblog/images/874203/original.aspx" width=523 height=123 mce_src="http://blogs.msdn.com/photos/ecmblog/images/874203/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;P&gt;Wow, that looks exactly the same!&amp;nbsp; Right, so the web part now has the Body field content, but it's not rendering the content.&amp;nbsp; How do I make the web part do that? &lt;/P&gt;
&lt;P&gt;&lt;B&gt;Step 4: customize XSLT to render additional fields&lt;/B&gt;&lt;/P&gt;
&lt;P&gt;The Content Query web part utilizes XSLT to render its contents.&amp;nbsp; This means that I can edit the way the web part renders content and configure exactly what is shown and how it's shown.&lt;/P&gt;
&lt;P&gt;If I edit the web part and look at the toolpane, I'll see a couple of drop-downs that relate to Styles.&amp;nbsp; These correspond to the Header and ItemStyle XSLT files that are located in the site collection's Style Library, which is in the root site.&lt;/P&gt;
&lt;CENTER&gt;
&lt;P mce_keep="true"&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874204/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874204/original.aspx"&gt;&lt;/P&gt;&lt;/CENTER&gt;
&lt;P&gt;I see that the web part is currently configured to use the "Image on left" style.&amp;nbsp; If we open the ItemStyle file, we'll see several xsl templates.&amp;nbsp; Each corresponds to an item style in the drop-down above.&amp;nbsp; The Image on left style looks like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:template name="Default" match="*" mode="itemstyle"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:variable name="SafeLinkUrl"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:call-template name="OuterTemplate.GetSafeLink"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:with-param name="UrlColumnName" select="'LinkUrl'"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:call-template&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:variable&amp;gt;
&lt;BR&gt;&lt;BR&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:variable name="SafeImageUrl"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:call-template name="OuterTemplate.GetSafeStaticUrl"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:with-param name="UrlColumnName" select="'ImageUrl'"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:call-template&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:variable&amp;gt;
&lt;BR&gt;&lt;BR&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:variable name="DisplayTitle"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:call-template name="OuterTemplate.GetTitle"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:with-param name="Title" select="@Title"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:with-param name="UrlColumnName" select="'LinkUrl'"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:call-template&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:variable&amp;gt;
&lt;BR&gt;&lt;BR&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:variable name="LinkTarget"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:if test="@OpenInNewWindow = 'True'" &amp;gt;_blank&amp;lt;/xsl:if&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:variable&amp;gt;
&lt;BR&gt;&lt;BR&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;BR&gt;&lt;PRE&gt;&lt;CODE&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div id="linkitem" class="item"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:if test="string-length($SafeImageUrl) != 0"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div class="image-area-left"&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a href="{$SafeLinkUrl}" mce_href="{$SafeLinkUrl}" target="{$LinkTarget}"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;img class="image" src="{$SafeImageUrl}" mce_src="{$SafeImageUrl}" alt="{@ImageUrlAltText}" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/a&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:if&amp;gt;
&lt;BR&gt;&lt;BR&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div class="link-item"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:call-template name="OuterTemplate.CallPresenceStatusIconTemplate"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;a href="{$SafeLinkUrl}" mce_href="{$SafeLinkUrl}" target="{$LinkTarget}" title="{@LinkToolTip}"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:value-of select="$DisplayTitle"/&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/a&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div class="description"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:value-of select="@Description" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:template&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The style breaks down into two sections:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The first section (the part that begins with an "xsl:variable") processes the data, and ensures that it is properly formatted. Some of these functions called here ensure the styles can be shared between the Summary Links and the Content Query web parts. Other functions are there to ensure that the information passed to the XSLT doesn't contain improper markup that could render out as unescaped HTML.&lt;/LI&gt;
&lt;LI&gt;The second section (the part that begins with a "div id") renders HTML and includes the data.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;We see that this style renders an image, a title, and a description.&amp;nbsp; For the scenario above, all I have to do is change that description line:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div class="description"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:value-of select="@Description" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and make it show the Body content field:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div class="description"&amp;gt;&lt;BR&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;xsl:value-of select="@Body_x005F_x0020_content" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If I save the XSLT and reload the page with my web part, I see:&lt;/P&gt;
&lt;CENTER&gt;&lt;IMG src="http://blogs.msdn.com/photos/ecmblog/images/874206/original.aspx" mce_src="http://blogs.msdn.com/photos/ecmblog/images/874206/original.aspx"&gt;&lt;/CENTER&gt;
&lt;P&gt;Great, I'm finally done!&lt;/P&gt;
&lt;P&gt;&lt;B&gt;Tips and tricks&lt;/B&gt;&lt;/P&gt;
&lt;UL type=disc&gt;
&lt;LI&gt;Often you may want to see how the cross-list query data is getting thrown to the XSLT, so you can devise the right statements to display the data.&amp;nbsp; Here's a quick way to render the names of the fields that are getting passed to you.&amp;nbsp; For a given item style that the web part is using, add the following markup:&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xsl:for-each select="@*"&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; P:&amp;lt;xsl:value-of select="name()" /&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/xsl:for-each&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;UL type=disc&gt;
&lt;LI&gt;A quick sidenote on web part property editing: while exporting the web part as I did above is certainly valid, it only applies to one instance of a web part on one page.&amp;nbsp; You have two other options:&lt;/LI&gt;&lt;/UL&gt;
&lt;UL type=disc&gt;
&lt;UL type=circle&gt;
&lt;LI&gt;You can configure a Content Query web part as above, and have it be available in the web part gallery, for authors to add to their pages.&lt;/LI&gt;
&lt;LI&gt;You can edit a web part on a web part page or page layout in SharePoint Designer, and configure it as above. &amp;nbsp;If you edit a web part in a web part zone in a page layout, then all new pages that use this layout will get your customized web part.&lt;B&gt;&lt;/B&gt;&lt;/LI&gt;&lt;/UL&gt;
&lt;LI&gt;Pay attention to details when editing XSLTs.&amp;nbsp; Missing closed tags matter, as do letter casings when referring to field names.&amp;nbsp; I speak from experience here.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;I hope this walkthrough helps people configure and use the Content Query Web Part.&amp;nbsp; I'd be interested to hear and see examples of how people are using the web part, as well as field questions.&amp;nbsp; So, post your comments!&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;--George Perantatos, Program Manager&lt;/EM&gt;&lt;/P&gt;
&lt;CENTER&gt;&lt;/CENTER&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=874211" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/ecm/archive/tags/Web+Content+Management/default.aspx">Web Content Management</category><category domain="http://blogs.msdn.com/ecm/archive/tags/How+To/default.aspx">How To</category><category domain="http://blogs.msdn.com/ecm/archive/tags/Content+Query+Web+Part/default.aspx">Content Query Web Part</category></item></channel></rss>