Copied to clipboard

Flag this post as spam?

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


  • Profiterole 232 posts 264 karma points
    Mar 22, 2012 @ 16:39
    Profiterole
    0

    Look for multiples strings in property

    Hi guys, I have nodes with a "subject" property which can contain 1 or more subject (ex. : sciences or sciences,math,history, etc...)

    Visitors on site can select one or more subject with a checkbox form and I'd like to display the nodes which contains only the subject they choose.

    <xsl:variable name="sortedResults" select="$searchResults//*[@isDoc][contains($checkedSubject,subject)]"/>

     

    After that, I display nodes in my sortedResults var.

    The logic behind this is it checks if "subject" is contained in each checkedsubject (comma separated). So, is subject = "math", it looks is "math" is checked in $checkedSubject. My main trouble is if there's more than one subject in the node property.

    So, do you know how I can compare two comma separated list?

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 7x admin c-trib
    Mar 22, 2012 @ 23:21
    Chriztian Steinmeier
    0

    Hi Profiterole,

    Is the selection based off of the subject properties? (So that if a subject has the value "math,numbers" there's only a single checkbox for those, or will there be a "math" checkbox and a "numbers" checkbox?)

    If you split both lists using the Split() extension, you should be able to select only those from the second that have a corresponding value in the first.

    /Chriztian

  • Profiterole 232 posts 264 karma points
    Mar 23, 2012 @ 13:06
    Profiterole
    0

    In the property there is a checkbox for each subjects and (front end) in the form there is a checkbox for each choices. So, I'll try to split each list and compare them... thank you for the idea.

Please Sign in or register to post replies

Write your reply to:

Draft