Re: Removing template newlines in

2010-05-12 Thread Peter Landry
Right, sorry! Read your question too quickly. Peter On 5/12/10 2:20 PM, "Noah Watkins" wrote: > Peter > > I don't believe "spaceless" will work because in the example I posted > there are no html tags within the block. > Consider the same example where var2 is

Re: Removing template newlines in

2010-05-12 Thread Noah Watkins
I just stumbled upon this alternative too. Thanks for the reply, and really I don't think it's too ugly. On May 12, 11:50 am, zinckiwi wrote: > Not the prettiest thing in the world, but there's always: > > >   header >   {% if var1 %}{{ ... }} >   {% endif %}{% if var2 %}{{

Re: Removing template newlines in

2010-05-12 Thread zinckiwi
Not the prettiest thing in the world, but there's always: header {% if var1 %}{{ ... }} {% endif %}{% if var2 %}{{ ... }} {% endif %}{% if var3 %}{{ ... }} {% endif %} footer Regards Scott On May 12, 2:20 pm, Noah Watkins wrote: > Peter > > I don't believe

Re: Removing template newlines in

2010-05-12 Thread Noah Watkins
Peter I don't believe "spaceless" will work because in the example I posted there are no html tags within the block. Consider the same example where var2 is evaluated to be false: header ... --NEWLINE-- ... footer The newline remains, but is displayed on a webpage because it is in

Re: Removing template newlines in

2010-05-12 Thread Peter Landry
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" wrote: > I have a variable amount of lines that need to be displayed in a > block: > > >

Removing template newlines in

2010-05-12 Thread Noah Watkins
I have a variable amount of lines that need to be displayed in a block: header {% if var1 %}{{ ... }}{% endif %} {% if var2 %}{{ ... }}{% endif %} {% if var3 %}{{ ... }}{% endif %} footer However, if some of the if-statements are not evaluated to be true then the line breaks are