我想知道如何在使用Diazo主题时将类添加到body标签中。
我将使用
一个解决方案是:
if-content
检查portal-column-two
是否存在,根据此将一个类放入body标签。一个解决方案是:
<replace theme="/html/body/@class">
<xsl:attribute name="class"><xsl:copy-of select="." /> three_col</xsl:attribute>
</replace>
这里有一个描述如何将类添加到body标签的链接:使用notheme的diazo添加类到body标签,但仅适用于设置了notheme。
那么如何在运行时将简单的附加CSS类放入body标记中呢?
编辑: 这适用于纯Diazo主题和Plone(plone.app.theming):
<before theme-children="/html/body"><xsl:attribute name="class"><xsl:value-of select="/html/body/@class" /> three_col</xsl:attribute>
</before>
基于条件:
<before theme-children="/html/body" css:if-content="#portal-column-two">
<xsl:attribute name="class"><xsl:value-of select="/html/body/@class" /> three_col</xsl:attribute>
</before>
<before theme-children="/html/body" css:if-not-content="#portal-column-two">
<xsl:attribute name="class"><xsl:value-of select="/html/body/@class" /> two_col</xsl:attribute>
</before>
本文介绍了一个关于IT技术的方案。如果您想了解更多信息,请点击上面的链接。