Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 10:44 am EST

Geeklog Forums

show only on main page


Status: offline

caio

Forum User
Newbie
Registered: 10/05/02
Posts: 10
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!
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
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
 Quote

caio

Anonymous
cheerful
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! Wink
 Quote

Status: offline

caio

Forum User
Newbie
Registered: 10/05/02
Posts: 10
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:
 Quote

Status: offline

caio

Forum User
Newbie
Registered: 10/05/02
Posts: 10
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:
 Quote

All times are EST. The time is now 10:44 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content