SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following markup:

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

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

<!-- 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:variable name="Title">
        <xsl:call-template name="OuterTemplate.GetTitle">
            <xsl:with-param name="Title" select="@Title" />
    <xsl:variable name="Details">
        <xsl:call-template name="OuterTemplate.GetTitle">
            <xsl:with-param name="Title" select="@Details" />
        <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>

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
try this above link – Ma6139735 Apr 27 at 6:31
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
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 -… – James Love Jul 17 '11 at 10:57
thanks, your comment solve my problem :) – Anas Nakawa Jul 18 '11 at 14:41

Your Answer


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.