Erjati Posted August 17, 2008 Share Posted August 17, 2008 I'd be grateful if you can sort this out. I don't know php but I'm modifying a Joomla template that uses it. I need to correct the following code so that it writes the div tag based on conditions. Lines 1, 2 and 3 are my attempt to patch together code from the rest. Lines 4 and after are correct and from the original template. I need my first 3 lines to write the div tag on line 2 if the module count in 'left' and 'right' are both zero. As is the site throws the error: Parse error: parse error, unexpected T_LOGICAL_AND. If I take out the and it says: Parse error: parse error, unexpected ')' <?php if($this->countModules('left')<1) and ($this->countModules('right')<1) and JRequest::getCmd('layout') != 'form') :?> <div id="maincolumn_fullwidth"> <?php else: ?> <?php if($this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?> <div id="maincolumn_small"> <?php else: ?> <div id="maincolumn_medium"> <?php endif; ?> I would also like this to write div id="maincolumn_medium" if the left count is zero AND the right count is greater than zero. If the count is greater than zero for both left and right the div tag needs to read div id="maincolumn_small", which it does now, but wont let me have modules on the right alone with left at zero modules. With the original lines 4-8 if there is a module on the right it will make the main column small. Note: the purpose of this code is to write the correct div id so the css will set the width of the main column correctly, based on whether there are modules on the left, right, both or neither. Thank you for your help. Quote Link to comment https://forums.phpfreaks.com/topic/120092-help-with-multi-conditional/ 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.