Thursday 10 March 2005 1:11:12 am
Hi Roberto,
If you want to narrow your search results by some specific attributes, you can do so making use of the advancesearch module and overriding the template "/standard/templates/content/advancesearch.tpl", you need to fill the array "Content_search_attribute...." with the new search requirements. Here is an example, i have a class "Studium" with this attributes : name (text line), poeng (text line) and varighet (text line). I want to set a customized advanced search where the search is done only in the object with an specific varighet (lets say the id for this attribute is 195), the form in my template looks like this :
<form method="get" action={'/content/advancedsearch'|ezurl}>
<input type="text" name="SearchText" value="{$full_search_text}" >
Varighet:
<input type="hidden" name="Content_search_attribute_fulltext_classattribute_id[]" value="195" />
<input type="text" name="Content_search_attribute_fulltext_value[]" value="{$search_array_by_class_attribute_id['195']['value']}" />
<input type="submit" value="Search" name="SearchButton">
As you can see, after one search is done, you get the values entered before in the array "$search_array_by_class_attribute_id". You can also narrow the search using ranges
Age:
<input type="hidden" name="Content_search_attribute_byrange_classattribute_id[]" value="400" />
From:<input type="text" name="Content_search_attribute_byrange_from[]" value="" />
To: <input type="text" name="Content_search_attribute_byrange_from[]" value="">
Or if you are searching in an attribute of the integer type:
Age:
<input type="hidden" name="Content_search_attribute_integer_classattribute_id[]" value="400" />
<input type="text" name="Content_search_attribute_integer_value[]" value="" />
Hope this helps.
|