Sphene Community Tools

Community

Copyright © 2007-2018 by Herbert Poul

You are not logged in.
Login
Register

Change Language:



AddThis Social Bookmark Button

A Django site.

Powered by Sphene Community Tools

Forum template tags

Board / TemplateTags

Back to Snip <-- Previous Change

Diff Summary
Title Forum template tags Forum template tags
Date 2008-04-12 17:07:43 2009-08-13 23:01:35
Editor Herbert Poul Herbert Poul
Tags

2008-04-12 17:07:43 by Herbert Poul
2009-08-13 23:01:35 by Herbert Poul
28      {% sphboard_recursive_category_iterator %}28      {% sphboard_recursive_category_iterator %}
29        <option value="{{ category.get_absolute_ur29        <option value="{{ category.get_absolute_ur
>l }}">{% for i in depthrange %}--{% endfor %} {{ c>l }}">{% for i in depthrange %}--{% endfor %} {{ c
>ategory.name }}</option>>ategory.name }}</option>
30        {{ children }}30        {{ children }}
31      {% endsphboard_recursive_category_iterator %31      {% endsphboard_recursive_category_iterator %
>}>}
32    </select>32    </select>
tt33
34
35# Display the latest threads of one category
36
37You probably want to list the latest threads of a 
 >category e.g. on the start page or in the base tem
 >plate on one side of your website (something like 
 >'latest news', etc.) - If you are not using the [W
 >iki] (and the news macro), this template tag is fo
 >r you.
38
39## Usage
40
41Simply pass in the ID for the category for which y
 >ou want to display the latest threads. You probabl
 >y want to use a settings variable for this, so you
 > don't have a hardcoded ID in your templates. (but
 > feel free to do it any other way)
42
43## Example
44
45            {% load sphboard_extras %}
46            {% sphboard_latest_threads sph_setting
 >s.groups_sphene_news_category_id %}
47              {% for post in threads %}
48                <h2>{{ post.postdate|sph_date:"ONL
 >Y_DATE" }}</h2>
49                <p><a href="{{ post.get_absolute_u
 >rl }}">{{ post.subject }}</a></p>
50                <p>{{ post.body_escaped }}</p>
51              {% endfor %}
52            {% endsphboard_latest_threads %}


Powered by Sphene Community Tools