我在 Plone 4.1 中使用重氮(当前为 plone.app.theming 1.0b1-r48205)。我想完全使用 Plone 的 html 作为搜索小部件,除了我想替换<input>
用于搜索小部件中搜索按钮的元素,带有<button>
. The 重氮文档似乎建议你可以这样做。
在我的主题 html 文件中,我有一个空的<div id="portal-searchbox"></div>
。在我的 Rules.xml 中,我有以下内容:
<rules if-content="$enabled">
<replace css:theme="div#portal-searchbox">
<xsl:apply-templates css:select="div#portal-searchbox" />
</replace>
<xsl:template css:match="div#portal-searchbox input.searchButton">
<button type="submit"><img src="images/search.png" alt="Search" /></button>
</xsl:template>
</rules>
我已经尝试了很多变体,但没有成功。任何帮助将非常感激。
好的,所以下面的工作。之前不起作用的原因是<xsl:template>
不在根级别规则标记中(那里有一个文档错误)。这<xsl:template>
必须位于根级别规则标记中,因为无法将规则条件应用于<xsl:template>
现在。
<xsl:template css:match="div#portal-searchbox input.searchButton">
<button type="submit"><img src="images/search.png" alt="Search" /></button>
</xsl:template>
<replace css:theme="div#portal-searchbox" css:content="div#portal-searchbox"/>
Update:我添加了对<replace content="...">
到重氮,所以内联<xsl:template>
被视为已弃用。而是使用:
<replace css:content="div#portal-searchbox input.searchButton">
<button type="submit"><img src="images/search.png" alt="Search" /></button>
</replace>
<replace css:theme="div#portal-searchbox" css:content="div#portal-searchbox"/>
文档位于http://diazo.org/advanced.html#modifying-the-content-on-the-fly
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)