On Tue, Jul 26, 2011 at 11:29 AM, Christoph Zwerschke <[email protected]> wrote:
> Am 26.07.2011 01:18, schrieb Alessandro Molina:
>> Next step might be to have the quickstart template that sets the meta
>> tag using response.content_type.
>
> Yes, this should work. We could include the charset here as well:
>
> <meta http-equiv="content-type"
> content="${response.content_type}; charset=${response.charset}"/>
>
I just did a few changes to render.py, decorators.py and master.html
and I'm now able to render pages in both xhtml and
application/xhtml+xml by simply specifying it inside the expose
decorator like:
@expose('app.templates.index') -> outputs xhtml with content_type text/html
@expose('app.templates.index', content_type='application/xhtml+xml')
-> outputs xml with right content type
Also changing charset in response works correctly.
Probably is fine to push this as is as it might have his own life.
> Btw, we have a similar problem with the doctype. As far as I see, in TG2
> you cannot change it or have it automatically adapt to the content type
> (e.g. HTML, XMTML1, HTML5).
>
Yes, this is indeed a more difficult issue to solve.
Should we define h.doctype() and substitute the line in master.html with that?
Currently there isn't any easier solution that I'm able to think of.
> Also, should we start creating HTML5 templates on quickstart?
>
This is an interesting question. I don't really have any answer to
this one. Maybe we should postpone the issue.
Currently I'm using most html5 tags while keeping xhtml output, never
seen any problem for now.
--
You received this message because you are subscribed to the Google Groups
"TurboGears Trunk" 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/turbogears-trunk?hl=en.