Custom Search Probelm

Author Message

Alessandro Malizia

Thursday 04 October 2007 1:02:16 am

Hi at all, i'm using Ez version 3.9.2 for create a website.
But i've a big problem, i've add a custom search box for a subtree search, using the instructions of this link:

http://ez.no/ezpublish/documentation/customization/components/search/custom_search_box

Now the problem is that when i try the first search, it visualizes to me the resultes exact, but when i try again a new search, it visualizes to me the previous resultes, with the "search text" of the previous search.

It seems to be a cache problem because if i clear cache in the administration interface, and i do again the search there isn't problem. That come before again in i try a second search without clear cache.

Anyone have the solution of this problem?

I have tried with this string:

{set-block scope=root variable=cache_ttl}0{/set-block}

but it doesn't work

HELP ME PLEASE!!!

Daje ROMA Daje!!!

Kristof Coomans

Thursday 04 October 2007 7:30:34 am

HI Allesandro

Where exactly did you add the template code you mentioned? And did you clear template caches afterwards?

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

Alessandro Malizia

Friday 05 October 2007 1:03:26 am

I have added the code at the beginning of the template where i have written the code for the custom search box, is a template for a specific node. But didn't clear the cache... is that the problem!!

Daje ROMA Daje!!!

Alessandro Malizia

Tuesday 09 October 2007 1:30:10 am

anyone can help me?

Daje ROMA Daje!!!

André R.

Tuesday 09 October 2007 2:08:37 am

Well your question dosn't make sense, first of all you use:

{set-block scope=root variable=cache_ttl}0{/set-block}

Witch hints that this is a node template(content/view), because it will only work in a node template setting the timeout of the viewcache.

content/search and content/advancesearch does not use viewcache, and the templates they use doesn't have any cache blocks. So I guess you have added a cache block on the search result that is causing this, alternatively you have a cache block around {$module_result.content} in your pagelayout that is causing this. In both cases, remove them to fix the problem.

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

Alessandro Malizia

Wednesday 10 October 2007 3:27:56 am

Hi Andrè, i use that code in a similar folder template, that
I have set up for a specific node.

In this template i've added the custom search box, that it gives problems to me.

Daje ROMA Daje!!!

Alessandro Malizia

Tuesday 23 October 2007 3:51:09 am

Sorry but i still have this problem, and i didn't find solution for it.

Daje ROMA Daje!!!

André R.

Tuesday 23 October 2007 4:51:35 am

Could you please specify the following:

* What specific cache do you need to clear in admin to refresh the search result?
( try by clearing one at a time and see if it refreshes the search result )
* Do you have a cache block around the search result?
* If so, why ?
* In what template have you put the template code? give full path please.
* if any overrides are involved please post them to.
* If the template code is not the same as in the tutorial you are pointing to, please post your template code.

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

Alessandro Malizia

Wednesday 24 October 2007 1:48:43 am

<b>* What specific cache do you need to clear in admin to refresh the search result?</b>

I need to clear the Template Cache to refresh the search result

<b>* Do you have a cache block around the search result?
* If so, why ?</b>

i've add this code as someone has suggested in other thread

{set-block scope=global variable=cache_ttl}0{/set-block}

<b>* In what template have you put the template code? give full path please.</b>

i put it in much template fto find a solution:

-design/ezwebin/override/templates/new_intranet_custom_ita.tpl (a modified Folder Template)
-design/ezwebin/override/templates/search_content_ita_new.tpl (a modified "/content/search.tpl" Template)

In the second template i modified only the visualization, while in the first i've add this code:

 

 <form action={"/content/search/"|ezurl} method="get">
 <input class="searchinput" type="text" size="10" name="SearchText" value="" />
 <input type="hidden" name="SubTreeArray" value="186" />
 <input type="submit" value="submit" />
 </form>
 

Daje ROMA Daje!!!

André R.

Wednesday 24 October 2007 2:37:44 am

>I need to clear the Template Cache to refresh the search result

This means you DO have a cache block around the search result.

>I've add this code as someone has suggested in other thread
>{set-block scope=global variable=cache_ttl}0{/set-block}

This has NO effect on "cache blocks", this is to disable "content view cache".
So once again: You need to remove the cache block that is caching the search result.

Here is more abut cache blocks:
http://ez.no/doc/ez_publish/technical_manual/3_10/reference/template_functions/miscellaneous/cache_block

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

Alessandro Malizia

Thursday 25 October 2007 1:36:25 am

I tried this solution, but it is still not working, it seems to be the same.

In the URL the variable SearchText is right, but when it is processed by the template it continue to use the first search text (that i have inserted after the clear cache).

Daje ROMA Daje!!!

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