Concrete5 Enabling Bootstrap Grid in a Global Area

1.1k Views Asked by At

I'm creating a simple website. For the footer I want to enable bootstrap3 grid.

In the full.php it looks like this:

<?php
$a = new Area('Footer');
$a->enableGridContainer();
$a->display($c);
?>

This is working fine. However, since it's a footer I want to change the area to a Global Area

<?php
$a = new GlobalArea('Footer');
$a->enableGridContainer();
$a->display($c);
?>

In edit mode, i can't see the 'Sitewide Footer' button, but I can still click on it. However the real problem here is when I click on it, only 'Edit Area Design' pops up, there is no 'Add layout'.

Is this a bug or a problem with my code?

Thanks in advance

2

There are 2 best solutions below

3
On BEST ANSWER

Why not enable bootstrap grids in the template/page type and then add the global areas that you want? Or alternatively create any global area and then add HTML which sets up the bootstrap for you? As so:

     <div class="row">
        <div class="col-md-8 col-xs-12">
            <div id="divExampleContent">
                <h1 class="decorated"><span>Example1</span></h1>
                <?php
                   $a = new Area('Example1');
                   $a->display($c);
                ?>
            </div>
        </div>

        <div class="col-md-4">
            <div id="divExampleCall">
                <h3 class="decorated"><span>ExampleCall</span></h3>
                <?php
                   $a = new Area('ExampleCall');
                   $a->display($c);
                ?>
            </div>
        </div>
      </div>        
0
On

Using grid layouts in a GlobalArea() is definitely on the wishlist of many people, but judging by this issue on Github, it looks like it's still in development (as of Nov 2015).

Github Issue:
Make layouts work in global areas; make layouts display sensibly in stacks page when you go to them without grid

Until it's released, Dannn's solution might be the only real option.