Copied to clipboard

Flag this post as spam?

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


  • fermat 4 posts 24 karma points
    Jan 06, 2013 @ 00:34
    fermat
    0

    search based on checkboxes with XSLTsearch

    Hi all,

    I am working on an ecommerce project. I have products as content nodes. and product datatype has a checkboxlist property. I want to end users able to search for products when he checks the checkboxes and clicks the search button. is possible doing it via XSLTSearch? btw i use umbraco 4.9

    I appreciate your helps.

    Fermat

  • Jeffrey Valeroso 40 posts 101 karma points
    Jan 07, 2013 @ 05:46
    Jeffrey Valeroso
    0

    Yes

  • fermat 4 posts 24 karma points
    Jan 07, 2013 @ 10:41
    fermat
    0

    and how can I do that?

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Jan 07, 2013 @ 12:02
    Douglas Robar
    0

    The general idea is that you'd add a checkbox to your search form and give it a name and id. Then, in the xsltsearch.xslt file you would check for the existance and value of the form field to see if it exists and is ticked (see how the search request field is pulled in from the form submission as an example). If the checkbox is ticked then you'd add a condition to the xpath where the 'possibleNodes' variable is set, checking that the appropriate document type(s) are included or excluded from the search results.

    You would include extra conditions in the xpath such as this, for excluding a specific document type:

    and name() != 'ImageGalleryPhoto'

    Or to include only the product and productItem document types in the results you would include this xpath condition:

    and (name() = 'product' or name() = 'productItem')
    cheers,
    doug. 
Please Sign in or register to post replies

Write your reply to:

Draft