Copied to clipboard

Flag this post as spam?

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


  • ianhoughton 281 posts 605 karma points c-trib
    Feb 24, 2012 @ 09:44
    ianhoughton
    0

    GetPreValueAsString in XSLT

    I'm trying to get the text from a radiobutton list but am getting an XSLT error:

    <xsl:param name="currentPage"/>
    
    <xsl:template match="/">
    
    <!-- Create filter box -->
    <div id="filterBox">
      <form id="filter">
      <fieldset class="category">
        <legend>Filter by Category</legend>
        <label class="label_radio"><input type="radio" name="type" value="all" checked="checked" />All Categories</label>
        <xsl:variable name="prevalues" select="umbraco.library:GetPreValues(1187)" />
            <xsl:for-each select="$prevalues/*">
              <xsl:sort select="."/>
              <label class="label_radio">
                 <input type="radio" name="type"><xsl:attribute name="value">
                    <xsl:value-of select="." /></xsl:attribute><xsl:value-of select="." />
                 </input>
              </label>
            </xsl:for-each>
      </fieldset>
    </form>
    </div>
    
    <ul id="clubList">
    <xsl:for-each select="$currentPage/* [@isDoc and string(umbracoNaviHide) != '1']">
        <li>  
        <xsl:attribute name="data-id">id-<xsl:value-of select="position()"/></xsl:attribute>
        <xsl:if test="./clubCategory!=''">
    
          <!-- This is where the macro fails, its doesn't seem to like the GetPreValueString -->
          <!--<xsl:attribute name="data-type"><xsl:value-of select="umbraco.library:GetPreValueAsString(clubCategory)"/></xsl:attribute>-->
    
          <!-- Although it will return the correct clubCategory ID from the radiobutton list -->
          <xsl:attribute name="data-type"><xsl:value-of select="clubCategory"/></xsl:attribute>
    
          </xsl:if>
        <a href="{umbraco.library:NiceUrl(@id)}">
          <xsl:value-of select="@nodeName"/>
        </a>
        <div class="clearBoth"></div>
        <div class="clubListing">
        <img src="{concat(substring-before(umbracoFile,'.'), '_clubThumbnail.jpg')}" class="right clubThumb" alt="{alternateText}" title="{alternateText}" width="120px" height="75px" />
        <p><xsl:value-of select="snippetText"/></p>
        </div>
      </li>
    </xsl:for-each>
    </ul>
    
    </xsl:template>
    <li data-id="id-1" data-type="28"></li>
    <li data-id="id-2" data-type="29"></li>
    <li data-id="id-3" data-type="28"></li>
    <li data-id="id-4" data-type="31"></li>
    <li data-id="id-5" data-type="32"></li>
  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Feb 24, 2012 @ 09:54
    Chriztian Steinmeier
    0

    Hi ianhoughton,

    What does the error say? Is it the "Value was either too large or too small for an Int32." ?

    /Chriztian 

  • ianhoughton 281 posts 605 karma points c-trib
    Feb 24, 2012 @ 17:52
    ianhoughton
    0

    it look like this line wasn't pulling out any items without a Value

     

    <xsl:iftest="./clubCategory!=''">

    There was 1 node without a value.

     

Please Sign in or register to post replies

Write your reply to:

Draft