Design:Blog.html
From Katapulta
Acest template afișează articolele din blogul magazinului tău.
Se pot afișa toate articolele din blog sub forma unei liste:
<h2>Shop Blog</h2>
<ul id="post-list">
{% for post in blog.all_posts %}
<li>
<h4><a href="{{ post.url }}">{{ post.title }}</a></h4>
<p>
{{ post.content|nl2br|truncate(400) }}
<span class="readmore"><a href="{{ post.url }}">« citeste mai mult</a></span>
</p>
</li>
{% endfor %}
</ul>
Sau articolele grupate pe categorii:
<ul id="blog-categories">
{% for category in blog.categories %}
<li id="category_{{ category.id }}">
<a href="{{ category.url }}" title="{{ category.title|e }}">{{ category.title|e }}</a>
<ul id="postlist-category_{{ category.id }}">
{% for post in category.posts %}
<li>
<h4><a href="{{ post.url }}">{{ post.title }}</a></h4>
<p>
{{ post.content|nl2br|truncate(400) }}
<span class="readmore"><a href="{{ post.url }}">« citeste mai mult</a></span>
</p>
</li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
Variabile
-
blog
- are următoarele atribute-
blog.all_posts
- lista cu toate articolele -
blog.catagories
- lista categoriilor de articole
-