Custom advanced search and google navigator

Author Message

laurent le cadet

Thursday 16 March 2006 8:24:03 am

Hi,

I have customized advancedsearch.tpl with some dropdown based on attribute.
The code below appeared only in one section (switch) :

<input type="hidden" name="SearchContentClassID" value="36" />

<input type="hidden" name="Content_search_attribute_fulltext_classattribute_id[]" value="350" />
<p>Type</p>
<select name="Content_search_attribute_fulltext_value[]" >
<option value="">Indifférent</option>
<option value="Appartement">Appartement</option>
<option value="Maison">Maison</option>
</select>

<input type="hidden" name="Content_search_attribute_fulltext_classattribute_id[]" value="352" />
<p>Nbr. de personnes</p>
<select name="Content_search_attribute_fulltext_value[]" >
<option value="">Indifférent</option>
<option value="1 personne">1 personne</option>
<option value="2 personnes">2 personnes</option>
<option value="3 personnes">3 personnes</option>
</select>

<input type="hidden" name="Content_search_attribute_fulltext_classattribute_id[]" value="440" />
<p>Departement</p>
<select name="Content_search_attribute_fulltext_value[]">
<option value="">Indifférent</option>
<option value="22">Cote d'armor</option>
<option value="29">Finistere</option>
</select>

<input type="hidden" name="Content_search_attribute_byrange_classattribute_id[]" value="346" />
<input type="hidden" name="Content_search_attribute_byrange_from[]" value="1" />
<input type="hidden" name="Content_search_attribute_byrange_to[]" value="10000" />

<input id="searchbutton" class="searchbutton" name="SearchButton" type="submit" value="Trouver" />

{include name=navigator
		uri='design:navigator/google.tpl'
		page_uri='/content/advancedsearch'
		page_uri_suffix=concat('?SearchContentClassID=',36,'&Content_search_attribute_fulltext_classattribute_id%5B%5D=',350,'&Content_search_attribute_fulltext_value%5B%5D=',$Content_search_attribute_fulltext_value,'&Content_search_attribute_fulltext_classattribute_id%5B%5D=',352,'&Content_search_attribute_fulltext_value%5B%5D=',$Content_search_attribute_fulltext_value,'&Content_search_attribute_fulltext_classattribute_id%5B%5D=',440,'&Content_search_attribute_fulltext_value%5B%5D=',$Content_search_attribute_fulltext_value,'&Content_search_attribute_byrange_classattribute_id%5B%5D=',346,'&Content_search_attribute_byrange_from%5B%5D=',1,'&Content_search_attribute_byrange_to%5B%5D=',10000)
         item_count=$search_count
         view_parameters=$view_parameters
         item_limit=$page_limit}

I have tried something with page_uri_suffix based on the URL's result of the button's form (which give me what I want), but the differents variables ($Content_search_attribute_fulltext_value) are not considered.

I don't know excatly what to do...

Any hint.

Thanks.

Laurent

laurent le cadet

Thursday 16 March 2006 9:35:44 am

Well,

I tried this :

page_uri_suffix=concat('?SearchContentClassID=',36,'&Content_search_attribute_fulltext_classattribute_id%5B%5D=',350,'&Content_search_attribute_fulltext_value%5B%5D=',$search_array_by_class_attribute_id['350']['value'] ,'&Content_search_attribute_fulltext_classattribute_id%5B%5D=',352,'&Content_search_attribute_fulltext_value%5B%5D=',$search_array_by_class_attribute_id['352']['value'],'&Content_search_attribute_fulltext_classattribute_id%5B%5D=',440,'&Content_search_attribute_fulltext_value%5B%5D=',$search_array_by_class_attribute_id['440']['value'],'&Content_search_attribute_byrange_classattribute_id%5B%5D=',346,'&Content_search_attribute_byrange_from%5B%5D=',1,'&Content_search_attribute_byrange_to%5B%5D=',10000)

It seems to work.

Hope this help.

Laurent

Vidhi ashra

Monday 21 December 2009 8:32:10 pm

Hello Laurent,

Please let me know if you know a way to put dinamically values of &Content_search_attribute_byrange_to and &Content_search_attribute_byrange_from. In your example you put manually 1 and 10000.

I dont know how to pass values of the range on url, I've something like this:

{def $search_doc_date = concat( 'Content_search_attribute_byrange_classattribute_id[]'|urlencode,'=',343,
'&','Content_search_attribute_byrange_from[]'|urlencode,'=',$search_array_by_class_attribute_id['343']['value'], '&','Content_search_attribute_byrange_to[]'|urlencode,'=',$search_array_by_class_attribute_id['343']['value']
}

<input type="hidden" name="Content_search_attribute_byrange_classattribute_id[]" value="343" />
<input id="search_timestamp_from" type="hidden" name="Content_search_attribute_byrange_from[]" value="" />
<input id="search_timestamp_to" type="hidden" name="Content_search_attribute_byrange_to[]" value="" />

{include name=Navigator
uri='design:navigator/google.tpl'
page_uri='/content/advancedsearch/despachos'
page_uri_suffix=concat('?', $search_doc_date,'&SearchContentClassID=',$search_contentclass_id,'&SearchContentClassAttributeID=',$search_contentclass_attribute_id,'&SearchSectionID=',$search_section_id,$search_timestamp|gt(0)|choose('',concat('&SearchTimestamp=',$search_timestamp)),$search_sub_tree|gt(0)|choose( '', concat( '&', 'SubTreeArray[]'|urlencode, '=', $search_sub_tree|implode( concat( '&', 'SubTreeArray[]'|urlencode, '=' ) ) ) ),'&SearchDate=',$search_date)
item_count=$search_count
view_parameters=$view_parameters
item_limit=$page_limit}

Thanks for your atention

Waiting for reply

Vids

Vidhi

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 30 2025 19:52:19
Script start
Timing: Jan 30 2025 19:52:19
Module start 'layout'
Timing: Jan 30 2025 19:52:19
Module start 'content'
Timing: Jan 30 2025 19:52:19
Module end 'content'
Timing: Jan 30 2025 19:52:19
Script end

Main resources:

Total runtime0.0352 sec
Peak memory usage4,096.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 588.2656151.2266
Module start 'layout' 0.00700.0047 739.4922220.7188
Module start 'content' 0.01180.0219 960.21091,006.0547
Module end 'content' 0.03370.0015 1,966.265637.9922
Script end 0.0351  2,004.2578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00257.1267140.0002
Check MTime0.00113.1503140.0001
Mysql Total
Database connection0.00092.458910.0009
Mysqli_queries0.005214.749630.0017
Looping result0.00000.042710.0000
Template Total0.00102.810.0010
Template load0.00082.226510.0008
Template processing0.00020.554410.0002
Override
Cache load0.00051.512110.0005
General
dbfile0.003911.072080.0005
String conversion0.00000.019740.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