MaciejO Posted May 24, 2013 Report Share Posted May 24, 2013 Hi there, I am trying to run if(MainController::$activeModule = 'Frontpage') inside layout.tpl, it seems like its working but its really not. I am trying to present diffrent div's for a homepage and diffrent for all other modules. Code in layout.tpl: <?php if(MainController::$activeModule = 'Frontpage') { echo 'This is a frontpage'; } else { echo 'This is not a frontpage'; } ?> After going to my site, I can see This is a frontpage, this is correct, I add index.php, its still correct. BUT when I do index.php/login I should get response This is not a frontpage, and what I get is This is a frontpage. Could anyone help me on this one? Mac... Quote Link to comment Share on other sites More sharing options...
Tom Posted May 24, 2013 Report Share Posted May 24, 2013 Use '==' for comparison, using '=' will always return true as it's setting the value. 1 Quote Link to comment Share on other sites More sharing options...
MaciejO Posted May 24, 2013 Author Report Share Posted May 24, 2013 It now gives me This is not a frontpage for all pages. Quote Link to comment Share on other sites More sharing options...
Tom Posted May 24, 2013 Report Share Posted May 24, 2013 Yeah it has to be in caps: "FRONTPAGE" Quote Link to comment Share on other sites More sharing options...
freshJet Posted May 24, 2013 Report Share Posted May 24, 2013 EDIT: Tom got there first, see if that works. Quote Link to comment Share on other sites More sharing options...
MaciejO Posted May 24, 2013 Author Report Share Posted May 24, 2013 Cheers guys! Appreciated! Mac. 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.