Copied to clipboard

Flag this post as spam?

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


  • Lasya 38 posts 70 karma points
    Jun 20, 2013 @ 17:41
    Lasya
    0

    how to add contour entry values with xslt

    I have a contour form with no.of entries. and each entry/record has no.of people field.

    I need to display total no.of people by adding all records no.of people field value in the frent end using xslt file.

    Thanks,

    Lasya.

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jun 20, 2013 @ 20:50
    Jan Skovgaard
    0

    Hi Lasya

    You can get the total number of records by using umbraco.contour:GetRecordsFromPage() extension in XSLT.

    You need to provide the extension with the page id where you have placed the form.

    This can be done by creating a variable like this

    <xsl:variable name="records" select="umbraco.contour:GetRecordsFromPage($currentPage/@id)" />

    Then you can write out the number records like this

    <xsl:value-of select="count($records/uformrecord)" />

    However this will give you all records - so if you only want to show approved records (Depends on how your worflow has been setup). Then you should add a predicate to make sure only approved records are counted. Like this

    <xsl:value-of select="count($records/uformrecord[state='Approved'])" />

    Hope this helps!

    /Jan

  • Lasya 38 posts 70 karma points
    Jun 21, 2013 @ 11:15
    Lasya
    0

    Hi Jan

    I got that one already.

    but i need to add all the records field values.(just like total no.of attendees)

    <xsl:value-of select="sum(..//fields/noofadults/value)"/>

    any help please.

     

    Thanks,

    Lasya

  • 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