Page 1 of 1

Search Results, Different Template?!

Posted: Sun Mar 09, 2008 6:31 am
by homeboarder8
Any help here will be appriciated...

Basically I need the search module to display search results on a different template than where the search was initiated. I know this is probably not possible standard (unless I'm over looking something obvious) but I figure there has to be a way.

Thanks again!

Re: Search Results, Different Template?!

Posted: Tue Mar 18, 2008 10:04 am
by jdvb
I have made a multilanguage website alike this:
template index.php:

Code: Select all

<?php 
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );

$string = $_SERVER['REDIRECT_URL'];
if(strpos($string, 'Russian') || $string == '/RU.html'){
include('ru.php');
} elseif(strpos($string, 'English') || $string == '/EN.html') {
include('en.php');
} elseif(strpos($string, 'German') || $string == '/DE.html') {
include('de.php');

etc... many other languages .....

} else {
include('nl.php');
}
?>
all you would need to do, is find that if searchresults are displayed (look in the $_GET or $_POST for the search is set or so) then include your other template file.

I had the wish of altering the template from within a component as well (just not com_search, in my case a selfmade).
And found that in order to do that, I had to make a hack to joomla core files.
Rather I set the right template from within the template itself, in order to prevent any corehacks.

since this post is in a coding forum I suppose you know how to do the rest.