Copied to clipboard

Flag this post as spam?

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


  • Thomas 66 posts 88 karma points
    Nov 24, 2011 @ 14:47
    Thomas
    0

    list only items which contains certain field

    Hi I'm using contour and wants to get a list of records, but filter out records without a comment field.

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

    returns all records, but not limited to records with comments.

    When I add this:

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

    I get the right records - bu t only the comment values.

    I've did also try with

    <xsl:variable name="records" select="umbraco.contour:GetRecordsFromPage($currentPage/@id)/uformrecord/fields[comment !='']" />

    But that does'nt return anything

    How do I get the full record but limit it to those with comments?

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Nov 24, 2011 @ 15:15
    Tom Fulton
    0

    Try this:

    <xsl:variable name="records" select="umbraco.contour:GetRecordsFromPage($currentPage/@id)/* [./fields/comment]" />
  • Tom Fulton 2030 posts 4998 karma points c-trib
    Nov 24, 2011 @ 15:16
    Tom Fulton
    0

    Well, the above checks to see if the comment node is there...if the comment node always exists regarldess of it contains data, try:

    <xsl:variable name="records" select="umbraco.contour:GetRecordsFromPage($currentPage/@id)/* [not(normalize-space(./fields/comment))]" />
  • Thomas 66 posts 88 karma points
    Nov 24, 2011 @ 15:44
    Thomas
    0

    Thanks Tom - that did it, although the XML format changed a bit

Please Sign in or register to post replies

Write your reply to:

Draft