Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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.
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
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.
Lasya
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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.
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
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
is working on a reply...