Thanks. Sadly though I don't want it to extend base.html, I want it to
replace base.html but only under certain circumstances.
As an example, base.html will have the current structure:
______header______
| |
nav | content | content
| |
______footer_______
Where as base2.html will have a different structure:
______header______
content
------------------------------
content
------------------------------
______footer_______
So as you can tell the first variation of base.html will have a column
based layout where as the second variation will have row based
content.
This needs to be done at a project template level rather than at an
application level and extending from what I can tell simply won't cut
it.
We also won't be able to have a simple base.html that has a page
wrapper and then in each template define an extension for it because
that's too much replication.
On Dec 22, 8:04 pm, bruno desthuilliers
<[email protected]> wrote:
> On 22 déc, 13:34, Kura <[email protected]> wrote:
>
> > Hey guys, I'm currently working on a content management system built
> > on the Django framework, currently the whole cms works on a
> > section->page(s) basis which is working well, we've run in to some issues
> > with
>
> > our designs in that the blocks for content on some pages are in
> > different locations and the overall layout is different, to combat
> > this we've added a field to the page table that tells Django which
> > layout template it should use, the issue is I'm not sure how to
> > actually make Django read that column and actually switch the whole
> > layouts template for that page on a project level as a replacement to
> > base.html while keeping base.html as default for other pages.
>
> > Any ideas?
>
> if it's a field of the Page model object and you have a Page model
> instance in your context, then {% extends page.template|
> default:"base.html" %} should do.
>
> http://docs.djangoproject.com/en/dev/ref/templates/builtins/#extends
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---