Django 获取具有引导自定义主题和夹层的博客条目
我是mezzanine的新手,我通过复制django应用程序中亲戚文件夹中的模板和静态文件,成功地安装了自定义引导主题 假设在我的index.html中有一些类似的博客条目Django 获取具有引导自定义主题和夹层的博客条目,django,blogs,mezzanine,Django,Blogs,Mezzanine,我是mezzanine的新手,我通过复制django应用程序中亲戚文件夹中的模板和静态文件,成功地安装了自定义引导主题 假设在我的index.html中有一些类似的博客条目 <h2>Other Entries</h2> <article> <h3>Blog Post 1</h3> <p>Contrary to popular belief, Lorem Ipsum is not simply random text....
<h2>Other Entries</h2>
<article>
<h3>Blog Post 1</h3>
<p>Contrary to popular belief, Lorem Ipsum is not simply random text.... <a href="#">Read more</a></p>
</article>
<article>
<h3>Blog Post 2</h3>
<p>Contrary to popular belief, Lorem Ipsum is not simply random text.... <a href="#">Read more</a></p>
</article>
<article>
<h3>Blog Post 3</h3>
<p>Contrary to popular belief, Lorem Ipsum is not simply random text.... <a href="#">Read more</a></p>
</article>
其他条目
如何获取以前插入到管理页面的博客条目
谢谢在模板顶部放置:
{% load blog_tags %}
然后,无论你想让博客帖子出现在什么地方,都要像下面这样
{% blog_recent_posts as recent_posts %}
{% for blog_post in recent_posts %}
<h3>{{ blog_post.title }}</h3>
{{ blog_post.description_from_content|truncatewords_html:10|safe }}
<a href="{{ blog_post.get_absolute_url }}">Read more</a>
</article>
{% endfor %}
{%blog\u最近的文章作为最近的文章%}
{最近发布的博客文章%}
{{blog_post.title}
{{blog_post.description_from_content | truncatewords_html:10 | safe}}
{%endfor%}
无耻插头:
我正在写一系列博客文章,描述我如何创建夹层主题。看看吧