0

I have an XSLT file where I output the image source using an attribute. It works fine or should I say it was working fine until I realised that it's outputting two values the same that are now stopping the images working.

<img class="right" alt="TN">
  <xsl:attribute name="src">
    <xsl:value-of select="@Thumbnail" />
  </xsl:attribute>
</img>

The output is as follows:

<img class="right" src="images/thumb01.jpg, images/thumb01.jpg" alt="Image">

Does anyone know how or why this may be happening?

0

It doesn't duplicates, by default Image / Link field has two values. First is URL, second is description. When description left empty, it automatically fills up same as URL. To prevent displaying description in src, you might it cut off.

So use this:

<xsl:value-of select="substring-before(@Thumbnail, ',')" />

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.