<?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/"
	>

<channel>
	<title>Web Parts Archives - Blog IT</title>
	<atom:link href="https://blogit.create.pt/tag/web-parts/feed/" rel="self" type="application/rss+xml" />
	<link>https://blogit.create.pt/tag/web-parts/</link>
	<description>Create IT blogger community</description>
	<lastBuildDate>Thu, 10 Jan 2019 14:18:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>SharePoint 2007 Deployment: Module Features</title>
		<link>https://blogit.create.pt/andrevala/2009/01/10/sharepoint-2007-deployment-module-features/</link>
					<comments>https://blogit.create.pt/andrevala/2009/01/10/sharepoint-2007-deployment-module-features/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Sat, 10 Jan 2009 19:41:22 +0000</pubDate>
				<category><![CDATA[Deployment]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<category><![CDATA[Web Parts]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=741</guid>

					<description><![CDATA[<p>Summary This post is about developing features to deploy files in a SharePoint site (module features). Check the first post SharePoint 2007 Deployment: Overview for an introduction and the series index. Package Structure As I mentioned previously in the post SharePoint 2007 Deployment: Creating and Using Features, to build a feature you need to create [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2009/01/10/sharepoint-2007-deployment-module-features/">SharePoint 2007 Deployment: Module Features</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<h3>Summary</h3>
<p>This post is about developing features to deploy files in a SharePoint site (module features). Check the first post <a href="http://blogit.create.pt/blogs/andrevala/archive/2007/12/02/SharePoint-2007-Deployment_3A00_-Overview.aspx">SharePoint 2007 Deployment: Overview</a> for an introduction and the series index.</p>
<h3>Package Structure</h3>
<p>As I mentioned previously in the post <a href="http://blogit.create.pt/blogs/andrevala/archive/2007/12/15/SharePoint-2007-Deployment_3A00_-Creating-and-Using-Features.aspx">SharePoint 2007 Deployment: Creating and Using Features</a>, to build a feature you need to create the following files:</p>
<ul>
<li>The <em>feature manifest</em> file (which must be named <code>feature.xml</code>) </li>
<li>One or more <em>element manifest</em> files </li>
</ul>
<p>The <em>feature manifest</em> file contains the generic information about the feature package, and the <em>element manifest</em> files contain the information about each specific type of element that makes up the feature. Since I already explained all the possible contents of the <em>feature manifest</em> file in the above mentioned post, I will focus this one the <em>element manifest</em> that allows the provisioning of files (<em>modules</em>)<em>&#160;</em>in a SharePoint site.</p>
<p>You can then place these two files inside a <em>Solution</em> following the instructions in the post <a href="http://blogit.create.pt/blogs/andrevala/archive/2008/02/17/SharePoint-2007-Deployment_3A00_-Creating-Solutions.aspx">SharePoint 2007 Deployment: Creating Solutions</a>, to provide an easy way to deploy the feature (or upgrade it).</p>
<h3>Modules</h3>
<p>Modules are collections of files that must be provisioned in a SharePoint web site. This type of feature element can be used to:</p>
<ul>
<li>Add pages to a web site </li>
<li>Add web parts to a web site&#8217;s web part gallery </li>
<li>Add web parts to a web part page </li>
<li>Add documents to a document library </li>
<li>Add style sheets to the a web sites style library </li>
</ul>
<p>According to the documentation, WSS 3.0 supports provisioning a maximum of 1000 files through module feature elements (whether using a single module element with 1000 files, or 1000 module elements each with a single file).</p>
<h3>Allowed Scopes</h3>
<p>The scopes to which a feature can be deployed, are dictated by the types of elements included in it. A feature with module elements can be deployed to <strong>Site Collection</strong> and <strong>Web Site</strong> scopes, since they represent files that are to be placed in web sites.</p>
<h3>Feature Manifest</h3>
<p>I will only present a simple feature manifest, since the additional options were presented in the above mentioned post.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot; <span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Feature
  </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;
  <span style="color: red">Title</span><span style="color: blue">=</span>&quot;<span style="color: blue">My Module Feature</span>&quot;
  <span style="color: red">Id</span><span style="color: blue">=</span>&quot;<span style="color: blue">17E94729-EF3E-4f43-9385-88E1201F91E0</span>&quot;
  <span style="color: red">Description</span><span style="color: blue">=</span>&quot;<span style="color: blue">This feature adds files to the web site.</span>&quot;
  <span style="color: red">Version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0.0.0</span>&quot;
  <span style="color: red">Scope</span><span style="color: blue">=</span>&quot;<span style="color: blue">Web</span>&quot;
  <span style="color: red">Hidden</span><span style="color: blue">=</span>&quot;<span style="color: blue">FALSE</span>&quot;
  <span style="color: red">DefaultResourceFile</span><span style="color: blue">=</span>&quot;<span style="color: blue">core</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">ElementManifest </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">Modules.xml</span>&quot; <span style="color: blue">/&gt;
        &lt;</span><span style="color: #a31515">ElementFile </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">default.aspx</span>&quot; <span style="color: blue">/&gt;
        &lt;</span><span style="color: #a31515">ElementFile </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyMasterPage.master</span>&quot; <span style="color: blue">/&gt;
        &lt;</span><span style="color: #a31515">ElementFile </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyDocument.docx</span>&quot; <span style="color: blue">/&gt;
        &lt;</span><span style="color: #a31515">ElementFile </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyWebPart\MyWebPart.webpart</span>&quot; <span style="color: blue">/&gt;
        &lt;</span><span style="color: #a31515">ElementFile </span><span style="color: red">Location</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyStyles.css</span>&quot; <span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">ElementManifests</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Feature</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Notes about this feature manifest:</p>
<ul>
<li>The title of the feature is <em>My Module Feature.</em> </li>
<li>It will be deployed as a <strong>Web Site </strong>feature, since it&#8217;s <code>Scope</code> value is <code>Web</code>. </li>
<li>It references a single <em>element manifest</em> file: <code>Modules.xml</code>. </li>
<li>It references several <em>element file</em> files. You must reference separately, using these elements, each file you wish to include in the module. </li>
</ul>
<h3>Element Manifest</h3>
<p>The <em>element manifest</em> file can have any name you wish (in this example it&#8217;s called <code>Module.xml</code>), but it&#8217;s root element must be <code>&lt;Elements&gt;</code>. Inside this root element, you can place any number of feature element descriptions. In this example I will present the use of the <code>&lt;Module&gt;</code> element which is used to deploy Files to SharePoint web sites.</p>
<pre class="code"><span style="color: blue">&lt;?</span><span style="color: #a31515">xml </span><span style="color: red">version</span><span style="color: blue">=</span>&quot;<span style="color: blue">1.0</span>&quot; <span style="color: red">encoding</span><span style="color: blue">=</span>&quot;<span style="color: blue">utf-8</span>&quot;<span style="color: blue">?&gt;
&lt;</span><span style="color: #a31515">Elements </span><span style="color: red">xmlns</span><span style="color: blue">=</span>&quot;<span style="color: blue">http://schemas.microsoft.com/sharepoint/</span>&quot;<span style="color: blue">&gt;
    
    &lt;!-- </span><span style="color: green">Page Module </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">Module </span><span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">Pages</span>&quot; <span style="color: red">Url</span><span style="color: blue">=</span>&quot;&quot; <span style="color: red">Path</span><span style="color: blue">=</span>&quot;&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">File </span><span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">default.aspx</span>&quot; 
              <span style="color: red">NavBarHome</span><span style="color: blue">=</span>&quot;<span style="color: blue">True</span>&quot; 
              <span style="color: red">IgnoreIfAlreadyExists</span><span style="color: blue">=</span>&quot;<span style="color: blue">TRUE</span>&quot; 
              <span style="color: red">Type</span><span style="color: blue">=</span>&quot;<span style="color: blue">Ghostable</span>&quot;<span style="color: blue">&gt;

            &lt;!-- </span><span style="color: green">Places Web Part on Page </span><span style="color: blue">--&gt;
            &lt;</span><span style="color: #a31515">AllUsersWebPart </span><span style="color: red">WebPartZoneID</span><span style="color: blue">=</span>&quot;<span style="color: blue">Left</span>&quot; <span style="color: red">WebPartOrder</span><span style="color: blue">=</span>&quot;<span style="color: blue">1</span>&quot;<span style="color: blue">&gt;
                &lt;![CDATA[
                  </span><span style="color: gray">&lt;webParts&gt;
                    &lt;webPart xmlns=&quot;http://schemas.microsoft.com/WebPart/v3&quot;&gt;
                      &lt;metaData&gt;
                        &lt;type name=&quot;MyWebPart, 
                                    MyWebPart.MyWebPart, 
                                    Version=1.0.0.0, 
                                    Culture=neutral, 
                                    PublicKeyToken=1255988569cf0248&quot; /&gt;
                        &lt;importErrorMessage&gt;
                            Cannot import My Web Part.
                        &lt;/importErrorMessage&gt;
                      &lt;/metaData&gt;
                      &lt;data&gt;
                        &lt;properties&gt;
                          &lt;property name=&quot;Title&quot; type=&quot;string&quot;&gt;
                            My Web Part
                          &lt;/property&gt;
                        &lt;/properties&gt;
                      &lt;/data&gt;
                    &lt;/webPart&gt;
                  &lt;/webParts&gt;
                </span><span style="color: blue">]]&gt;
            &lt;/</span><span style="color: #a31515">AllUsersWebPart</span><span style="color: blue">&gt;
            
            &lt;!-- </span><span style="color: green">Places a List View for a Discussion Board </span><span style="color: blue">--&gt;
            &lt;</span><span style="color: #a31515">View </span><span style="color: red">List</span><span style="color: blue">=</span>&quot;<span style="color: blue">Lists/Discussions</span>&quot; 
                  <span style="color: red">BaseViewID</span><span style="color: blue">=</span>&quot;<span style="color: blue">4</span>&quot; 
                  <span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">Discussions</span>&quot; 
                  <span style="color: red">WebPartZoneID</span><span style="color: blue">=</span>&quot;<span style="color: blue">Left</span>&quot; 
                  <span style="color: red">WebPartOrder</span><span style="color: blue">=</span>&quot;<span style="color: blue">2</span>&quot;<span style="color: blue">/&gt;

            &lt;!-- </span><span style="color: green">Places a List View for a Document Library </span><span style="color: blue">--&gt;
            &lt;</span><span style="color: #a31515">View </span><span style="color: red">List</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyDocuments</span>&quot; 
                  <span style="color: red">BaseViewID</span><span style="color: blue">=</span>&quot;<span style="color: blue">10</span>&quot; 
                  <span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">My Documents</span>&quot; 
                  <span style="color: red">WebPartZoneID</span><span style="color: blue">=</span>&quot;<span style="color: blue">Left</span>&quot; 
                  <span style="color: red">WebPartOrder</span><span style="color: blue">=</span>&quot;<span style="color: blue">3</span>&quot;<span style="color: blue">/&gt;

            &lt;!-- </span><span style="color: green">Customizes Navigation </span><span style="color: blue">--&gt;
            &lt;</span><span style="color: #a31515">NavBarPage </span><span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">$Resources:core,nav_Home;</span>&quot; 
                        <span style="color: red">ID</span><span style="color: blue">=</span>&quot;<span style="color: blue">1002</span>&quot; 
                        <span style="color: red">Position</span><span style="color: blue">=</span>&quot;<span style="color: blue">Start</span>&quot; <span style="color: blue">/&gt;
        &lt;/</span><span style="color: #a31515">File</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">Module</span><span style="color: blue">&gt;
    
    &lt;!-- </span><span style="color: green">Master Page Module </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">Module </span><span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">Master Pages</span>&quot; <span style="color: red">List</span><span style="color: blue">=</span>&quot;<span style="color: blue">116</span>&quot; <span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">_catalogs/masterpage</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">File </span><span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyMasterPage.master</span>&quot; <span style="color: red">Type</span><span style="color: blue">=</span>&quot;<span style="color: blue">GhostableInLibrary</span>&quot; <span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">Module</span><span style="color: blue">&gt;

    &lt;!-- </span><span style="color: green">Document Module </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">Module </span><span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">Documents</span>&quot; <span style="color: red">List</span><span style="color: blue">=</span>&quot;<span style="color: blue">101</span>&quot; <span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyDocuments</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">File </span><span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyDocument.docx</span>&quot; <span style="color: red">Type</span><span style="color: blue">=</span>&quot;<span style="color: blue">GhostableInLibrary</span>&quot; <span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">Module</span><span style="color: blue">&gt;

    &lt;!-- </span><span style="color: green">Web Part Module </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">Module </span><span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">WebParts</span>&quot; <span style="color: red">List</span><span style="color: blue">=</span>&quot;<span style="color: blue">113</span>&quot; <span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">_catalogs/wp</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">File </span><span style="color: red">Path</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyWebPart\MyWebPart.webpart</span>&quot;
              <span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyWebPart.webpart</span>&quot;
              <span style="color: red">Type</span><span style="color: blue">=</span>&quot;<span style="color: blue">GhostableInLibrary</span>&quot; <span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">Module</span><span style="color: blue">&gt;

    &lt;!-- </span><span style="color: green">Style Sheet Module </span><span style="color: blue">--&gt;
    &lt;</span><span style="color: #a31515">Module </span><span style="color: red">Name</span><span style="color: blue">=</span>&quot;<span style="color: blue">Stylesheets</span>&quot; <span style="color: red">List</span><span style="color: blue">=</span>&quot;<span style="color: blue">101</span>&quot; <span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">Style Library</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">File </span><span style="color: red">Url</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyStyles.css</span>&quot; <span style="color: red">Type</span><span style="color: blue">=</span>&quot;<span style="color: blue">GhostableInLibrary</span>&quot; <span style="color: blue">/&gt;
    &lt;/</span><span style="color: #a31515">Module</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">Elements</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
<p><p>The example above provisions five different files in a SharePoint web site:</p>
<ul>
<li>An ASPX web page (web part page) to the root of the web site. This web page contains:
<ul>
<li>A MyWebPart Web Part (on web part zone Left) </li>
<li>A List View Web Part that shows a view of a discussion board list </li>
<li>A List View Web Part that shows a view of a document library </li>
</ul>
</li>
<li>A Master Page to the Master Page Gallery of the web site </li>
<li>A document to a Document Library of the web site </li>
<li>A web part to the Web Part Gallery of the web site </li>
<li>A style sheet to the Style Library of the web site </li>
</ul>
<p><strong>The Module Element</strong></p>
<p>The <strong><code>&lt;Module&gt;</code></strong> element is used to specify a Module. There can be any number of modules in a single element manifest. Here is a summary of the possible attributes of this element:</p>
<ul>
<li><strong><code>IncludeFolders</code></strong> &#8211; (optional) I could figure out what this attribute is for&#8230; </li>
<li><strong><code>List</code></strong> &#8211; (optional) Type of list where the files included in this module should be provisioned (check the possible values on my post about <a href="http://blogit.create.pt/blogs/andrevala/archive/2008/05/17/SharePoint-2007-Deployment_3A00_-List-Template-Features.aspx" target="_blank">List Template Features</a>). </li>
<li><strong><code>Name</code></strong> &#8211; (required) Name of the module (file set). </li>
<li><strong><code>Path</code></strong> &#8211; (optional) Specifies the physical path of the files, inside the feature folder (<code>C:\Program Files\...\12\TEMPLATE\FEATURES\</code>[feature]). By default, SharePoint assumes the files are in the same folder as the element manifest file. You can also specify the path on each <strong><code>&lt;File&gt;</code></strong> element (see below). </li>
<li><strong><code>RootWebOnly</code></strong> &#8211; (optional) Boolean value. If <strong><code>TRUE</code></strong> it specifies that the files in this module will only be provisioned on the root web site of a site collection. </li>
<li><strong><code>SetupPath</code></strong> &#8211; (optional) Specifies the physical path to a folder, inside SharePoint&#8217;s setup folder (<code>C:\Program Files\...\12\TEMPLATE</code>), that contains the files included in the module. </li>
<li><strong><code>Url</code></strong> &#8211; (optional) Specifies the virtual path of the folder in which to place the files of the module. This attribute is also used to provision a folder inside a list. If the <strong><code>Path</code></strong> is not specified, the value of this attribute will be used for the physical path also. </li>
</ul>
<p><strong>The File Element</strong></p>
<p>The <strong><code>&lt;File&gt;</code></strong> element is used to specify a file inside a module. There can be any number of <strong><code>&lt;File&gt;</code></strong> elements inside a <strong><code>&lt;Module&gt;</code></strong> element. See below a list of the possible attributes of this element:</p>
<ul>
<li><strong><code>IgnoreIfAlreadyExists</code></strong> &#8211; (optional) Boolean value. If <strong><code>TRUE</code></strong> it specifies that the file should be provisioned even if it already exists on the destination URL. </li>
<li><strong><code>Name</code></strong> &#8211; (optional) Specifies the virtual path for the file. </li>
<li><strong><code>NavBarHome</code></strong> &#8211; (optional) Boolean value. If <strong><code>TRUE</code></strong> it specifies that the file will be the destination of the <em>Home</em> link, used in the web site&#8217;s navigation. This attribute is only used for web pages. </li>
<li><strong><code>Path</code></strong> &#8211; (optional) Physical path to the file, inside the feature folder (<code>C:\Program Files\...\12\TEMPLATE\FEATURES\</code>[feature]). This attribute is used if you need to specify a different path for each file inside the module. Otherwise, you can use the <strong><code>Path</code></strong> attribute on the <strong><code>Module</code></strong> element. </li>
<li><strong><code>Type</code></strong> &#8211; (optional) Specifies if the file is to be stored in a Document Library (in this case the value should be <strong><code>GhostableInLibrary</code></strong>) or outside of a list (in this case the value should be <strong><code>Ghostable</code></strong>). </li>
<li><strong><code>Url</code></strong> &#8211; (required) Specifies the virtual path for the file. If <strong><code>Name</code></strong> is specified, then the value of this attribute is ignored. However, if <strong><code>Path</code></strong> is not specified, the value of this attribute will be used for the physical path. </li>
</ul>
<p><strong>The AllUsersWebPart Element</strong></p>
<p>The <strong><code>&lt;AllUsersWebPart&gt;</code></strong> element is used when you want to add a generic web part (non-List View web part) to a web part page. It can only be used inside a <strong><code>&lt;File&gt;</code></strong> element that provisions a web part page file. It has only two attributes:</p>
<ul>
<li><strong><code>WebPartOrder</code></strong> &#8211; (required) Specifies the vertical position of the web part inside a web part zone. </li>
<li><strong><code>WebPartZoneID</code></strong> &#8211; (required) Specifies the name of the web part zone. </li>
</ul>
<p>Inside this element, you can place a <code>CDATA</code> element with the web part&#8217;s XML description, either using the DWP file schema (also called V2) or the WEBPART file schema (also called V3).</p>
<p><strong>The View Element</strong></p>
<p>The <strong><code>&lt;View&gt;</code></strong> element is used when you want to add a List View Web Part to a web part page. It can only be used inside a <strong><code>&lt;File&gt;</code></strong> element that provisions a web part page file. It has a lot of possible attributes, but I will only list the most common:</p>
<ul>
<li><strong><code>List</code></strong> &#8211; (optional) Specifies either the template type of the list (an integer value) or the URL of a list provisioned in the web site (a string value). On most cases, you should use the URL, since there might be two lists of the same type on the web site. </li>
<li><strong><code>BaseViewID</code></strong> &#8211; (optional) Specifies the ID of the list view to be used. </li>
<li><code><strong>Name</strong></code> &#8211; (optional) Specifies the name of the view. </li>
<li><strong><code>WebPartOrder</code></strong> &#8211; (required) Specifies the vertical position of the web part inside a web part zone. </li>
<li><strong><code>WebPartZoneID</code></strong> &#8211; (required) Specifies the name of the web part zone. </li>
</ul>
<p><strong>The NavBarPage Element</strong></p>
<p>The <strong><code>&lt;NavBarPage&gt;</code></strong> element is used to define how the navigation items should be created so that other pages link to this one. It can only be used inside a <strong><code>&lt;File&gt;</code></strong> element that provisions a web page file. It has three attributes:</p>
<ul>
<li><strong><code>ID</code></strong> &#8211; (required) Specifies the ID for the page. This ID will be used by other pages when defining the relative position of the navigation items. </li>
<li><strong><code>Name</code></strong> &#8211; (required) Specifies the text that is displayed in the navigation area of other pages that link to this one. </li>
<li><strong><code>Position</code></strong> &#8211; (optional) Specifies the position of the navigation item on the navigation area of other pages that link to this one. This attribute can have the following possible values:
<ul>
<li><strong><code>Start</code></strong> &#8211; Add the node to the start of the top navigation area. </li>
<li><strong><code>End</code></strong> &#8211; Add the node to the end of the top navigation area. </li>
<li>Number between <strong>1001</strong> and <strong>2000</strong> &#8211; Add the node after another <code>NavBarPage</code> element whose ID matches the number. </li>
</ul>
</li>
</ul>
<p><strong>The Property Element</strong></p>
<p>The <code><strong>&lt;Property&gt;</strong></code> element is used only inside the <code><strong>&lt;File&gt;</strong></code> element, to define the value of one or more properties of that file, once it is provisioned. It&#8217;s mostly used to set properties of web part files or document files. It has only two attributes:</p>
<ul>
<li><strong><code>Name</code></strong> &#8211; (required) Name of the property to be set. </li>
<li><strong><code>Value</code></strong> &#8211; (required) Value to set the property with. </li>
</ul>
<h3></h3>
<h3>Additional Notes</h3>
<p>The files included in a module feature element are provisioned in the web site where the feature is activated. However, when the feature is deactivated, the files that belong to the module element are <u>not</u> removed.</p>
<p>You can learn a lot about modules by looking inside the <code>onet.xml</code> files included in each site template (look in <code>C:\Program Files\...\12\TEMPLATE\SiteTemplates</code>). These files include a <code>&lt;Modules&gt;</code> element which shares the same schema as the Module Features.</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2009/01/10/sharepoint-2007-deployment-module-features/">SharePoint 2007 Deployment: Module Features</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2009/01/10/sharepoint-2007-deployment-module-features/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint Tip #11: The Web Part Maintenance Page</title>
		<link>https://blogit.create.pt/andrevala/2007/01/17/sharepoint-tip-11-the-web-part-maintenance-page/</link>
					<comments>https://blogit.create.pt/andrevala/2007/01/17/sharepoint-tip-11-the-web-part-maintenance-page/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Wed, 17 Jan 2007 06:38:00 +0000</pubDate>
				<category><![CDATA[Tips and Tricks]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[WSS]]></category>
		<category><![CDATA[Web Parts]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=1381</guid>

					<description><![CDATA[<p>In SharePoint, when an error occurs in a web part that prevents it to be rendered on the page, an error page is&#160;displayed to the user with a link to the web part maintenance page.&#160;This page lists all the web parts that were added to&#160;the web part page and&#160;their current state, allowing&#160;you to remove web [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2007/01/17/sharepoint-tip-11-the-web-part-maintenance-page/">SharePoint Tip #11: The Web Part Maintenance Page</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p style="text-align: justify">In SharePoint, when an error occurs in a web part that prevents it to be rendered on the page, an error page is&nbsp;displayed to the user with a link to the web part maintenance page.&nbsp;This page lists all the web parts that were added to&nbsp;the web part page and&nbsp;their current state, allowing&nbsp;you to remove web part that is causing the error.&nbsp;</p>
<p style="text-align: justify">Although this page is very useful,&nbsp;accessing it is not as easy as one&nbsp;would expect. There are two ways to do so.&nbsp;</p>
<p><strong>Method&nbsp;1 </strong></p>
<ol start="1">
<li>Go to&nbsp;<strong>Site Actions &gt; View All Site Content</strong> </li>
<li>Open the&nbsp;<strong>Pages</strong> list that stores the page about which we wish to get information</li>
<li>Using the file&#039;s context menu, select the&nbsp;<strong>Edit Properties</strong> option</li>
<li>In the bottom of the properties page, there is a link to the web part maintenance page </li>
</ol>
<p><strong>Method&nbsp;2 </strong></p>
<p>Add <code>?contents=1</code>&nbsp;to the URL&nbsp;of the page about which&nbsp;you want to get web part maintenance information.</p>
<p><strong>Example<br /></strong>If the page has the address <code>http://server/site/mypage.aspx</code>, you can access the web part maintenance page using the address <code>http://server/site/mypage.aspx?contents=1</code>.</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2007/01/17/sharepoint-tip-11-the-web-part-maintenance-page/">SharePoint Tip #11: The Web Part Maintenance Page</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2007/01/17/sharepoint-tip-11-the-web-part-maintenance-page/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Customização da Content Query Web Part</title>
		<link>https://blogit.create.pt/andrevala/2006/12/08/customizao-da-content-query-web-part/</link>
					<comments>https://blogit.create.pt/andrevala/2006/12/08/customizao-da-content-query-web-part/#respond</comments>
		
		<dc:creator><![CDATA[André Vala]]></dc:creator>
		<pubDate>Fri, 08 Dec 2006 18:45:00 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Web Parts]]></category>
		<guid isPermaLink="false">http://blogcreate.azurewebsites.net/andrevala/?p=1581</guid>

					<description><![CDATA[<p>Uma das web parts mais flex&#237;veis fornecidas pelo SharePoint 2007 &#233; a Content Query Web Part. Alguns exemplos de aplica&#231;&#245;es para esta web part: Mostrar conte&#250;dos de uma lista com uma apresenta&#231;&#227;o diferente da oferecida pela List Web Part Mostrar conte&#250;dos provenientes de um ou mais subsites ou listas, definindo ordena&#231;&#227;o, filtragem e agrupamentos espec&#237;ficos [&#8230;]</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2006/12/08/customizao-da-content-query-web-part/">Customização da Content Query Web Part</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Uma das web parts mais flex&iacute;veis fornecidas pelo SharePoint 2007 &eacute; a <em>Content Query Web Part</em>. Alguns exemplos de aplica&ccedil;&otilde;es para esta web part: </p>
<ul style="margin-left: 38pt">
<li>Mostrar conte&uacute;dos de uma lista com uma apresenta&ccedil;&atilde;o diferente da oferecida pela <em>List Web Part</em> </li>
<li>Mostrar conte&uacute;dos provenientes de um ou mais subsites ou listas, definindo ordena&ccedil;&atilde;o, filtragem e agrupamentos espec&iacute;ficos </li>
<li>Ter mais de uma forma de apresentar os mesmos conte&uacute;dos </li>
</ul>
<p>Tudo isto sem ter que fazer uma linha de c&oacute;digo e configurando separadamente acesso a dados e apresenta&ccedil;&atilde;o. </p>
<p>No que respeita ao acesso a dados, a configura&ccedil;&atilde;o &eacute; bastante linear bastando indicar o site ou lista de onde se pretende obter o conte&uacute;do e indicar qual o seu <em>content type</em>. O resto &eacute; praticamente o mesmo que definir uma vista numa lista comum, configurando filtros, ordena&ccedil;&atilde;o e agrupamento, bem como n&uacute;mero limite de itens. </p>
<p>A configura&ccedil;&atilde;o da apresenta&ccedil;&atilde;o assenta na selec&ccedil;&atilde;o de dois estilos: </p>
<ul>
<li>O <em>Group Style</em>, que &eacute; utilizado no cabe&ccedil;alho dos agrupamentos de itens (se for definido um agrupamento) </li>
<li>O <em>Item Style</em>, que &eacute; utilizado para representar cada item </li>
</ul>
<p>Como &eacute; prov&aacute;vel que nenhuma das op&ccedil;&otilde;es para estes estilos seja exactamente o que procuramos para mostrar a informa&ccedil;&atilde;o na web part, o SharePoint permite que se altere a forma como a web part o faz atrav&eacute;s da configura&ccedil;&atilde;o de tr&ecirc;s ficheiros XSL-T: <strong>ContentQueryMain.xsl</strong>, <strong>Header.xsl</strong> e <strong>ItemStyle.xsl</strong>. Qualquer um destes ficheiros pode ser encontrado acedendo &agrave; pasta <strong>/Style Library/XSL Style Sheets</strong>, usando o <em>SharePoint Designer</em> ou <em>Site Actions &gt; Manage Content and Structure</em> ou ainda, <em>Site Actions &gt; Site Settings &gt; Content and Structure</em>. </p>
<p>O ficheiro <strong>ContentQueryMain.xsl</strong> cont&eacute;m o XSL principal que executado para formatar a web part, e em grande parte dos casos n&atilde;o precisar&aacute; de ser alterado. </p>
<h4>Group Style</h4>
<p>O ficheiro <strong>Header.xsl</strong> cont&eacute;m um conjunto de templates XSL que correspondem &agrave;s op&ccedil;&otilde;es dispon&iacute;veis na caixa de selec&ccedil;&atilde;o <em>Group Style</em>. Para criar um novo <em>Group Style</em> basta criar um novo template neste ficheiro. O template seleccionado ser&aacute; chamado no in&iacute;cio de cada agrupamento de dados (<em>group by</em>). </p>
<p>Exemplo de um template de <em>Group Style</em>: </p>
<p><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:template</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyGroupStyle</span>&quot;<span style="color: blue"> </span><span style="color: red">match</span><span style="color: blue">=</span>&quot;<span style="color: blue">*[@GroupStyle=&#8217;MyGroupStyle&#8217;]</span>&quot;<span style="color: blue"> </span><span style="color: red">mode</span><span style="color: blue">=</span>&quot;<span style="color: blue">header</span>&quot;<span style="color: blue">&gt;<br /></span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&nbsp; &lt;</span><span style="color: maroon">div</span><span style="color: blue"> </span><span style="color: red">class</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyStyle</span>&quot;<span style="color: blue">&gt;<br />&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:call-template</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">OuterTemplate.GetGroupName</span>&quot;<span style="color: blue">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:with-param</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">GroupName</span>&quot;<span style="color: blue"> </span><span style="color: red">select</span><span style="color: blue">=</span>&quot;<span style="color: blue">@*[name()=$Group]</span>&quot;<span style="color: blue">/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:with-param</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">GroupType</span>&quot;<span style="color: blue"> </span><span style="color: red">select</span><span style="color: blue">=</span>&quot;<span style="color: blue">$GroupType</span>&quot;<span style="color: blue">/&gt;<br />&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;/</span><span style="color: teal">xsl:call-template</span><span style="color: blue">&gt;<br />&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;/</span><span style="color: maroon">div</span><span style="color: blue">&gt;<br /></span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;/</span><span style="color: teal">xsl:template</span><span style="color: blue">&gt; </span></span></p>
<p>Este template limita-se a representar o nome do grupo (corresponde ao valor do campo pelo qual &eacute; feito o agrupamento) usando um estilo <em>MyStyle</em> definido na CSS do site. </p>
<h4>Item Style </h4>
<p>O ficheiro <strong>ItemStyle.xsl</strong> cont&eacute;m um conjunto de templates XSL que correspondem &agrave;s op&ccedil;&otilde;es dispon&iacute;veis na caixa de selec&ccedil;&atilde;o <em>Item Style</em>. Para criar um novo <em>Item Style</em> basta criar um novo template neste ficheiro. O template seleccionado ser&aacute; chamado para cada item de lista apresentado na web part. </p>
<p>Exemplo de um template de <em>Item Style</em>: </p>
<p><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:template</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">MyItemStyle</span>&quot;<span style="color: blue"> </span><span style="color: red">match</span><span style="color: blue">=</span>&quot;<span style="color: blue">Row[@Style=&#8217;MyItemStyle&#8217;]</span>&quot;<span style="color: blue"> </span><span style="color: red">mode</span><span style="color: blue">=</span>&quot;<span style="color: blue">itemstyle</span>&quot;<span style="color: blue">&gt;<br />&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:variable</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">SafeLinkUrl</span>&quot;<span style="color: blue">&gt;<br />&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:call-template</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">OuterTemplate.GetSafeLink</span>&quot;<span style="color: blue">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:with-param</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">UrlColumnName</span>&quot;<span style="color: blue"> </span><span style="color: red">select</span><span style="color: blue">=</span>&quot;<span style="color: blue">&#039;LinkUrl&#039;</span>&quot;<span style="color: blue">/&gt;<br />&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;/</span><span style="color: teal">xsl:call-template</span><span style="color: blue">&gt;<br />&nbsp;&nbsp;</span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;/</span><span style="color: teal">xsl:variable</span><span style="color: blue">&gt;<br />&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:variable</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">DisplayTitle</span>&quot;<span style="color: blue">&gt;<br />&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:call-template</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">OuterTemplate.GetTitle</span>&quot;<span style="color: blue">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:with-param</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">Title</span>&quot;<span style="color: blue"> </span><span style="color: red">select</span><span style="color: blue">=</span>&quot;<span style="color: blue">@Title</span>&quot;<span style="color: blue">/&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:with-param</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">UrlColumnName</span>&quot;<span style="color: blue"> </span><span style="color: red">select</span><span style="color: blue">=</span>&quot;<span style="color: blue">&#039;LinkUrl&#039;</span>&quot;<span style="color: blue">/&gt;<br />&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;/</span><span style="color: teal">xsl:call-template</span><span style="color: blue">&gt;<br />&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;/</span><span style="color: teal">xsl:variable</span><span style="color: blue">&gt;<br />&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:variable</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">LinkTarget</span>&quot;<span style="color: blue">&gt;<br />&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:if</span><span style="color: blue"> </span><span style="color: red">test</span><span style="color: blue">=</span>&quot;<span style="color: blue">@OpenInNewWindow = &#039;True&#039;</span>&quot;<span style="color: blue"> &gt;</span>_blank<span style="color: blue">&lt;/</span><span style="color: teal">xsl:if</span><span style="color: blue">&gt;<br />&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;/</span><span style="color: teal">xsl:variable</span><span style="color: blue">&gt;<br />&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: maroon">div</span><span style="color: blue"> </span><span style="color: red">id</span><span style="color: blue">=</span>&quot;<span style="color: blue">itemlink</span>&quot;<span style="color: blue"> </span><span style="color: red">class</span><span style="color: blue">=</span>&quot;<span style="color: blue">ItemLinkStyle</span>&quot;<span style="color: blue">&gt;<br />&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: maroon">a</span><span style="color: blue"> </span><span style="color: red">href</span><span style="color: blue">=</span>&quot;<span style="color: blue">{$SafeLinkUrl}</span>&quot;<span style="color: blue"> </span><span style="color: red">target</span><span style="color: blue">=</span>&quot;<span style="color: blue">{$LinkTarget}</span>&quot;<span style="color: blue"> </span><span style="color: red">title</span><span style="color: blue">=</span>&quot;<span style="color: blue">{@LinkToolTip}</span>&quot;<span style="color: blue">&gt;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:value-of</span><span style="color: blue"> </span><span style="color: red">select</span><span style="color: blue">=</span>&quot;<span style="color: blue">$DisplayTitle</span>&quot;<span style="color: blue">/&gt;<br />&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;/</span><span style="color: maroon">a</span><span style="color: blue">&gt;<br />&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;/</span><span style="color: maroon">div</span><span style="color: blue">&gt;<br />&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: maroon">div</span><span style="color: blue"> </span><span style="color: red">id</span><span style="color: blue">=</span>&quot;<span style="color: blue">itemdescription</span>&quot;<span style="color: blue"> </span><span style="color: red">class</span><span style="color: blue">=</span>&quot;<span style="color: blue">DescriptionStyle</span>&quot;<span style="color: blue">&gt;<br />&nbsp;&nbsp;&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: teal">xsl:value-of</span><span style="color: blue"> </span><span style="color: red">disable-output-escaping</span><span style="color: blue">=</span>&quot;<span style="color: blue">yes</span>&quot;<span style="color: blue"> </span><span style="color: red">select</span><span style="color: blue">=</span>&quot;<span style="color: blue">@MyCustomField</span>&quot;<span style="color: blue">/&gt;<br />&nbsp; </span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;/</span><span style="color: maroon">div</span><span style="color: blue">&gt;<br /></span></span><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;/</span><span style="color: teal">xsl:template</span><span style="color: blue">&gt; </span></span></p>
<p>Analisando este template podemos retirar as seguintes conclus&otilde;es: </p>
<ul>
<li>O template chama-se <em>MyItemStyle</em>. </li>
<li>A vari&aacute;vel <em>SafeLinkUrl</em> &eacute; definida para guardar o URL do item em causa. Este URL &eacute; obtido chamando o template <em>OuterTemplate.GetSafeLink</em>. </li>
<li>A vari&aacute;vel <em>DisplayTitle</em> &eacute; definida para guardar o t&iacute;tulo do item em causa. O t&iacute;tulo &eacute; obtido chamando o template <em>OuterTemplate.GetTitle</em>. </li>
<li>A vari&aacute;vel <em>LinkTarget</em> &eacute; definida para guardar o valor do atributo <em>target</em> da tag <em>a</em> no HTML final. </li>
<li>Para obter o valor de uma vari&aacute;vel local deve usar-se a nota&ccedil;&atilde;o <em>$nome-vari&aacute;vel</em> </li>
<li>Para obter o valor de um campo do item deve usar-se a nota&ccedil;&atilde;o <em>@nome-campo</em> </li>
<li>O atributo <em>disable-output-escaping</em> define se o conte&uacute;do da vari&aacute;vel deve ser escrito sem qualquer transforma&ccedil;&atilde;o, ou se os caracteres como &quot;&lt;&quot; devem ser escritos como entidades &quot;&amp;lt;&quot; </li>
</ul>
<h4>Notas </h4>
<p>No &uacute;ltimo exemplo &eacute; usado um campo customizado do item a representar na web part. Porque &eacute; um campo customizado, a Content Query Web Part n&atilde;o conseguir&aacute; obter o seu valor e mostr&aacute;-lo. Para isso &eacute; necess&aacute;rio alterar a configura&ccedil;&atilde;o da web part para que esta passe conhecer o tal campo: </p>
<ol start="1">
<li>No menu da web part, seleccionar <em>Export&#8230;</em> e guardar o ficheiro <em>.webpart</em> </li>
<li>Editar o ficheiro <em>.wepart</em> </li>
<li>Alterar o elemento<br /><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: maroon">property</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">CommonViewFields</span>&quot;<span style="color: blue"> </span><span style="color: red">type</span><span style="color: blue">=</span>&quot;<span style="color: blue">string</span>&quot;<span style="color: blue">&gt;</span></span> para<br /><span style="font-size: 10pt;font-family: Courier New"><span style="color: blue">&lt;</span><span style="color: maroon">property</span><span style="color: blue"> </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">CommonViewFields</span>&quot;<span style="color: blue"> </span><span style="color: red">type</span><span style="color: blue">=</span>&quot;<span style="color: blue">string</span>&quot;<span style="color: blue">&gt;</span>MyCustomField<span style="color: blue">&lt;/</span><span style="color: maroon">property</span><span style="color: blue">&gt;</span></span>. </li>
<li>Caso existam mais campos customizados, ent&atilde;o deve ser adicionados a este elemento, separados por caracteres <em>ponto-e-v&iacute;rgula</em>. </li>
<li>Importar o ficheiro <em>.webpart</em> (pode ser feito acedendo a <em>Site Actions &gt; Site Settings &gt; Galleries &gt; Web Parts</em> e pressionando o bot&atilde;o <em>Upload</em>) </li>
<li>Usar a nova vers&atilde;o da web par </li>
</ol>
<p><span style="color: red"><strong>Aten&ccedil;&atilde;o:</strong></span> Quando se colocam campos (<em>site columns</em>) neste elemento tem que ser usado o <em>Internal Name</em> dos mesmos. O <em>Internal Name </em>&eacute; o nome inicial que foi dado ao campo, mesmo que depois disso tenha sido renomeado. Adicionalmente todos os caracteres especiais (espa&ccedil;os e acentos) s&atilde;o substitu&iacute;dos pelos c&oacute;digos dos mesmos (por exemplo, os espa&ccedil;os s&atilde;o substitu&iacute;dos por _x0020_), por isso, o mais simples &eacute; n&atilde;o usar caracteres especiais nos nomes dos campos. </p>
<p>O que escrevi aqui decorre directamente da minha experi&ecirc;ncia com esta web part, mas encontrei alguns recursos que podem ser &uacute;teis: </p>
<ul>
<li>Tutorial de XSL-T<br /><a href="http://www.w3schools.com/xsl/default.asp">http://www.w3schools.com/xsl/default.asp</a> </li>
<li>Artigo sobre customiza&ccedil;&atilde;o da Content Query Web Part<br /><a href="http://blogs.msdn.com/ecm/archive/2006/10/25/configuring-and-customizing-the-content-query-web-part.aspx">http://blogs.msdn.com/ecm/archive/2006/10/25/configuring-and-customizing-the-content-query-web-part.aspx</a></li>
<li>Outro artigo sobre customiza&ccedil;&atilde;o da Content Query Web Part<br /><a href="http://www.sharepointblogs.com/vandest/archive/2006/10/30/15487.aspx">http://www.sharepointblogs.com/vandest/archive/2006/10/30/15487.aspx</a> </li>
</ul>
<p>Read <a href="http://andrevala.blogspot.com/2007/05/content-query-web-part-customization_22.html" title="This Post in English" target="_blank">here</a> this post in english.</p>
<p>The post <a href="https://blogit.create.pt/andrevala/2006/12/08/customizao-da-content-query-web-part/">Customização da Content Query Web Part</a> appeared first on <a href="https://blogit.create.pt">Blog IT</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blogit.create.pt/andrevala/2006/12/08/customizao-da-content-query-web-part/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
