<!-- The fun starts here --> <ul> <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']"> <li> <b> Titel</b> <xsl:value-of select="./@nodeName"/>
So you can choose 3 pictures. But now you have to choose 3 picutres, because if you just select 1 or 2 picutes then you will get an error and the pictures are not shown. So how to: that at least 1 picture can selected and a maximum of 3 pictures?
dropdown
Hi everybody,
I try to make a dropdown with the values: yes/no. Bij properties of tab generic properties, I choose:dropdown and name the property: verkocht.
I have a xslt file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:umbraco.contour="urn:umbraco.contour"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<!-- The fun starts here -->
<ul>
<xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
<li>
<b> Titel</b> <xsl:value-of select="./@nodeName"/>
<p>
<b>Omschrijving:</b> <xsl:value-of select="./omschrijving"/>
</p>
<p>
<b>Prijs:</b> <xsl:value-of select="prijs"/>
</p>
<p>
<b>Verkocht:</b>
<xsl:variable name="verkocht" select="umbraco.library:Split('ja,nee', ',')" />
<xsl:for-each select="$verkocht/value">
<xsl:value-of select="current()"/>
</xsl:for-each>
</p>
<p>
<xsl:choose>
<xsl:when test="string-length(./goudPlaatje1) > 0">
<img src="{umbraco.library:GetMedia(./goudPlaatje1, true())/umbracoFile}" />
<img src="{umbraco.library:GetMedia(./goudPlaatje2, true())/umbracoFile}" />
<img src="{umbraco.library:GetMedia(./goudPlaatje3, true())/umbracoFile}" />
</xsl:when>
<xsl:otherwise>
<img src="{./uploadImage}" />
</xsl:otherwise>
</xsl:choose>
</p>
</li>
</xsl:for-each>
</ul>
</xsl:template>
</xsl:stylesheet>
But I dont see the values, see the picture:
Hi,
Why not make use of a boolean instead just like you would do with umbracoNaviHide ?
Hi Thx.
Like this:
<p>
<b>Verkocht:</b>
<xsl:when test="not(verkocht = 1)">
<xsl:variable name="verkocht" select="umbraco.library:Split('ja,nee', ',')" />
<xsl:for-each select="$verkocht/value">
<xsl:value-of select="current()"/>
</xsl:for-each>
</xsl:when>
</p>
I have other question:
I have this, to choose pictures:
<p>
<xsl:choose>
<xsl:when test="string-length(./goudPlaatje1) > 0">
<img src="{umbraco.library:GetMedia(./goudPlaatje1, true())/umbracoFile}" />
<img src="{umbraco.library:GetMedia(./goudPlaatje2, true())/umbracoFile}" />
<img src="{umbraco.library:GetMedia(./goudPlaatje3, true())/umbracoFile}" />
</xsl:when>
<xsl:otherwise>
<img src="{./uploadImage}" />
</xsl:otherwise>
</xsl:choose>
</p>
So you can choose 3 pictures. But now you have to choose 3 picutres, because if you just select 1 or 2 picutes then you will get an error and the pictures are not shown. So how to: that at least 1 picture can selected and a maximum of 3 pictures?
THX
is working on a reply...