we already had issues regarding restrictions on which HTML features to use in the past, and I expect more to come in the future. That is because HTML5 brings more and more features, and we want to generate standards compliant markup, but the core has no easy information, let alone control, about resp. over the generated doctype.
A possible solution would be to read template.htm and to parse the doctype. However, that seems to be hard to accomplish, if at all possible. And anyway, in my opinion the doctype doesn't belong in the template, because it affects plugins as well. (Instead of hard-coding (a) certain doctype(s) a template designer might tag his templates regarding the supported markup language/version.)
So we should consider a simple and efficient solution, namely to introduce a new template tag, say
Code: Select all
<?php echo doctype();?>
To make use of that new template tag existing templates would have to be adapted, but even if that would not happen, the result is most likely a non-validating but nonetheless fully working site (and at least less broken than if we would emit the doctype automatically, i.e. without the template calling a template tag).
An even simpler solution would be to rely on the HTML5 doctype, and to advice template designers to use this in the future, and to tell users to update their templates accordingly. Basically that's what CMSimple v4 does, so we would stay compatible in this regard. OTOH template designers could use the following to stay compatible with CMSimple_XH and CMSimple v4:
Code: Select all
<?php if (!function_exists('doctype')) {function doctype() {return '<!DOCTYPE html>';}}?>
<?php echo doctype();?>