Need a trick to override template in 1 page

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
Elephantman
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Nov 03, 2005 4:32 pm

Need a trick to override template in 1 page

Post by Elephantman » Wed Mar 12, 2008 3:48 pm

Hi,

I'm using a 3 column template.
In a component I'm coding, I need to make an exception to this 3 column logic on a specific page. In this page I need to put a first bloc over the central and right column, and then under this bloc go back to normal with 3 columns.

I was wondering if there is a way to take control of user1 position inside my component for this use, or if there is another trick I could use.

Thanks in advance for any good advice :)

User avatar
carsten888
Joomla! Apprentice
Joomla! Apprentice
Posts: 27
Joined: Sat Feb 11, 2006 8:32 am
Location: Tilburg, Holland
Contact:

Re: Need a trick to override template in 1 page

Post by carsten888 » Sat Mar 15, 2008 1:10 pm

your problem has more to do with that you want (if I understand you well) have on one page a componetn outputting in a position (which can be hacked in your template, no prob) but ALSO have other content in the 3 columns layout underneath. having 2 content-outputs on one page is something Joomla can not do.
I can only think of a big fat hack in your template to achieve this.

looking at line 75 -76 in the default rhuk-template:

Code: Select all

<div class="clr"></div>			
			<div id="whitebox">
you can do something like:

Code: Select all

<div class="clr"></div>	
			<div><?php include(dirname(__FILE__).'/../../components/com_contact/contact.php');?></div>	
			<div class="clr"></div>		
			<div id="whitebox">
but this will only work if the component can handle that kind of include. (In the above example, com_contact can not handle it)

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

Re: Need a trick to override template in 1 page

Post by jdvb » Tue Mar 18, 2008 9:45 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');
}
?>
could do with "jos_change_template=" in a url... but opensef wich I use does not automaticly add that to every url correctly, so instead I use this to change my template, wich always works, also when a page is loaded first wich does not include any jos_change_template in the url.

perhaps this could help you aswell...

when the url in question is loaded... then display your other template...
could make a different template for every page if you want to...

my index basicly does nothing other then including the right language template file.
every other thing is set in the included files...
greetz,
Jonathan


Post Reply