Forums / General / [resolve] Limit class in search result

[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