Page Template and DOCTYPE

Bug #143916 reported by Sukhbir Chahal
2
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Medium
Unassigned

Bug Description

When you use a pagetempalte to create a template for all your page tempalte pages with the use of slots, when the page is rendered it loses the <!DOCTYPE> tag at the top of the page. For example:

IF the first two lines of your template with the slots in is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" metal:define-macro="page">

if you use the slots in another page template that page is rendered to be:
<html xmlns="http://www.w3.org/1999/xhtml" metal:define-macro="page">

Losing the doctype tag at the top of the page.

Thanks

Tags: bug zope
Revision history for this message
Andreas Jung (ajung) wrote :

Changes: submitter email, importance (critical => medium)

Revision history for this message
Andreas Jung (ajung) wrote :

Please provide a unittest that demonstrates the behavior.

Revision history for this message
Sukhbir Chahal (sukhsc) wrote :

This issue is a bug in the system which causes many features of style sheets not to work in IE browsers. I therefore consider this a critical issue and was disappointed to see it had been amended to medium importance. Please could you respond to inform why this has been changed to medium importance.

Thank You

Revision history for this message
Sukhbir Chahal (sukhsc) wrote :

Please find below code examples which demostrate the problem. Thanks
the template:
======================================
<!DOCTYPE PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" html>
<html xmlns="http://www.w3.org/1999/xhtml" metal:define-macro="page">

<head>
</head>

<body>
  <metal:block define-slot="body"></metal:block>

  <input type="submit" value="My Submit Button Inside Template" class="myButton">
</body>

</html>

The file
======================================
<tal:block metal:use-macro="here/test_template/macros/page">

  <metal:block fill-slot="body">
    <input type="submit" value="My Submit Button Outside Template" class="myButton">
  </metal:block>

</tal:block>

Revision history for this message
Tres Seaver (tseaver) wrote :

Status: Pending => Rejected

The macro you are pulling in from 'test_template' *starts*
with the '<html>' tag: it is never going to pull in content
from *before* that tag.

The usual way to get the <DOCTYPE> prolog pulled in from the main
template is as follows:

 <metal:block metal:define-macro="page"
 ><DOCTYPE .....><html xmlns="....
 ...
 </html>
 </metal:block>

Revision history for this message
Sukhbir Chahal (sukhsc) wrote :

OOPPPPS sorry. You have no idea how long been looking at that. Soz abt moody email before and thanks for the fix

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers