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!

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 06:19:06
Script start
Timing: Jan 31 2025 06:19:06
Module start 'layout'
Timing: Jan 31 2025 06:19:06
Module start 'content'
Timing: Jan 31 2025 06:19:06
Module end 'content'
Timing: Jan 31 2025 06:19:06
Script end

Main resources:

Total runtime0.0122 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0045 588.2813151.2266
Module start 'layout' 0.00450.0018 739.507836.6797
Module start 'content' 0.00630.0047 776.187594.2188
Module end 'content' 0.01100.0011 870.406333.9922
Script end 0.0122  904.3984 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002016.6028140.0001
Check MTime0.00097.6293140.0001
Mysql Total
Database connection0.00086.541110.0008
Mysqli_queries0.001613.078330.0005
Looping result0.00000.097710.0000
Template Total0.00097.210.0009
Template load0.00075.392310.0007
Template processing0.00021.762310.0002
Override
Cache load0.00043.663310.0004
General
dbfile0.00064.886380.0001
String conversion0.00000.050840.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs