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
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')
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
Yes
and how can I do that?
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.
is working on a reply...