Developer forum

Forum » Templates » Data List - how to reach different inputs in list template (xslt)

Data List - how to reach different inputs in list template (xslt)

Lise Trabjerg Pedersen
Reply
XSLT is absolutely not my best :-)
But I'm trying to build a list template in xslt, because I want it to be with picture shown, only link to detail on the name, and a few other informations only shown as text.

I have grabbed a little here and there, also from this forum, but now I'm struggling with an expression like this:

      <xsl:choose>
<xsl:when test="starts-with(Row.Value, '/Billeder/ungebanken')">
<a href="{Row.DetailUrl}">
<img>
<xsl:attribute name="src">http://www.uu-herning.dk/admin/public/getimage.aspx?image=Files<xsl:apply-templates select="Row.Value" />&amp;width=30&amp;height=40</xsl:attribute>
<xsl:attribute name="border">0</xsl:attribute>
</img>
</a>
</xsl:when>
<xsl:when test = "Row.Column.Name = '@stamkort_Navn'">
<a href="{Row.DetailUrl}">
<xsl:apply-templates select="Row.Value" />
</a>
</xsl:when>

<xsl:otherwise>
<xsl:apply-templates select="Row.Value" />
</xsl:otherwise>
</xsl:choose>
</td>
</xsl:template>

To my surprise, the image thing works - but the rest...
I can't really find an example that matches, so now I'm asking you all for help? What is the right way to reach e.g. the name input "stamkort_Navn"?

Kind regards from a non-xslt-expert!

Replies

 
Vladimir
Reply
Hi Lise!
You may use ?savetemplatexml=true  (add this parameter to page url) to see xml data that your xslt is handled - it will saved in \Files\Templates\DataManagement\Publishings\Custom folder.
The errors:
1) Row.Column.Name - Row.ColumnName
2) '@stamkort_Navn' - 'stamkort_Navn'  ( @ is used to get attributes )

Best regards,
Vladimir

 

You must be logged in to post in the forum