4

I am trying to make a HTML5/CSS3 theme with Diazo from a Plone site, using plone.app.theming 1.0b8. It is working like a charm in the BODY part. But the HTML tag and HEAD part are more difficult. To me at least :)

I have tried to:

  • remove xmlns and xml:lang attributes in the HTML tag
<drop attributes="xmlns xml:lang" theme="/html/" />
  • remove base tag
<drop theme="/html/head/base/" />
  • remove meta tag where http-equiv="Content-Type"
<drop theme="/html/head/meta[@http-equiv='Content-Type']" />

I am wondering if plone.app.theming or Diazo is forcing these things into the output, or if it's my xpath which is buggy? I have searched around but found no answers.

BR

raekjaer
  • 3
  • 2
  • Is there a specific reason for manipulating the theme's html template via Diazo instead of editing its source code directly? – Christoph Böhner Jul 28 '11 at 07:46
  • 2
    Many prefer to avoid editing the html template, and in some cases it's simply not possible (i.e. when the html template is fetched over the network) – aclark Jul 28 '11 at 10:30

1 Answers1

3

Your xpaths probably should not end with a trailing '/', though I don't think this is the problem here.

It won't be possible to remove the xmlns attribute as that is added by XMLSerializer in XHTML mode (at least under common circumstances). You could set an HTML serialization instead with <xsl:output method="html"/> inside your root rules tag.

In XHTML mode, the XMLSerializer will add an xml:lang to match the lang attribute. Again, try setting the html serialization.

Normally the base tag gets copied from the content into the theme - there ought to be no reason to have a base tag in a theme html file. If you don't copy it over, it won't end up in the output. However it is advisable to always include a base tag in output from Zope as the same page will be rendered at both http://localhost/some_url and http://localhost/some_url/, which will lead to differences with any relative urls.

The content-type header is added by libxslt is unconditionally added by libxslt and is impossible to suppress.

Laurence Rowe
  • 2,909
  • 17
  • 20
  • Thanks for the answer. The xsl:output removed both xmlns and xml:lang. Regarding the base tag, I guess it's the same as the content-type header - it's impossible to suppress. – Casper Rækjær Jul 29 '11 at 07:19
  • Ah yes, this is a Zope 'feature' - it will automatically add a base tag to html pages without one. It's always best to copy in the Plone generated base tag as the two do not always match. – Laurence Rowe Jul 29 '11 at 13:48