Why is there no formatting on my image captions when I export via some templates?

Problem: The problem is when the fact sheets are exported no formatting such as italics or bold etc appears in the image captions.

Solution: Some template authors may use the ‘plain text’ version of the caption, rather than the formatted caption as it guarantees clean text for the image caption and won’t interfere with image viewing scripts such as Lightbox. If you prefer to use the formatted edition of your media captions then you easily change the template to do so.

Open your templates folder and look in the sub-folder called ‘fs_template’. Assuming the template is based on a default FSF v2 template you will see the image processing template called ‘media_image.xslt’. Open this in a text editor such as Notepad++ and look for the following block of code:

<xsl:if test="captionalttext !=''">
<xsl:attribute name="title">
<xsl:value-of select="captionalttext"><xsl:text> </xsl:text>
</xsl:value-of></xsl:attribute>
</xsl:if>

The above code adds an attribute called ‘title’ to the images HREF tag, which is used by the Lightbox script. The title text is derived from the captions alt text,which the plain text version of the caption. You can change this to use the regular ‘formatted’ caption text by changing it to:

<xsl:if test="caption !=''">
<xsl:attribute name="title">
<xsl:value-of select="caption"><xsl:text> </xsl:text>
</xsl:value-of></xsl:attribute>
</xsl:if>

Further below this section is where the image caption is rendered below the image:

<xsl:if test="caption !=''">
<xsl:value-of select="captionalttext" disable-output-escaping="yes">
</xsl:value-of>
</xsl:if>

Change this to use formatted caption text like so:

<xsl:if test="caption !=''">
      <xsl:value-of select="caption" disable-output-escaping="yes"></xsl:value-of>
</xsl:if>

Note: As always we recommend backing up your template before attempting any customisations. You must take care when editing XSLT as any broken tags or missing tags will prevent the template from working.