Content Query Web Part parameter to XSL Stylesheet

I will add the web part title property just to demonstrate how this can be done. Open your custom content query web part .webpart file and under property "ParameterBindings" add your property so the code would look like:

<property name="ParameterBindings" type="string">
    <ParameterBinding Name="WebPartTitle" Location="WPProperty(Title)"/>
... where the WPProperty(Title) ... Title is your property. Then go to the /Style Library/Custom Style Sheets/ContentQueryMain.xsl or wherever your ContentQueryMain.xsl is and after to other params add yours ...

<xsl:param name="WebPartTitle" />
... so now the value of the web part title property can be used in both (ContentQueryMain.xsl and ItemStyle.xsl) XSL files as example:

<xsl:value-of select="$WebPartTitle" />
One good reference for passing the CurrentPos in your ItemStyle.xsl here: Custom Date Formats in SharePoint XSL:
Posted on

Tags: SharePoint, Content Query Web Part, XSL Stylesheet