Post by slawrence10 » Tue Aug 18, 2009 6:22 am

I'm trying to create an if statement that can run within view/common/header.tpl
that works out whether or not the user is on the homepage.

Basically I want to do

if(on homepage){
//normal contents of header.tpl
}else{
// different content
}

So that the top login bar doesn't show on the homepage but is still apparent on all other pages.

Thanks for your time,
Scott
Last edited by slawrence10 on Tue Aug 18, 2009 6:28 am, edited 1 time in total.

Scott Lawrence - Creative agency - Bespoke web and graphic design


User avatar
Active Member

Posts

Joined
Sun Jul 19, 2009 8:10 pm
Location - London, UK

Post by slawrence10 » Tue Aug 18, 2009 6:26 am

can i just use...

if(isset($_GET['route']))

can anyone see any potential problems with that?

Regards,
Scott

User avatar
Active Member

Posts

Joined
Sun Jul 19, 2009 8:10 pm
Location - London, UK

Post by slawrence10 » Tue Aug 18, 2009 8:47 am

<?php if(
(isset($_GET['route']))&& ($_GET['route']!='common/home')){ ?>

Ok I worked it out sometime if your on another page it redirects back to home with route common/home so used the above.

So if anyone wants to exclude something from just the home page you can use that if statement

Regards,
Scott

Scott Lawrence - Creative agency - Bespoke web and graphic design


User avatar
Active Member

Posts

Joined
Sun Jul 19, 2009 8:10 pm
Location - London, UK

Post by readyman » Tue Aug 18, 2009 10:12 am


http://www.alreadymade.com
Follow me on twitter.com/alreadymade


User avatar
Global Moderator

Posts

Joined
Wed May 20, 2009 5:16 am
Location - Sydney

Post by ankushnagpal » Wed Aug 01, 2012 12:32 pm

slawrence10 wrote:<?php if(
(isset($_GET['route']))&& ($_GET['route']!='common/home')){ ?>

Ok I worked it out sometime if your on another page it redirects back to home with route common/home so used the above.

So if anyone wants to exclude something from just the home page you can use that if statement

Regards,
Scott


thanks scott, its help us
ankush and happy

Newbie

Posts

Joined
Mon Apr 02, 2012 2:19 pm
Location - chandigarh
Who is online

Users browsing this forum: No registered users and 55 guests