If you want to keep the newlines in your template, you can use
http://docs.djangoproject.com/en/1.1/ref/templates/builtins/#spaceless

Peter


On 5/12/10 2:02 PM, "Noah Watkins" <[email protected]> wrote:

> I have a variable amount of lines that need to be displayed in a
> <pre></pre> block:
> 
> <pre>
>   header
>   {% if var1 %}{{ ... }}{% endif %}
>   {% if var2 %}{{ ... }}{% endif %}
>   {% if var3 %}{{ ... }}{% endif %}
>   footer
> </pre>
> 
> However, if some of the if-statements are not evaluated to be true
> then the line breaks are still displayed in the pre area causing
> "gaps". Are there any easy approaches to addressing this issue?

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

Reply via email to