Drop content div only in the front-page with XDV

319 Views Asked by At

I'm trying to remove the content div only for the homepage by this line (in the rules.xml)

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

It doesn't work ... why? It seems ok for me :)

2

There are 2 best solutions below

2
On

You can use CSS selectors, too:

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

This resolves to the same XPath expression, but it's a lot easier on the eye

1
On

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

To use that syntax you would have to match on all the classes for the body tag

Use:

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

(works for me in FireBug)