Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have the following markup:

<ul id="slider">    
    <!-- slider item -->
    <li>
        ...
    </li>
    <!-- end of slider item -->
</ul>

and I have defined the following xsl in header.xsl and itemStyle.xsl for displaying data from a SharePoint 2010 List:

<!-- in header.xsl -->
<xsl:template name="Slider" match="*[@GroupStyle='Slider']" mode="header">
    <ul id="slider">
    </ul>
</xsl:template>

<!-- in itemStyle.xsl -->
<xsl:template name="Slider" match="Row[@Style='Slider']" mode="itemstyle">
    <xsl:variable name="SafeImageUrl">
        <xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
            <xsl:with-param name="UrlColumnName" select="@Picture"/>
        </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="Title">
        <xsl:call-template name="OuterTemplate.GetTitle">
            <xsl:with-param name="Title" select="@Title" />
        </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="Details">
        <xsl:call-template name="OuterTemplate.GetTitle">
            <xsl:with-param name="Title" select="@Details" />
        </xsl:call-template>
    </xsl:variable>
    <li>
        <img src="{$SafeImageUrl}" alt="{$Title}" />
        <section class="media-description">
            <h2 class="slider-headline"><xsl:value-of  disable-output-escaping="yes" select="$Title" /></h2>
            <p><xsl:value-of disable-output-escaping="yes" select="$Details" /></p>
        </section>
    </li>
</xsl:template>

but the thing is, I want the ul element to wrap those li's directly, as shown above in the markup, so how can I do that ? or is there a better way to achieve that ?

share|improve this question
    
Could you state the problem first. I don't know what you are trying to accomplish. –  user15994 Mar 29 '13 at 18:51
add comment

1 Answer 1

up vote 1 down vote accepted

Put the ULs inside contentquerymain.xsl instead of header.xsl

share|improve this answer
    
can u explain a bit please, how should I put them ? and how will they be applied ? –  Anas Nakawa Jul 17 '11 at 8:43
1  
You'll need to copy & paste Contenquerymain.xsl as a new file, and have your CQ web part point to the new xsl file. The ContentQueryMain.xsl file will have a moment where it calls the ItemStyle templates. Essentially, you want to wrap your UL tags around the call to the ItemStyle. Here's a blog post that explais customising the cqmain.xsl file - panvega.wordpress.com/2009/03/20/… –  James Love Jul 17 '11 at 10:57
    
thanks, your comment solve my problem :) –  Anas Nakawa Jul 18 '11 at 14:41
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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