i'm displaying the content of a document in an overlay using
plone/document?ajax_load=True&ajax_include_head=True
as the src for an iframe.
in development mode appending &diazo.off=1
did the trick.
on the production server this sadly does not work, so i added the
ajax_load parameter as suggested in the documentation of plone.app.theming
i wrapped all my directives in a <rules if-not="$ajax_load">
element to make sure they are not applied (see code below)
now i'd need to mark the body of the iframed page with a certain class to apply different styles (eg no background color for the body in overlays)
the solution proposed for a nearly similar question does only work if you are using a theme with a body element having a class attribute to operate on.
is there a way to add a class to the content without having a theme (using )? or do i have to supply an empty html document (index2.html) as theme and apply lots of rules to copy over css/js etc twice?
<rules if="$ajax_load">
<!-- theme href="index.html" /-->
<notheme />
<!-- only works when using a theme -->
<before theme-children="/html/body"><xsl:attribute name="class"><xsl:value-of select="/html/body/@class"/> my class</xsl:attribute></before>
<!-- thought this could to the trick but does not work at all -->
<xsl:template match="html/body">
<xsl:attribute name="class"> foo</xsl:attribute>
</xsl:template>
</rules>
<rules if-not="$ajax_load">
<theme href="index.html" />
<replace content="/html/head/title" theme="/html/head/title" />
...