Posted on: 02/18/07 10:31pm
By: caio
hello everyone,
is there a way to make a piece of code appear only on the index (main, front) page (index.php)? i tried putting the code on the header template file but it shows on all pages. maybe there is some other file i could put it in... any suggestions?
thanks in advance!
Re: show only on main page
Posted on: 02/19/07 01:57am
By: Dirk
You can use PHP in header.thtml, so you could call COM_onFrontpage (COM_isFrontpage in older Geeklog versions) to check where you are.
bye, Dirk
Re: show only on main page
Posted on: 02/19/07 08:46am
By: Anonymous (caio)
great! so there is a way.
i assume with an if? not sure how it goes.
i'm still kind of lost.
could you give me an example?
thanks a lot Dirk! geeklog rocks!
Re: show only on main page
Posted on: 02/20/07 05:55pm
By: caio
Ok Dirk i think i managed to fabricate a bit of code for this BUT when I publish it, it tells me that com_onfrontpage (and com_isfrontpage) is an undefined function. and actually i couldn't find it in lib-common.php -- any help will be gREATLy appreciated! i am pulling my hairs out :doh:
this is what i tried :
Text Formatted Code
<?php
if( !COM_isFrontpage() )
{
bla bla bla...
}
?>
but as I said, the function is nowhere in sight... :helpme:
Re: show only on main page
Posted on: 03/01/07 12:39pm
By: caio
ok i haven't gotten a reply for this yet but i managed to work it out by using a block with the option to show it only in the main page.... in case anyone goes through the same... it's an alternative... and it worked for me... :twocents: