Extension for cmsplugin-blog which adds categories to the blog.
Project description
An extension for cmsplugin-blog which adds categories to the blog. Out of the box cmsplugin-blog only supports tags.
Installation
You need to install the following prerequisites in order to use this app:
pip install Django pip install django-cms pip install cmsplugin-blog pip install simple-translation
If you want to install the latest stable release from PyPi:
$ pip install cmsplugin-blog-categories
If you feel adventurous and want to install the latest commit from GitHub:
$ pip install -e git://github.com/bitmazk/cmsplugin-blog-categories.git#egg=cmsplugin_blog_categories
Add cmsplugin_blog_categories to your INSTALLED_APPS:
INSTALLED_APPS = ( ..., 'cmsplugin_blog_categories', )
In your django-cms instance change the Blog Apphook to the Blog Categories Apphook.
Usage
This app includes all URLs of the original cmsplugin-blog, so if you were not using an apphook but hooked the URLs into your main urls.py manually, you should hook this app’s urls.py instead.
Display the category of an entry
In order to display an entry’s category, do the following:
{% load cmsplugin_blog_categories_tags %} {% get_category entry as category %} Category:<a href="{{ category.get_absolute_url }}">{{ category.get_title }}</a>
Display a list of all categories
In order to display a list of all available categories, do the following:
{% load cmsplugin_blog_categories_tags %} {% render_category_links exclude_empty=1 %}
Use the exclude_empty parameter if you want to show only those categories that have posts.
If you want to control the output of that tag, override the template cmsplugin_blog_categories/category_links_snippet.html
Contribute
If you want to contribute to this project, please perform the following steps:
# Fork this repository # Clone your fork $ mkvirtualenv -p python2.7 cmsplugin-blog-categories $ pip install -r requirements.txt $ ./logger/tests/runtests.sh # You should get no failing tests $ git co -b feature_branch master # Implement your feature and tests # Describe your change in the CHANGELOG.txt $ git add . && git commit $ git push origin feature_branch # Send us a pull request for your feature branch
Whenever you run the tests a coverage output will be generated in tests/coverage/index.html. When adding new features, please make sure that you keep the coverage at 100%.
Roadmap
Check the issue tracker on github for milestones and features to come.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file cmsplugin-blog-categories-0.7.tar.gz
.
File metadata
- Download URL: cmsplugin-blog-categories-0.7.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9cc7fb19bd17046b89f01fec24e4f5461026f581ad012cabc10bd788fed7309 |
|
MD5 | 573b5ce910b8c94442aa13394f0a71c1 |
|
BLAKE2b-256 | fa03d13a6fbc2c0f149b60492e7ca133ab2613b3e6851730b1639c7fbe9ad383 |