BLOG_POSTS_LIST_TRUNCWORDS_COUNT for LatestEntriesPlugin

This commit is contained in:
Max Vyaznikov 2014-02-28 13:23:54 +03:00
parent 912f3b57f7
commit 01c545d72d
2 changed files with 3 additions and 1 deletions

View file

@ -7,6 +7,7 @@ from cms.plugin_pool import plugin_pool
from .models import AuthorEntriesPlugin, LatestPostsPlugin, Post, BlogCategory
from .forms import LatestEntriesForm
from .settings import BLOG_POSTS_LIST_TRUNCWORDS_COUNT
class BlogPlugin(CMSPluginBase):
@ -23,6 +24,7 @@ class LatestEntriesPlugin(BlogPlugin):
def render(self, context, instance, placeholder):
context['instance'] = instance
context['TRUNCWORDS_COUNT'] = BLOG_POSTS_LIST_TRUNCWORDS_COUNT
return context

View file

@ -2,7 +2,7 @@
<div class="plugin plugin-blog">
<div class="blog-latest-entries">
{% for post in instance.get_posts %}
{% include "djangocms_blog/includes/blog_item.html" with post=post %}
{% include "djangocms_blog/includes/blog_item.html" with post=post TRUNCWORDS_COUNT=TRUNCWORDS_COUNT %}
{% empty %}
<p class="blog-empty">{% trans "No article found." %}</p>
{% endfor %}