[resolve] Limit class in search result

Author Message

Stéphane Bullier

Tuesday 27 May 2008 2:55:10 am

Hello,

For a site that use ez 4.0, I try to limit class in search result.

In my pagelayout template, I have this code :

<form action={"/content/advancedsearch"|ezurl} method="get">
<p>
        <input type="image" src={'loupe.png'|ezimage()} name="SearchButton" value="" class="button" />
	<input type="text" id="find" name="SearchText" value="Rechercher" onfocus="if(this.value==this.defaultValue){literal}{this.value='';}{/literal}" onblur="if(this.value==''){literal}{this.value=this.defaultValue;}{/literal}" />
	<input type="hidden" name="SearchContentClassID" value="array(1,2)"  />
</p>
</form>

I don't understand why the SearchContentClassID is not taken into account when is an array.

Any help will be appreciate.

Best regards.

Stéphane

André R.

Tuesday 27 May 2008 3:48:42 am

That is not a form array but a string 'array(1,2)' aka invalid.
Try:

<input type="hidden" name="SearchContentClassID[]" value="1" />
<input type="hidden" name="SearchContentClassID[]" value="2" />

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Stéphane Bullier

Tuesday 27 May 2008 8:49:14 am

Hi Andre,

Thank you so much for your help.

Best regards.

Stéphane

Yannick Komotir

Thursday 12 June 2008 2:16:14 am

Hi,
i don't find doc about this in the technical manual, could you tell me about the variables used in research or give me links about this?

Am in a project where I must not only limit the search to specific classes but also a period of time. i dont find a doc about this.

Best regards.
Yannick Komotir

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

Stéphane Bullier

Thursday 12 June 2008 2:04:37 pm

Hi,

You can find some info here : http://ez.no/doc/ez_publish/technical_manual/4_0/reference/modules/content/fetch_functions/search

Also, you can look the template : design/standard/templates/content/advancedsearch.tpl

Stéphane

Yannick Komotir

Friday 13 June 2008 1:28:13 am

Hi Stéphane,

thank you for your answer

Best regards
Yannick Komotir

<|- Software Engineer @ eZ Publish developpers -|>
@ http://twitter.com/yannixk

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

Main resources:

Total runtime1.1450 sec
Peak memory usage4,096.0000 KB
Database Queries68

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 589.0313152.6250
Module start 'layout' 0.00530.0038 741.656339.4609
Module start 'content' 0.00901.1344 781.1172624.7266
Module end 'content' 1.14340.0016 1,405.843816.1563
Script end 1.1450  1,422.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2757160.0002
Check MTime0.00130.1151160.0001
Mysql Total
Database connection0.00090.078910.0009
Mysqli_queries1.077194.0672680.0158
Looping result0.00070.0582660.0000
Template Total1.111597.120.5558
Template load0.00230.197820.0011
Template processing1.109296.872620.5546
Template load and register function0.00010.010110.0001
states
state_id_array0.00160.142310.0016
state_identifier_array0.00210.182120.0010
Override
Cache load0.00180.1601390.0000
Sytem overhead
Fetch class attribute can translate value0.00070.059530.0002
Fetch class attribute name0.00130.111690.0001
XML
Image XML parsing0.00170.151930.0006
class_abstraction
Instantiating content class attribute0.00000.0021120.0000
General
dbfile0.00110.0988290.0000
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs