Search Results, Different Template?!

Have a programming question regarding your component, plug-in, extension or core hacks? Have an interesting tidbit, FAQ or programming tip you’d like to share? This is the place for you.

Moderators: tjay, seadap, Rogue4ngel, matthewhayashida

Post Reply
homeboarder8
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat Mar 08, 2008 10:53 pm

Search Results, Different Template?!

Post by homeboarder8 » Sun Mar 09, 2008 6:31 am

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!

jdvb
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Fri Aug 26, 2005 7:16 am
Contact:

Re: Search Results, Different Template?!

Post by jdvb » Tue Mar 18, 2008 10:04 am

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.
greetz,
Jonathan


Post Reply