-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from thewebmen/feature/improve-readme-and-some-…
…overal-improvements Updated README and added docs and contributing guides. Removed image from MenuItem
- Loading branch information
Showing
5 changed files
with
80 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Changelog | ||
|
||
The changelog is found on [https://github.com/thewebmen/silverstripe-menustructure/releases](https://github.com/thewebmen/silverstripe-menustructure/releases) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Contributing | ||
|
||
## Bugtracker | ||
Bugs are tracked in the issues section of this repository. Before submitting an issue please read over | ||
existing issues to ensure yours is unique. | ||
|
||
If the issue does look like a new bug: | ||
|
||
- Create a new issue | ||
- Describe the steps required to reproduce your issue, and the expected outcome. Unit tests, screenshots | ||
and screencasts can help here. | ||
- Describe your environment as detailed as possible: SilverStripe version, Browser, PHP version, | ||
Operating System, any installed SilverStripe modules. | ||
|
||
## Security | ||
Please report security issues to the module maintainers directly. Please don't file security issues in the bugtracker. | ||
|
||
## Copyright | ||
By supplying code to this module in any form you agree to assign copyright of that code to Webmen, on the condition that Webmen releases that code under a form of open source license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
# SilverStripe Menustructure module | ||
|
||
## Protect menus from deletion | ||
```yaml | ||
TheWebmen\Menustructure\Model\Menu: | ||
protected_menus: | ||
- 'main-menu' | ||
- 'footer-col1' | ||
- 'footer-col2' | ||
- 'footer-col3' | ||
``` | ||
|
||
## Usage | ||
Render a menu in any template using: | ||
``` | ||
$MenustructureMenu('menu-slug') | ||
``` | ||
Render a menu using a custom template using: | ||
``` | ||
$MenustructureMenu('menu-slug', 'Menus/MainMenu') | ||
``` | ||
|
||
## Todo | ||
* Improve docs | ||
This module makes it possible to use multiple menus on 1 SilverStripe site, instead of using the "default" menu. | ||
The menus in this module are also more customizable then the "default" silverstripe menu. | ||
|
||
# Requirements | ||
* SilverStripe 4.x | ||
|
||
# Installation | ||
`composer require thewebmen/silverstripe-menustructure` | ||
|
||
# Documentation | ||
* [Configuration](docs/en/configuration.md) | ||
|
||
# License | ||
See [License](LICENSE) | ||
|
||
## Maintainers | ||
* [Webmen](https://www.webmen.nl/) <developement@webmen.nl> | ||
|
||
## Contributing | ||
See [Contributing](CONTRIBUTING.md) | ||
|
||
## Development and contribution | ||
If you would like to make contributions to the module please ensure you raise a pull request and discuss with the module maintainers. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Silverstripe Menustructure configuration | ||
## Usage | ||
Render a menu in any template using: | ||
``` | ||
$MenustructureMenu('menu-slug') | ||
``` | ||
|
||
## Protect menus from deletion | ||
You can add some custom configuration file (eg. `app/_config/menu.yml)` to your project to protect menus.\ | ||
See the example below; | ||
|
||
```yaml | ||
TheWebmen\Menustructure\Model\Menu: | ||
protected_menus: | ||
- 'main-menu' | ||
- 'footer-col1' | ||
- 'footer-col2' | ||
- 'footer-col3' | ||
``` | ||
|
||
## Customizing | ||
### Templates | ||
It is possible to render the menus in custom templates. | ||
De default template is found in this module under `templates/TheWebmen/Menustructure/Model/Menu.ss`. | ||
|
||
You can use this code as example for custom menus. | ||
|
||
### Render the custom menu | ||
|
||
Render a menu using a custom template using: | ||
``` | ||
$MenustructureMenu('menu-slug', 'Menus/MainMenu') | ||
``` | ||
|
||
Here the first argument is the slug of the menu and the second argument is the template you want to use. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters