Skip to content

Latest commit

 

History

History
48 lines (39 loc) · 1.95 KB

README.md

File metadata and controls

48 lines (39 loc) · 1.95 KB

Concrete5 Bootstrap Autonav

This Concrete5 package adds a bootstrap template to the autonav block making it more compatible with bootstrap.

Installation

  • Just drop put the c5-bootstrap-autonav folder into your packages directory.
  • Go to the Concrete5 Dashboard, then to Extend Concrete5 (normally /dashboard/extend/install/).
  • Install the C5 Bootstrap Autonav package.

Use

This template still only outputs the simple unordered list of navigation items, but with bootstrap classes. Therefore you will still need to wrap it in bootstraps normal navigation wrappers. For example:

<nav class="navbar navbar-default" role="navigation">
    <div class="container">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#MainNavbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="/"></a>
        </div>

        <div class="collapse navbar-collapse" id="MainNavbar">
            <!-- This is an example of doing it programmatically.
                 One could still add a content editable area here. -->
            <?php
            $nav = BlockType::getByHandle('autonav');
            $nav->controller->orderBy = 'display_asc';
            $nav->controller->displayPages = 'top';
            $nav->controller->displaySubPages = 'all';
            $nav->controller->displaySubPageLevels = 'custom';
            $nav->controller->displaySubPageLevelsNum = 1;
            $nav->render('templates/bootstrap');
            ?>
        </div>
    </div><!-- /.container-fluid -->
</nav>

TODO

  • Make navbar classes more editable, right now it is just navbar-right unless edited in code.