views:

188

answers:

1

Hallo,

is there any chance to access the "name" value of the current admin.site object in a admin template?

I have 3 different admin.site-objects and want a template tag to generate generic content,depending on the current admin.site.name.

thanks in advance

A: 

You could provide the name of the current site to all of your templates by writing a custom template context processor that would set a variable (e.g., SITE_NAME) in the context for every template.

Will McCutchen
i already tried this, the problem is, that i cant cat the ADMIN.SITE.NAME out of the context :(
renton
I don't know what you mean. If you've already written a context processor to do this, how about sharing that code with us, in case there's something wrong with it?
Will McCutchen
i figured out that is NOT POSSIBLE :(
renton
That seems highly unlikely. In what way is it "NOT POSSIBLE"? Here's one way to do what you're trying to do: http://bradmontgomery.blogspot.com/2009/01/add-context-processor-for-your-django.html
Will McCutchen
again: its not about "site" like the "sites-framework" used by flatpages.... its about admin.site (http://docs.djangoproject.com/en/dev/ref/contrib/admin/) that is a complete different thing, but thanks :-)
renton