Making search results use a specific section template

Author Message

Bruce Morrison

Wednesday 16 April 2003 10:46:00 pm

Currently search results are returned using current section template. I (actually a client ;) want the search results to be returned using a search results specific template.

I'm proposing to add

# where 12 is the section you want the results displayed in
# Comment out this line to use the current section to display results
ResultsSection=12

To the SearchSettings section of site.ini.

So site.ini looks like

[SearchSettings]
SearchEngine=eZSearchEngine
ResultsSection=12

The following lines are then added to the search function of kernel/content/search.php after line 51

$ini =& eZINI::instance();

if ( $ini->hasVariable( "SearchSettings", "ResultsSection" ) == true )
{
$ResultsSection = $ini->variable( "SearchSettings", "ResultsSection" );
include_once( 'kernel/classes/ezsection.php' );
eZSection::setGlobalID( $ResultsSection );
}

Is this the correct way to do this, The right files to add the code? If so I can it be added to the next distribution?

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

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 05:14:41
Script start
Timing: Jan 18 2025 05:14:41
Module start 'layout'
Timing: Jan 18 2025 05:14:41
Module start 'content'
Timing: Jan 18 2025 05:14:42
Module end 'content'
Timing: Jan 18 2025 05:14:42
Script end

Main resources:

Total runtime0.7361 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0051 588.1406152.6406
Module start 'layout' 0.00510.0023 740.781339.4766
Module start 'content' 0.00740.7272 780.2578471.8906
Module end 'content' 0.73470.0014 1,252.14848.1250
Script end 0.7361  1,260.2734 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4248160.0002
Check MTime0.00130.1699160.0001
Mysql Total
Database connection0.00060.087810.0006
Mysqli_queries0.694794.3766460.0151
Looping result0.00040.0547440.0000
Template Total0.701195.320.3506
Template load0.00220.299620.0011
Template processing0.698994.948920.3495
Template load and register function0.00010.011410.0001
states
state_id_array0.00130.170110.0013
state_identifier_array0.00130.174320.0006
Override
Cache load0.00180.2403250.0001
Sytem overhead
Fetch class attribute can translate value0.00130.171910.0013
Fetch class attribute name0.00050.069020.0003
XML
Image XML parsing0.00050.065510.0005
class_abstraction
Instantiating content class attribute0.00000.000420.0000
General
dbfile0.00080.1123160.0001
String conversion0.00000.001240.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
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.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: 13
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs