you could create a template module where you put in the logic to dipslay
the content of the post:

    <a href="{{ entry.id }}>{{ entry.title }}</a>
    {{ entry.text }}

and you could call it modules/post.html

now you can include it in the other templates with :

    {% include "modules/post.html" %}




R. K. wrote:
> Hello,
>
> I'm writing some simple webblog, just for self teaching, and I have a
> question how to do better. Here is the situation, I have base.html, I
> have blog.html which extends base. Now in that blog I would like to
> put posts, full text posts, without comments, and link to the post
> only with comments. And I run out of ideas how to make it without
> repeating html. For e.g. in blog.html I have:
>
> {% extends "base.html" %}
> {% for entry in entries %}
>
> <a href="{{ entry.id }}>{{ entry.title }}</a>
> {{ entry.text }}
>
> {% endfor %}
>
> In entry.html I have
>
> {% extends "base.html" %}
>
> <a href="{{ entry.id }}>{{ entry.title }}</a>
> {{ entry.text }}
>
> {{ and here goes comments }}
>
> So, the entry part is very simplified to show an idea, where is my
> problem, same html code in entry.html and in blog.html, how could I
> avoid that?
>
>   

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to