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

share|improve this question

1 Answer 1

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 :)

share|improve this answer

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.