Copied to clipboard

Flag this post as spam?

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


  • Probocop 51 posts 71 karma points
    Sep 15, 2010 @ 10:34
    Probocop
    0

    Repeatable Custom Content, trouble getting values in loop

    Hi, I'm using the Repeatable Custom Content package to add a list of 'people' to the site I'm working on, but I'm having a bit of trouble getting the field values out within the loop. 

    The foreach loop works correctly as it displays <p>Team Member Item</p> three times, but the other two elements within the foreach do not display. Any idea? My XSLT so far is as follows:

    <?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" xmlns:autofolders.library="urn:autofolders.library" 
      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets umbraco.contour autofolders.library ">

      <xsl:output method="xml" omit-xml-declaration="yes"/>

      <xsl:param name="currentPage"/>

      <xsl:template match="/">
        <xsl:if test="count($currentPage/pageTeamDetails/items/item) &gt; 0">
          <h2 class="team-heading">Team Members</h2>
          <div class="team-row">
            <xsl:for-each select="$currentPage/pageTeamDetails/items/item">
              <div>
                <p>Team Member Item</p>
                <p><strong><xsl:value-of select="teamName"/></strong></p>
                <p><xsl:value-of select="jobTitle"/></p>
              </div>
            </xsl:for-each
        </div>
        </xsl:if>
      </xsl:template>
    </xsl:stylesheet>

     

Please Sign in or register to post replies

Write your reply to:

Draft