Merge pull request #4 from siterra/master

BLOG_POSTS_LIST_TRUNCWORDS_COUNT for LatestEntriesPlugin
This commit is contained in:
Iacopo Spalletti 2014-02-28 13:35:24 +01:00
commit 007ad77f67
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 %}