1

I am trying to achieve what is mentioned in the title, but having trouble, need help. I am modifying the following templates

1. <xsl:template name="View_Default_RootTemplate" mode="RootTemplate" match="View" ddwrt:dvt_mode="root" ddwrt:ghost="hide">

2. <xsl:template match="View" mode="full" ddwrt:ghost="hide">

3. <xsl:template mode="Item" match="Row" ddwrt:ghost="hide">

Q-1 Should i be modifying any other templates?

Desired end result - To render a recursive view and each list item as <li>listitem...</li> surrounded by a top level <ul>

Q-2 when i change the elements to <ul> and <tr> to <li> the final page is still rendered with tables which i don't see in the templates and the <ul> & <li> changes are inserted into some unknown <td>, the questions are

a. What is the right way to do this?

b. what template is applied in this case?

1

It sounds like you are looking for a simple enough solution so I would suggest writing a separate XSLT stylesheet rather than trying to customise the thousands of lines that are in a standard stylesheet. There is a 3-part tutorial on my blog which should help with the basics but essentially you need the following:

<xsl:template match="/">
 <xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row" />
 <ul>
 <xsl:for-each select="$Rows">
  <xsl:call-template name="RowView" />
 </xsl:for-each>
 </ul>
</xsl:template>
<xsl:template name="RowView">
 <li>
  <xsl:value-of select="@ColumnName" />
 </li>
</xsl:template>
  • thanks, great blog Dave, but by this method i have to sacrifice the recursive folders view. – Ashish Madkaikar Mar 30 '13 at 3:13
  • Change the view on your web part - under Folders set to Show All Items Without Folders. – Dave Paylor Mar 30 '13 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.