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.

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

Main resources:

Total runtime0.0181 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0057 589.2734152.6406
Module start 'layout' 0.00570.0031 741.914139.4609
Module start 'content' 0.00880.0068 781.375089.3203
Module end 'content' 0.01560.0025 870.695334.3047
Script end 0.0181  905.0000 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002513.9286140.0002
Check MTime0.00116.2946140.0001
Mysql Total
Database connection0.00074.035210.0007
Mysqli_queries0.003016.445630.0010
Looping result0.00000.110410.0000
Template Total0.002011.010.0020
Template load0.00116.152710.0011
Template processing0.00094.768610.0009
Override
Cache load0.00063.551510.0006
General
dbfile0.002614.446480.0003
String conversion0.00000.055240.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.0002 secs