| {% sphboard_recursive_category_iterator %} | | {% sphboard_recursive_category_iterator %} |
| <option value="{{ category.get_absolute_ur | | <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> |
| {{ children }} | | {{ children }} |
| {% endsphboard_recursive_category_iterator % | | {% endsphboard_recursive_category_iterator % |
| } | | } |
| </select> | | </select> |
t | | t |
|
| | |
|
| | | # Display the latest threads of one category
|
| | |
|
| | | You 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.
|
| | |
|
| | | ## Usage
|
| | |
|
| | | Simply 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)
|
| | |
|
| | | ## Example
|
| | |
|
| | | {% load sphboard_extras %}
|
| | | {% sphboard_latest_threads sph_setting |
| | | s.groups_sphene_news_category_id %}
|
| | | {% for post in threads %}
|
| | | <h2>{{ post.postdate|sph_date:"ONL |
| | | Y_DATE" }}</h2>
|
| | | <p><a href="{{ post.get_absolute_u |
| | | rl }}">{{ post.subject }}</a></p>
|
| | | <p>{{ post.body_escaped }}</p>
|
| | | {% endfor %}
|
| | | {% endsphboard_latest_threads %}
|