使用XDV仅在首页中删除内容div

时间:2011-03-09 17:29:56

标签: plone theming xdv

我正在尝试仅通过此行删除主页的内容div(在rules.xml中)

<drop css:theme="#content" 
      if-content="/html/body[@class='section-front-page']" />

它不起作用......为什么?对我来说似乎没问题:))

2 个答案:

答案 0 :(得分:4)

您也可以使用CSS选择器:

<drop css:theme="#content" 
      css:if-content="body.section-front-page" />

这解析为相同的XPath表达式,但它在眼睛上更容易

答案 1 :(得分:2)

请参阅:http://pivotallabs.com/users/alex/blog/articles/427-xpath-css-class-matching

要使用该语法,您必须匹配所有正文标记的类

使用:

/html/body[
   contains(
      concat(' ',normalize-space(@class),' '),
      ' section-front-page '
   )
]

(适用于FireBug)

相关问题