Forums / Setup & design / Search results in a custom template

Search results in a custom template

Author Message

paul cozens

Thursday 11 March 2004 9:44:14 am

I am using ez publish v3.3 and have a template which is used to display a list of items (say widgets). I use the simple search for various keywords i.e colour, shape etc which works fine. The problem is I want the results to display using either the custom template as used by the item listing or a copy of it. I have tried to override the searchresult.tpl template but this doesn't work (probably my fault not the software). can anyone point me inthe right direction as the default template only lists the item name and the class whereas I want more details.
I am a relative newbie to ez publish but have managed to work my through all the problems (many, many problems) by referencing the forums and the documentation. Please, please, please help.

Hans Melis

Thursday 11 March 2004 12:28:14 pm

Hi Paul,

The simple search page consists of 3 templates: content/search.tpl, content/searchresult.tpl and node/view/search.tpl.

content/search.tpl contains the text fields, the search button, etc.

content/searchresult.tpl manages the search results and sends parameters to the google navigator

node/view/search.tpl is the viewmode used for the actual objects being displayed (like node/view/line.tpl). It's called like {node_view_gui view=search content_node=....}. So to control what's displayed for each object found, you need to override the node/view/search.tpl for an object's class.

hth
--
Hans

Hans
http://blog.hansmelis.be

paul cozens

Thursday 11 March 2004 4:58:33 pm

Hi Hans,

many thanks for your prompt reply it worked out a treat. I simply copied the original template override, created a new blank override for the (correct) search template and pasted. The only bit I didn't quite understand was having to remove the table tags but I assume this template is called similar to a subroutine from the searchresult.tpl file.

thanks again you have saved hours of trial and error.