MaciejO Posted May 24, 2013 Report 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
Tom Posted May 24, 2013 Report Posted May 24, 2013 Use '==' for comparison, using '=' will always return true as it's setting the value. 1 Quote
MaciejO Posted May 24, 2013 Author Report Posted May 24, 2013 It now gives me This is not a frontpage for all pages. Quote
freshJet Posted May 24, 2013 Report Posted May 24, 2013 EDIT: Tom got there first, see if that works. Quote
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.