Getting collapsible columns to work


Author Message
Andrew

Posted: 5/31/2009
Quote message 

Hi,
I'm having trouble to get collapsible columns to work in Joomla.

I found this line in the index.php:

<div class="<?php echo $this->countModules('left') ? 'content' : 'content-wide'; ?>">


To me, as a php novice, it looks as if this is where the main content should get one of two classes assigned to it. However, the content-wide class never kicks in when my left column is empty.

When changing 'content' to 'content-wide in the index.php file', I do verify that the main content expands as it should, i.e. CSS is working and the class is assigned.

So, my questions are:

* What does that line of code check - if there are any left column modules at all or that the left column is empty for a specific page?

* Any idea why the second class - 'content-wide' - never kicks in?

Thanks,
 
Andrew

Posted: 5/31/2009
Quote message 

After some additional testing, I found out that the code

<div class="<?php echo $this->countModules('left') ? 'content' : 'content-wide'; ?>">


actually just counts if there are any enabled modules assigned to the left position.

This means that I couldn't use it for pages where I just didn't assign a module for the left positon.

Since I just wanted the different layout for one specific page, my final solution was to watch out for that page in my index.php:

<?php if ($page_item_id == 59) { ?>

<div class="content-wide"> <?php } else { ?>
<div class="content">
<?php } ?>


and at the top in index.php:

<?php

$page_item_id = JRequest::getInt( 'Itemid', '' );
?>


You could look for other parameters, but for one single page this worked out nice for me 8-)