Page 1 of 1
Need a trick to override template in 1 page
Posted: Wed Mar 12, 2008 3:48 pm
by Elephantman
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
Re: Need a trick to override template in 1 page
Posted: Sat Mar 15, 2008 1:10 pm
by carsten888
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)
Re: Need a trick to override template in 1 page
Posted: Tue Mar 18, 2008 9:45 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');
}
?>
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...