如何将 plone 的内容块插入到重氮主题中
我在 Plone 4.1 中使用重氮(当前为 plone.app.theming 1.0b1-r48205)。我想完全使用 Plone 的 html 作为搜索小部件,除了我想用
在我的主题 html 文件中,我有一个空的 。在我的 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>
我尝试了多种变体,但没有成功。任何帮助将不胜感激。
I'm using a diazo (currently plone.app.theming 1.0b1-r48205) with Plone 4.1. I want to use exactly Plone's html for the search widget except that I'd like to replace <input>
element used for the search button in the search widget with a <button>
. The diazo docs seem to suggest you can do this.
In my theme html file I have an empty <div id="portal-searchbox"></div>
. In my rules.xml I have the following:
<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>
I've tried numerous variations of this but with no success. Any help would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的,所以下面的工作。之前不起作用的原因是
不在根级别规则标记中(那里存在文档错误)。
必须位于根级别规则标记中,因为当前无法将规则条件应用于
。更新:我已向 Diazo 添加了对被视为已弃用。请改用:
的支持,因此内联http://diazo.org/advanced 上的文档。 html#即时修改内容
Ok, so the following works. The reason it wasn't working before was that the
<xsl:template>
was not in the root level rules tag (there's a documentation bug there). The<xsl:template>
must be in the root level rules tag because there is no way to apply rule conditions to an<xsl:template>
currently.Update: I've added support for
<replace content="...">
to Diazo, so inline<xsl:template>
's are considered deprecated. Instead use:Documentation at http://diazo.org/advanced.html#modifying-the-content-on-the-fly