ivopetkov/navigation-menu-bearframework-addon

Navigation menu addon for Bear Framework

v1.5.0 2023-11-03 13:07 UTC

README

Addon for Bear Framework

This addon enables you to easily create multiple types of navigations for your website.

Build Status Latest Stable Version codecov.io License Codacy Badge

Download and install

Install via Composer

composer require ivopetkov/navigation-menu-bearframework-addon

Download an archive

Download the latest release from the GitHub page and include the autoload file.

include '/path/to/the/addon/autoload.php';

Enable the addon

Enable the addon for your Bear Framework application.

$app->addons->add('ivopetkov/navigation-menu-bearframework-addon');

Usage

<component src="navigation-menu">
    <ul>
        <li><a>Button 1</a></li>
        <li><a>Button 2</a>
            <ul>
                <li><a>Button 2.1</a></li>
                <li><a>Button 2.2</a></li>
                <li><a>Button 2.3</a></li>
            </ul>
        </li>
        <li><a>Button 3</a></li>
    </ul>
</component>

Attributes

type

      The type of the navigation. Available values: horizontal-down, vertical-left, vertical-right, list-vertical, list-horizontal

moreItemHtml

      The HTML code for the more item. Must contain li and ul tags. Example: <li><a>...</a><ul></ul></li>

class

      HTML class attribute value

style

      HTML style attribute value

Examples

The navigation will be horizontal and submenus will show bellow. If there are too many first level items, a more item will be shown.

<component src="navigation-menu" type="horizontal-down">
    <ul>
        <li><a>Button 1</a></li>
        <li><a>Button 2</a>
            <ul>
                <li><a>Button 2.1</a></li>
                <li><a>Button 2.2</a></li>
                <li><a>Button 2.3</a></li>
            </ul>
        </li>
        <li><a>Button 3</a></li>
    </ul>
</component>

The navigation will be vertical and submenus will open to the right.

<component src="navigation-menu" type="vertical-right">
    <ul>
        <li><a>Button 1</a></li>
        <li><a>Button 2</a>
            <ul>
                <li><a>Button 2.1</a></li>
                <li><a>Button 2.2</a></li>
                <li><a>Button 2.3</a></li>
            </ul>
        </li>
        <li><a>Button 3</a></li>
    </ul>
</component>

License

Navigation menu addon for Bear Framework is open-sourced software. It's free to use under the MIT license. See the license file for more information.

Author

This addon is created by Ivo Petkov. Feel free to contact me at @IvoPetkovCom or ivopetkov.com.