django-rest-swagger icon indicating copy to clipboard operation
django-rest-swagger copied to clipboard

Can't override title in base template

Open awgreenblatt opened this issue 7 years ago • 4 comments

Hi there -

I created a simple pull request to solve this. I want to override the

tag in base.html, but the only way currently to do so is to completely replace base.html, which is a bit overkill. I added a block around the title. <p>Thanks very much,</p> <p>Alan</p>

awgreenblatt avatar Jun 27 '17 14:06 awgreenblatt

This should probably be set to the same value as title in:

get_swagger_view(title='my title')

by default (maybe, + 'Swagger UI') and overridable, no?

FYI, PR is https://github.com/marcgibbons/django-rest-swagger/pull/666, nice one @awgreenblatt!

decentral1se avatar Jul 13 '17 22:07 decentral1se

Agreed, the title in base.html should default to whatever was set in get_swagger_view(), but to me that's a separate issue. I'm not personally sure how to get the title from the schema into the renderer context so it could be used in the template. I'd personally rather if we kept the two separate so we didn't hold up being able to override the template. Unless of course, someone else wants to provide the code to initialize the title in base.html to that set in get_swagger_view().

awgreenblatt avatar Jul 14 '17 14:07 awgreenblatt

I'd personally rather if we kept the two separate so we didn't hold up being able to override the template.

:+1: - hope this gets in soon!

decentral1se avatar Jul 14 '17 17:07 decentral1se

A template override block on base.html would be a good start :-)

neilhut42 avatar Mar 11 '18 09:03 neilhut42