Tuesday 13 March 2007 3:08:23 pm
Hi people, I am working on a website with 3 sections, each having its own pagelayout. I use override.ini.append.php in my siteaccess to set which pagelayout to take depending on the section. I also want to show search results (content/search) using the same pagelayout, depending from which section I did the search, but I didn't find an <i>easy</i> way for doing it. I tried using an url_alias defined from admin interface, (firstsite_search pointing to content/search) but when I use this url to access the search page, I look in the code and url_alias is not set in array $matchKeys, function handleResource in file eztemplatedesignresource.php. Also, the section (still in $matchKeys) is 7 (firstsite section) when checking overrides for the search.tpl template, but it is back to 1 when the checking overrides for pagelayout.tpl. I managed to make it work by modifying the kernel, but I'm sure there is a cleaner way. I changed in search.php:
if ( $http->hasVariable( "SectionID" ) )
{
$searchSectionID = $http->variable( "SectionID" );
}
to
if ( $http->hasVariable( "SectionID" ) )
{
$searchSectionID = $http->variable( "SectionID" );
$GLOBALS['eZDesignKeys']['section'] = $searchSectionID ;
}
And of course I added an hidden post variable in the search form in the 3 custom pagelayouts. Does someone have a nice way to do what I did by modifying the kernel ?
Thanks Patrice
|