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.