Custom Web Publishing Guide

Table Of Contents
Appendix C
|
Converting CDML solutions to FileMaker XSLT 145
CDML tag name: Image
Tag is replaced with a container URL reference to the image in the specified field
CDML syntax: [FMP-Image: FieldName]
XSLT-CWP conversion:
1 when current context is a record: <xsl:call-template name="get-image"><xsl:with-param name="fieldname"
select="'fieldname'"/><xsl:with-param name="recid" select="$record/@record-id"/></xsl:call-template>
1 otherwise: <xsl:call-template name="get-image"><xsl:with-param name="fieldname"
select="'fieldname'"/><xsl:with-param name="recid" select="$default-record/@record-id"/></xsl:call-template>
Conversion example
Original CDML: [FMP-If: First Name .eq. field: Nick Name]
Your nick name is the same as your name.
[/FMP-If]
Converted XSLT-
CWP:
<xsl:choose><xsl:when test="'First Name' = fmrs:field[@name = 'Nick Name']/fmrs:data[1]">
Your nickname is the same as your name.
</xsl:when></xsl:choose>
Converted Result: Your nick name is the same as your name.
Conversion example
Original CDML: <img src="[FMP-Image: pictures]">
Converted XSLT-CWP: <img>
<xsl:attribute name="src">
<xsl:call-template name="get-image">
<xsl:with-param name="fieldname" select="'pictures'"/>
<xsl:with-param name="recid" select="$default-record/@record-id"/>
</xsl:call-template>
</xsl:attribute>
</img>
Converted Result: <img src="/fmi/xsl/cnt/data.jpg?-db=products&-lay=product_list&-recid=2&-
field=pictures"/>