Personal tools
Namespaces
Variants
Actions

Design:Blog.html

From Katapulta

Jump to: navigation, search

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 }}">&laquo; 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 }}">&laquo; citeste mai mult</a></span>
      </p>
    </li>
    {% endfor %}
    </ul>
  </li>
  {% endfor %}
</ul>

Variabile

În template-ul blog.html pot fi accesate următoarele variabile:

  • blog
    - are următoarele atribute
    • blog.all_posts
      - lista cu toate articolele
    • blog.catagories
      - lista categoriilor de articole