|
Styling frontpage in different way |
|
|
|
|
Perhapse you will never need this trick but it is very helpfull if you
wish to style your frontpage with modules instead standard Joomla
frontpage option.
Using variable $option you can determine whether are you on frontpage or not.
Code:
if($option == '' || $option == 'com_frontpage')
{
mosLoadModules('user1');
}
else
{
mosMainBody();
}
Now,
if you are on frontpage instead of standard Joomla frontpage you will
see user1 module position, but if you go to any other section then
standard Joomla frontpage will be displayed.
This is relly helpfull when you develop templates.
Check www.livno-online.com where we styled frontpage using this little trick. Overall frontpage on this site is styled with modules.
Here is the code I have used at www.livno-online.com:
<? if($option=='' || $option=='com_frontpage') { ?>
<div class="user1"><? mosLoadModules('user1',-2); ?></div>
<div class="user2"><? mosLoadModules('user2',-2); ?></div>
<div class="clr"></div>
<? } else { ?>
<div class="content"><? mosMainBody(); ?></div>
<? } ?>
Notice: This trick only works on Joomla 1.0.x versions.
Thanks to www.zkaradza.com !
|