nepttune / extra-menu
Bonus menu component
This package's canonical repository appears to be gone and the package has been frozen as a result. Email us for help if needed.
Installs: 1 601
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Language:HTML
pkg:composer/nepttune/extra-menu
Requires
- nepttune/macro: ^2.0
- nette/application: ^3.0
- nette/di: ^3.0
README
➕ Bonus menu component
Introduction
This package contains component designed for generating static menu in admininstration layout.
Dependencies
How to use
- Register
\Nepttune\Component\IConfigMenuFactoryas service in cofiguration file, inject it into presenter, writecreateComponentmethod and use macro{control}in template file.- Just as any other component.
- You need to pass array configuration to factory service.
- Modify parameters to accomplish your needs.
Parameter array has to follow format of following example. There is some clarifying description.
MenuandMenu2are non clickable items. Can be used as headers or for multiple menu sections.orderandsettingsare representation of menu items with following options.dest- Link destination. Can be array to create expandable sub-menu.noPermissions- By default, each entry is checked against authorizator if user can view it. This option disables this check. (OPTIONAL)icon- Displayed FA icon.name- Displayed name.class- HTML class added to the link element. Whendestis an array, class is added to every link. (OPTIONAL)
categoryandingredientare representation of submenu options with following options.dest- Link destination.name- Displayed name.class- HTML class added to the link element. (OPTIONAL)
Example configuration
services:
configNavbar:
implement: Nepttune\Component\IConfigMenuFactory
arguments:
- '%configMenu%'
parameters:
configMenu:
Menu:
order:
name: 'Order'
icon: 'comments'
dest: 'Order:default'
Menu2:
settings:
name: 'Settings'
icon: 'cog'
dest:
category:
name: 'Category'
noPermissions: true
dest: 'Category:default'
ingredient:
name: 'Ingredient'
dest: 'Ingredient:default'
Which renders as following HTML.
<ul class="sidebar-menu" data-widget="tree">
<li class="header">Menu</li>
<li>
<a href="/order/">
<i class="fa fa-comments"></i>
<span>Order</span>
</a>
</li>
<li class="header">Menu2</li>
<li class="treeview">
<a href="#">
<i class="fa fa-cog"></i>
<span>Settings</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
</a>
<ul class="treeview-menu">
<li>
<a href="/category/">Category</a>
</li>
<li>
<a href="/ingredient/">Ingredient</a>
</li>
</ul>
</li>
</ul>