Merge pull request #4 from siterra/master
BLOG_POSTS_LIST_TRUNCWORDS_COUNT for LatestEntriesPlugin
This commit is contained in:
commit
007ad77f67
2 changed files with 3 additions and 1 deletions
|
@ -7,6 +7,7 @@ from cms.plugin_pool import plugin_pool
|
||||||
|
|
||||||
from .models import AuthorEntriesPlugin, LatestPostsPlugin, Post, BlogCategory
|
from .models import AuthorEntriesPlugin, LatestPostsPlugin, Post, BlogCategory
|
||||||
from .forms import LatestEntriesForm
|
from .forms import LatestEntriesForm
|
||||||
|
from .settings import BLOG_POSTS_LIST_TRUNCWORDS_COUNT
|
||||||
|
|
||||||
|
|
||||||
class BlogPlugin(CMSPluginBase):
|
class BlogPlugin(CMSPluginBase):
|
||||||
|
@ -23,6 +24,7 @@ class LatestEntriesPlugin(BlogPlugin):
|
||||||
|
|
||||||
def render(self, context, instance, placeholder):
|
def render(self, context, instance, placeholder):
|
||||||
context['instance'] = instance
|
context['instance'] = instance
|
||||||
|
context['TRUNCWORDS_COUNT'] = BLOG_POSTS_LIST_TRUNCWORDS_COUNT
|
||||||
return context
|
return context
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<div class="plugin plugin-blog">
|
<div class="plugin plugin-blog">
|
||||||
<div class="blog-latest-entries">
|
<div class="blog-latest-entries">
|
||||||
{% for post in instance.get_posts %}
|
{% 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 %}
|
{% empty %}
|
||||||
<p class="blog-empty">{% trans "No article found." %}</p>
|
<p class="blog-empty">{% trans "No article found." %}</p>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
Loading…
Reference in a new issue