Skip to content

A Concrete5 package that adds a bootstrap compatible template to autonav

Notifications You must be signed in to change notification settings

jbh/c5-bootstrap-autonav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A Concrete5 package that adds a bootstrap compatible template to autonav

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages