I'm implementing James Bennett's excellent django-contact-form but have hit a snag. My contact page not only contains the form, but also additional flat page information.
Without rewriting the existing view the contact form uses, I'd like to be able to wrap, or chain, the views. This way I could inject some additional information via the context so that both the form and the flat page data could be rendered within the same template.
I've heard it mentioned that this is possible, but I can't seem to figure out how to make it work. I've created my own wrapper view, called the contact form view, and attempted to inspect the HttpResponse object for an attribute I can append to, but I can't seem to figure out which, if any, it is.
EDIT: James commented that the latest code can new be found here at BitBucket.
extra_context
argument (which is there for, among other things, precisely this sort of use case).There's a context processor that may do what you want.
http://docs.djangoproject.com/en/dev/ref/templates/api/
You can probably add your various pieces of "flat page information" to the context.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With