I am working on OpenCart 1.5.6.4. I want to add dynamic CSS class in content box. I want the following options for the content box layout:
- left panel + main content + right panel
- only left panel + main content
- only main content + right panel
- only main content (without left & right panels)
With the following code each case except the main content + right panel is working:
<?php if ($column_left && $column_right) { ?>
<?php $class = 'col-sm-6'; ?>
<?php } elseif ($column_left || $column_right) { ?>
<?php $class = 'col-sm-9'; ?>
<?php } else { ?>
<?php $class = 'col-sm-12'; ?>
<?php } ?>
<div id="content" class="<?php echo $class; ?>">.....</div>
I get this results:
What is wrong here with the last option? How can I fix it?
Would appreciate the help.
col-sm-9
+col-sm-3
please check (print out) the$column_left
- obviously it is not empty (it may contain some empty<div>
for example) or even check thecatalog/view/theme/<YOUR_THEME>/template/common/column_left.tpl
template... – shadyyx$column_left
variable (or it's template) when only column right + main content should be there... – shadyyx$column_left
file. – HDP