https://github.com/maccath/baun-categories
Categories plugin for BaunCMS
https://github.com/maccath/baun-categories
Last synced: 2 months ago
JSON representation
Categories plugin for BaunCMS
- Host: GitHub
- URL: https://github.com/maccath/baun-categories
- Owner: maccath
- License: mit
- Created: 2015-04-18T07:13:59.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-07-25T13:28:24.000Z (almost 9 years ago)
- Last Synced: 2025-03-06T08:35:53.446Z (3 months ago)
- Language: PHP
- Size: 23.4 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Baun Categories Plugin
A categories plugin for BaunCMS
## Installation Instructions
### Using Composer
Install using composer on the commandline:
composer require maccath/baun-categories
Or in `composer.json`:
"require": {
"maccath/baun-categories": "1.*",
},### Configuration
Add the following line to your `config/plugins.php` file:
'BaunPlugin\Categories\Categories',
Run the following command inside your project directory:
php baun publish:config maccath/baun-categories
This will create config files inside the `config/plugins/maccath/baun-categories` directory, which you may then edit to
your liking.The following configuration options are available:
* `title` the title used on the categories list page and in the navigation
* `category_url` the path used to access your blog categories, no leading slash
* `exclude_from_nav` (boolean) whether or not to exclude the categories page from the navigation## Usage Instructions
### Adding categories to posts
To add categories to your posts, simply add `categories: categoryOne, categoryTwo` to the top of your blog post files.
For example, the following file will create a post with the categories 'volutpat' and 'consectetur':title: Post 1
categories: consectetur, volutpat
----
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque ut vehicula erat. Morbi volutpat posuere auctor.
Vivamus condimentum, purus nec tempus euismod, enim massa blandit est, vel elementum lacus nulla ut sem. Integer
orci libero, rutrum id nisl et, euismod auctor augue.### Viewing all posts in a category
By default, posts for categories will appear at the following path: `/categories/categoryName`. The path used to display
categories can be configured in the configuration file found at `config/plugins/maccath/baun-categories/categories.php`### Editing the categories page template
Inside your themes directory (typically `public/themes/themeName/`), create `categories.html`. This file can be
customised to display a list of categories however you like. The following example is the default file contents, which
simply displays an unordered list of categories:{% extends "layout.html" %}
{% block content %}
{{ categories_title }}
- {{ category.name }}
{% for category in categories %}
{% endfor %}
{% endblock %}