Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • savantKing99 70 posts 120 karma points
    May 12, 2013 @ 18:51
    savantKing99
    0

    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 "&#x00A0;"> ]>
    <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>&nbsp;<xsl:value-of select="./@nodeName"/>           
               
                <p>
                    <b>Omschrijving:</b>&nbsp;  <xsl:value-of select="./omschrijving"/>
              </p>
               
                <p>
                    <b>Prijs:</b>&nbsp; <xsl:value-of select="prijs"/>
              </p>
               
                <p>
                    <b>Verkocht:</b>&nbsp;
                      
                   
                    <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) &gt; 0">
                    <img src="{umbraco.library:GetMedia(./goudPlaatje1, true())/umbracoFile}" />
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./goudPlaatje2, true())/umbracoFile}" />
                      &nbsp;
                    <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:

     

  • Fuji Kusaka 2203 posts 4220 karma points
    May 12, 2013 @ 18:59
    Fuji Kusaka
    0

    Hi,

    Why not make use of a boolean instead just like you would do with umbracoNaviHide  ?

    <xsl:when test="not(verkocht = 1)">
  • savantKing99 70 posts 120 karma points
    May 12, 2013 @ 19:08
    savantKing99
    0

    Hi Thx.

     

    Like this:

     

    <p>
                    <b>Verkocht:</b>&nbsp;
                      
                    <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>

  • savantKing99 70 posts 120 karma points
    May 12, 2013 @ 19:10
    savantKing99
    0

    I have other question:

    I have this, to choose pictures:

     <p>
                <xsl:choose>
                  <xsl:when test="string-length(./goudPlaatje1) &gt; 0">
                    <img src="{umbraco.library:GetMedia(./goudPlaatje1, true())/umbracoFile}" />
                      &nbsp;
                    <img src="{umbraco.library:GetMedia(./goudPlaatje2, true())/umbracoFile}" />
                      &nbsp;
                    <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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies