D
D
Dmitry Kamyannoy2015-02-08 16:08:42
Drupal
Dmitry Kamyannoy, 2015-02-08 16:08:42

Can you tell me about class layout?

Good afternoon. Interested in the issue of layout. I'll tell you on the example of layout with the boostrap framework.
There are two blocks.

<div class="content col-sm-9"></div>
<div class="sidebar col-sm-3"></div>

And there's a check
<?php if ($page['sidebar']): ?>
<?php endif; ?>

Which determines whether the block will appear or not. But, if it suddenly turns out that there is nothing in the "sidebar" region, it will not actually appear. Then the "content" block will remain as before "col-sm-9" , but I would like the classes to change depending on the presence of sitebars or other blocks. How can this be implemented?
I tried to parse the Bootstrap theme for Drupal but it didn't work.
Thank you very much.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
holfza, 2015-02-08
@holfza

<div class="content <?php echo ($page['sidebar'])?"col-sm-9":"col-sm-12"?>"></div>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question