Forums / Developer / Search constrained by values in "selection" attribute

Search constrained by values in "selection" attribute

Author Message

Koos TDK

Monday 06 September 2004 7:22:06 pm

Hi!

I hope some-one can help me. I have made a class, that (among others) has a "selection" attribute called "regions" that contains geographical regions(provinces/counties).

I would like to set up a search where you can search for a certain business or product(I have been able to set it to search only in a specific node), but only within a specific geographical region, which can be selected from a drop-down list.

I tried something like the following, but it only gives me the NAMES of the attributes in the class. I want to be able to constrain my search to a VALUE inside on of those attributes. (By the way, if anyone can point me to a doc that can tell me how the variables below are concatenated and the meaning of each, I will be most grateful! I just don't know what options are available for use, then maybe I would be able to help myself :-) ):

{section name=Attribute show=$search_contentclass_id|gt(0)}

<select name="SearchContentClassAttributeID">
<option value="-1">Any attribute</option>
{section name=ClassAttribute loop=$search_content_class_attribute_array}
<option value="{$Attribute:ClassAttribute:item.id}" 
        {section show=eq($search_contentclass_attribute_id,$Attribute:ClassAttribute:item.id)}
            selected="selected"
        {/section}>{$Attribute:ClassAttribute:item.name|wash}</option>
{/section}
</select>

Thanks for anybody taking the time to help me out!

Koos TDK

Tuesday 07 September 2004 5:37:47 am

Hi, sorry to bump this, but I am sure it should have an easy solution. Being a newbie, I just need to get my head around a few things so I can help myself and later hopefully others as well.

Any help much appreciated! :-)

Eirik Alfstad Johansen

Tuesday 07 September 2004 7:12:35 am

Hi Koos,

Try

{$search_content_class_attribute_array|attribute(show)}

to view the contents of the attribute array.

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Koos TDK

Tuesday 07 September 2004 7:44:17 am

Thanks Eirik, will test your suggestion!