3 users online. Create an account or sign in to join them.Users
Meta Keywords in the head section of an XSLT file
This is an open discussion with 4 replies, filed under General.
Search
The {data/settings/entry/website-keywords} syntax isn't calling your template but instead simply doing a value-of. To call your template you have to do something like
<meta name="keywords">
<xsl:attribute name="content">
<xsl:apply-templates select="data/settings/entry/website-keywords" />
</xsl:attribute>
</meta>
Thank you phoque. You are right. This works
<xsl:if test="position() != last()">, </xsl:if>
Great, thanks kalvind.
Create an account or sign in to comment.
What would be the best way to include the meta keywords tag in the head section of an XSLT file? My difficulty is that I need to include the value of each keyword insite an html tag attribute.
My template
<xsl:template match="data/settings/entry/website-keywords"> <xsl:for-each select="item"> <xsl:value-of select="."/> <xsl:text>, </xsl:text> </xsl:for-each> </xsl:template>called in the master file
<meta name="keywords" content="{data/settings/entry/website-keywords}"/>renders this code in the browser
I can't figure out why I'm getting these extra characters
Could anyone help me please?