我正在使用 plone/document?ajax_load=True&ajax_include_head=True
作爲iframe的src在重疊中顯示文檔的內容。使用重氮與notheme添加課程到身體標記
在開發模式追加&diazo.off=1
做了伎倆。 生產服務器這個可悲的是不起作用的,所以我說的 ajax_load參數作爲documentation of plone.app.theming
我包裹着我的所有指令在<rules if-not="$ajax_load">
元建議,以確保不會應用它們(見下面的代碼)
現在我需要具有一定的階級,以紀念的iFrame網頁的正文應用不同的樣式(例如,用於覆蓋身體無背景色)
提出了一個nearly similar question的解決方案並只有當你的工作使用具有類屬性的body元素的主題進行操作。
有沒有一種方法可以在沒有主題(使用)的情況下將內容添加到內容中? 或我必須提供一個空的HTML文檔(index2.html)作爲主題,並應用大量的規則複製通過CSS/JS等兩次?
<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" />
...
感謝澄清laurence。不知道,實際上需要一個主題前後(重氮和它的文檔http://docs.diazo.org/en/latest/basic.html#rule-directives隱藏這些實施細節) 您提出的解決方案適用於我,但實際上內容主體的CSS類不會被複制。生成的body元素中唯一的類是newclass。 – fRiSi 2012-07-30 07:52:25
嘗試''而不是''「。 –
2012-07-30 17:11:59
做到了。謝謝 – fRiSi 2012-08-01 07:25:38