But what if you want to use some value from the page in your xsl? Luckily there is a way to pass it using ParameterBindings element.
The code below allows you to pass different types of values to your xsl:
<WpNs0:ContentByQueryWebPart ...
WebPartAttributeName="WebPartAttributeValue" >
...
<ParameterBindings>
<ParameterBinding Name="StaticValue"
DefaultValue="240px" />
<ParameterBinding Name="WebPartAttribute"
Location="WPProperty(WebPartAttributeName)" />
</ParameterBindings>
</WpNs0:ContentByQueryWebPart>
To use this in your xsl define variables and use them:
<xsl:param name="StaticValue" />
<xsl:param name="WebPartAttribute" />
...
<h1 class="{$StaticValue}">
<value-of select="$WebPartAttribute" />
</h1>
You can read more about ParameterBinding element here
Немає коментарів:
Дописати коментар