Merge pull request #393 from plamen-nikolov/develop
Disable menu subitems & fix wrong plugin url
This commit is contained in:
commit
fb1ea6ba2d
2 changed files with 6 additions and 2 deletions
|
@ -12,7 +12,9 @@ from menus.menu_pool import menu_pool
|
||||||
|
|
||||||
from .cms_appconfig import BlogConfig
|
from .cms_appconfig import BlogConfig
|
||||||
from .models import BlogCategory, Post
|
from .models import BlogCategory, Post
|
||||||
from .settings import MENU_TYPE_CATEGORIES, MENU_TYPE_COMPLETE, MENU_TYPE_POSTS, get_setting
|
from .settings import (
|
||||||
|
MENU_TYPE_CATEGORIES, MENU_TYPE_COMPLETE, MENU_TYPE_NONE, MENU_TYPE_POSTS, get_setting,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class BlogCategoryMenu(CMSAttachMenu):
|
class BlogCategoryMenu(CMSAttachMenu):
|
||||||
|
@ -59,6 +61,8 @@ class BlogCategoryMenu(CMSAttachMenu):
|
||||||
categories_menu = True
|
categories_menu = True
|
||||||
if config and config.menu_structure in (MENU_TYPE_COMPLETE, MENU_TYPE_POSTS):
|
if config and config.menu_structure in (MENU_TYPE_COMPLETE, MENU_TYPE_POSTS):
|
||||||
posts_menu = True
|
posts_menu = True
|
||||||
|
if config and config.menu_structure in (MENU_TYPE_NONE, ):
|
||||||
|
return nodes
|
||||||
|
|
||||||
used_categories = []
|
used_categories = []
|
||||||
if posts_menu:
|
if posts_menu:
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<h3>{% trans "Categories" %}</h3>
|
<h3>{% trans "Categories" %}</h3>
|
||||||
<ul class="blog-categories">
|
<ul class="blog-categories">
|
||||||
{% for category in categories %}
|
{% for category in categories %}
|
||||||
<li><a href="{% url 'djangocms_blog:posts-category' category=category.slug %}" class="blog-categories-{{ category.count }}">
|
<li><a href="{{ category.get_absolute_url }}" class="blog-categories-{{ category.count }}">
|
||||||
{{ category.name }}
|
{{ category.name }}
|
||||||
<span>(
|
<span>(
|
||||||
{% if category.count > 0 %}
|
{% if category.count > 0 %}
|
||||||
|
|
Loading…
Reference in a new issue