On Jul 9, 8:47 am, "paul.dorman" <paul.dor...@gmail.com> wrote: > Hi all, > > I'd like to include blocks of content in my templates which is > editable in the Admin app. I'd design the overall template, but > include bits that the computer illiterate folks here could change, > something like this: > > [my template] > <normal HTML headers and the like> > [a form which is included in the template] > [a block of content that can be edited in the Admin application by > computer illiterate monkeys] > <normal HTML footers and the like> > > I initially thought that flatpages would be the answer (with TinyMCE), > but alas, there appears to be no built-in way to include a flatpage > inside a template. > > I don't want the content blocks to have a URL (so no URLConf entry). I > don't mind if I use a model, but I don't know how to get the Admin app > to pick up the model without a URLConf entry. > > Also, how do I reference a value from the model inside any template? > I've tried creating a variable (testblock = ContentBlock.objects.get > (name='testblock')) in my view, and then including {{testblock}} in my > template, but that does nothing. I know I'm doing it wrong, but I > can't find documentation to help. > > Please help. This is my first real Django application (so yes, I'm a > newb), but I'd like to stick with common practice as far as possible. > > Thanks for your help, > Paul
There are various third-party apps which do what you want. See for example django-chunks: http://code.google.com/p/django-chunks/ As regards the problem with referencing the block in your view, are you sure you included it in your context? -- DR. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---