Blog Application

13 views
Skip to first unread message

ccube

unread,
Apr 6, 2009, 9:02:10 AM4/6/09
to Django Basic Apps
Hey folks,
i am really new to django and found this Basic Blog apps. I
implemented a design Template and then I ran into my first problem. On
the left, there is a Menu. I want to show all categories in a list
like in the template category_list.html.
Is there any preffered way to do this?

My base.html contains a {% block menu %}{% endblock %} block.

So I thougt, i have to add a {% block menu %}{% endblock %} also to
the base_blog.html, because i want to see it on every page.

{% block menu %}
<ul class="link_list">
{% for category in object_list %}
<li><a href="{{ category.get_absolute_url }}">{{ category }}</a></
li>
{% endfor %}
</ul>
{% endblock %}

But this is only working onto the http://localhost:8000/blog/categories/
page. :(

What to do for having the list on every page?

cheers, and thank you in advance,

Lukas

Myles Braithwaite

unread,
Apr 6, 2009, 10:19:34 AM4/6/09
to django-b...@googlegroups.com
You have to use the templatetag like this:

{% load blogs %}
{% get_blog_categories as category_list %}
{% for category in category_list %}

---
Myles Braithwaite

Please consider the trees before print this email.

ccube

unread,
Apr 6, 2009, 3:44:08 PM4/6/09
to Django Basic Apps
Wow, this is working. And it is quite easy. :) Thanks for your
helping. :)
Reply all
Reply to author
Forward
0 new messages