In order to add a list view web part on a page with list header (for example, you want to use your custom list as a left navigation menu, similar to Categories web part in SharePoint blog site), replace the <ListViewXml> with the item below and then change the View Name value equal to the listview webpart id (__WebPartId).
<ListViewXml xmlns="http://schemas.microsoft.com/WebPart/v2/ListView"><View Name="{D5DE4857-09A5-49CC-8EB3-5D26EDC40238}" Type="HTML" Hidden="TRUE" DisplayName="" Url="/blog/default.aspx" Level="1" BaseViewID="4" ContentTypeID="0x"><Toolbar Type="None"/><ViewHeader><HTML><![CDATA[ <div class="ms-WPBody"> <div class="ms-navheader">]]></HTML><HTML><![CDATA[<a ]]></HTML><HTML><![CDATA[ id="defviewurl]]></HTML><Counter Type="View"/><HTML><![CDATA[">]]></HTML><ListProperty Select="Title" HTMLEncode="TRUE"/><HTML><![CDATA[</a>]]></HTML><HTML><![CDATA[</div> <table cellpadding="0" cellspacing="0" border="0" class="">]]></HTML></ViewHeader><ViewEmpty><HTML><![CDATA[ <div class="ms-WPBody"> <div class="ms-navheader">]]></HTML><HTML><![CDATA[<a ]]></HTML><HTML><![CDATA[ id="defviewurl]]></HTML><Counter Type="View"/><HTML><![CDATA[">]]></HTML><ListProperty Select="Title" HTMLEncode="TRUE"/><HTML><![CDATA[</a>]]></HTML><HTML><![CDATA[</div> <table cellpadding="0" cellspacing="0" border="0" class="ms-navSubMenu2">]]></HTML><HTML><![CDATA[<tr><td><div class="ms-BlogEmptyListText">]]></HTML><HTML>There are no items in this list.</HTML><HTML><![CDATA[</div></td></tr>]]></HTML><HTML><![CDATA[</table></div>]]></HTML></ViewEmpty><ViewBody><HTML><![CDATA[<tr class="ms-CategoryTitleRow"><td class="ms-CategoryTitleCell" id="lnkurl]]></HTML><Column Name="ID" URLEncode="TRUE"/><HTML><![CDATA[">]]></HTML><Field Name="URL"/><HTML><![CDATA[</td></tr>]]></HTML></ViewBody><ViewFooter><HTML><![CDATA[</table></div>]]></HTML></ViewFooter><RowLimitExceeded><HTML><![CDATA[<div class="ms-BlogMoreLinks"><a href="]]></HTML><ListProperty Select="DefaultViewUrl"/><HTML><![CDATA[" ID=onetidMoreFavs>
]]></HTML><HTML>(More Links...)</HTML><HTML><![CDATA[
</a></div>]]></HTML></RowLimitExceeded><Query><OrderBy><FieldRef Name="Order" Ascending="TRUE"/></OrderBy></Query><ViewFields><FieldRef Name="URL"/></ViewFields><RowLimit>30</RowLimit></View></ListViewXml>
After doing the modifications, it will now show the list header of the custom list as shown below:
No comments:
Post a Comment