Canned Advanced Search

Author Message

Philip Redmon

Tuesday 13 July 2004 1:22:31 pm

I'm trying to set up a 'canned' advanced search page to force users to choose from existing values within a specific attribute across a class. ie:

Class: Article
Attributes: Title, Intro, Body

sample data:
Title: Dog
Intro: About a Dog
Body: Body

Title: Cat
Intro: About a Cat
Body: Body

Title: Dog
Intro: About a Cat
Body: Body

I want to create a search form that grabs the desired attributes (Title, Intro), places them into a select box, populates another select box existing attribute values (Dog, Cat for one, About a Dog, About a Cat for the other), and then implements the search on those selections.

My code for the select boxes is:

<select name="Content_search_attribute_fulltext_value[]">
<option value="dog">dog</option>
<option value="cat">cat</option>
</select>

<select name="Content_search_attribute_fulltext_classattribute_id[]">
<option value="163">Title</option>
<option value="165">Intro</option>
</select>

So, I need a fetch that will that will populate the select box with the values (dog, cat) of the attribute (Title, Intro) within the specific class (Article).

Edit:
I _have_ spent a lot of time searching for the proper code, and what I have found has gotten me close,

{section loop=fetch( 'content', 'class_attribute_list', hash( 'class_id', 14 ) )}
  {$:item.name|wash}
{/section}

{let class_attribute=fetch( 'content', 'class_attribute', hash( 'attribute_id', 163 ) )}
  {$class_attribute.name|wash}
{/let}

The first of which gets me a list of the attributes from the class_id, and the second which gets me the name of the attribute from the attribute_id. There's 'object_by_attribute' as well, but I'm looking for something that fetches all values of an attribute. I'm beginning to question whether this is possible?!

Philip Redmon

Tuesday 20 July 2004 2:26:03 pm

Upon further inspection, I don't think I can get what I want by using a fetch, as there exists no such functionality.

I've tested multiple attribute searching using search boxes,
ie.
Title: Search Box
Intro: Search Box

and it works just fine, so I'll probably end up having multiple attribute searching and populate the attribute list (dog, cat, etc) in a class, and call that class to be listed in a select box. It'll be something like the select box above, but just add a fetch to populate the options by looping through the canned class.

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 18 2025 22:32:02
Script start
Timing: Jan 18 2025 22:32:02
Module start 'layout'
Timing: Jan 18 2025 22:32:02
Module start 'content'
Timing: Jan 18 2025 22:32:02
Module end 'content'
Timing: Jan 18 2025 22:32:02
Script end

Main resources:

Total runtime0.0223 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.0057 589.0391152.6250
Module start 'layout' 0.00570.0027 741.664139.4453
Module start 'content' 0.00840.0111 781.109489.3203
Module end 'content' 0.01950.0028 870.429730.3047
Script end 0.0222  900.7344 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002611.7819140.0002
Check MTime0.00115.0164140.0001
Mysql Total
Database connection0.00093.898410.0009
Mysqli_queries0.00229.772830.0007
Looping result0.00000.062010.0000
Template Total0.00229.810.0022
Template load0.00094.097410.0009
Template processing0.00135.672210.0013
Override
Cache load0.00062.836110.0006
General
dbfile0.00031.311680.0000
String conversion0.00000.036440.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