That's a cool idea Ian. I was reluctant to put this code serverside (MVC
considerations) but I see now that really it is somewhere in the app logic
rather than display so it kinda fits in with that methodology... I'll give
it a bash.
Thanks for the explanation Russell.
--
You received this
On Tue, Dec 13, 2011 at 2:21 PM, Jason <1jason.whatf...@gmail.com> wrote:
> Hi there,
>
> I love the concept of DRY, and django's enthusiasm for this concept. In
> light of this I have tried to have a template extend a template, but it
> doesn't seem to work. Is there a better way than what I'm
_template.html" %}
> >
> > _base_script.html
> >
> > {% if current_user %}
> >
> > {% extends "_logged_out_template.html" %}
> >
> > {% else %}
> >
> > {% extends "_logged_in_template.html" %}
&g
> {% endif %}
This sample suggests that you may have some misunderstandings about
how Django's template language -- and the {% extends %} tag in
particular -- are supposed work.
{% extends %} is *not* the same as {% include %}. A template can only
*extend* a single other template.
On Tue, Dec 13, 2011 at 7:21 PM, Jason <1jason.whatf...@gmail.com> wrote:
> Hi there,
>
> I love the concept of DRY, and django's enthusiasm for this concept. In
> light of this I have tried to have a template extend a template, but it
> doesn't seem to work. Is there a better way than what I'm
Hi there,
I love the concept of DRY, and django's enthusiasm for this concept. In
light of this I have tried to have a template extend a template, but it
doesn't seem to work. Is there a better way than what I'm currently doing?
The current way
index.html
{% if current_user %}
{%
6 matches
Mail list logo