1

I'm using the itemstyle.xsl file to format a CQWP query on a page. Everything is working except that I want to fix the height and width of an image. I'm displaying the image with :

<xsl:value-of select="@PublishingPageImage" disable-output-escaping="yes" />

The output of this line is :

<img style="BORDER: 0px solid; " src="/SiteCollectionImages/theImage.gif" alt="">

Is there a way to set the width and height of the image on ? I'm not a big xslt expert... I couldn't find any example.

Thank you, Chris

| improve this question | | | | |
2

In your XSLT when you render the Image you can add attributes to that element.

Example:

<img src="{$ImageUrl}" title="blah" alt="blah">
    <xsl:attribute name="height">90px</xsl:attribute>
    <xsl:attribute name="width">150px</xsl:attribute>
</img>

Hope this helps :)

| improve this answer | | | | |

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.