henrypenny/silverstripe-custommenus
Composer 安装命令:
composer require henrypenny/silverstripe-custommenus
包简介
A Silverstripe module allowing you to create custom menus that can be gernated in the front end of your site.
README 文档
README
Developer
Developed and maintained by i-lateral
Requirements
SilverStripe 3.1 or greater.
Installation Instructions
Downloading the module:
-
Download and add the module to the "custommenus" folder in your SilverStripe root folder
-
Run dev/build?flush=all
-
Visit admin/menus/ to setup your custom menus
-
In you template, use: <% loop CustomMenu(slug) %><% end_loop %>
You can also download and install this module using composer and packagist
Usage
Once the module is downloaded and installed, you can create menus and add pages to them using the "Menus" page in the admin interfacve.
To render these menus in your templates, you can either:
Add $RenderCustomMenu(menu-slug) to your template code. This will make use of the CustomMenu.ss include to render a UL (with a unique class name).
Alternativley you can generate your own template by adding the following code:
<% if $CustomMenu(main-menu) %><ul class="menu">
<% loop $CustomMenu(main-menu) %>
<li class="$LinkingMode $FirstLast">
<a href="$Link">$MenuTitle</a>
</li>
<% end_loop %>
</ul><% end_if %>
统计信息
- 总下载量: 30
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2015-11-22