Petey Posted June 29, 2012 Report Share Posted June 29, 2012 Hello guys, I know there is a PHP code for if you are logged in to show certain content. I was looking to see if anyone knows or can create a PHP code that basically does the same thing, but only shows the code if they are on the homepage. The reason for this is I need to put a script in the header and can't put it in the frontpage_main.tpl template. But I only want this code to be shown and ran on the homepage. So in a nutshell: <?php IF ON HOMEPAGE SHOW ?> Show this ----- <?php ?> Thanks guys . Quote Link to comment Share on other sites More sharing options...
Moderators Kyle Posted June 30, 2012 Moderators Report Share Posted June 30, 2012 Give this a go. This should do the job. <?php if(MainController::$activeModule == 'Frontpage') { ?> DO STUFF!!! !!! <?php } ?> 2 Quote Link to comment Share on other sites More sharing options...
Petey Posted June 30, 2012 Author Report Share Posted June 30, 2012 Give this a go. This should do the job. <?php if(MainController::$activeModule == 'Frontpage') { ?> DO STUFF!!! !!! <?php } ?> Thank you so much, it worked a charm. You're magic . Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.