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
-~----------~----~----~----~------~----~------~--~---