Post by Vladar » Wed Sep 26, 2012 3:46 pm

Is there some way that I could determinate if column exists on a particular page?

For example i have this structure:

Code: Select all

<div class="container_24">
    <div id="column-left" class="grid_6"></div>
    <div id="content" class="grid_12"></div>
    <div id="column-right" class="grid_6"></div>
</div>
What i want to do is make content column wider or thiner by adding css class on certain condition.
The condition is if left or right column doesn't exist "do that" etc.

This is how I tried to do this but for some reason it wont work properly:

Code: Select all

<div class="container_24">
<?php echo $column_left; ?>
    <div id="content" class="<?php 
        if($column_left != null && $column_right != null) { echo 'grid_12'; }
        if($column_left == null && $column_right != null) { echo 'grid_18'; }
        if($column_left != null && $column_right == null) { echo 'grid_18'; }
        if($column_left == null && $column_right == null) { echo 'grid_24'; }
        ?>">
    </div>
<?php echo $column_right; ?>
</div>
The second method I tried was using isset() function and the same result.

Newbie

Posts

Joined
Wed Sep 12, 2012 1:23 am

Post by Vladar » Wed Sep 26, 2012 4:20 pm

I solved it, needed to clean up cache and now it works :D

Newbie

Posts

Joined
Wed Sep 12, 2012 1:23 am
Who is online

Users browsing this forum: No registered users and 34 guests