4

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 :)

Davi Lima
  • 800
  • 1
  • 6
  • 20
Vito
  • 1,201
  • 1
  • 10
  • 16

2 Answers2

4

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

optilude
  • 3,538
  • 3
  • 22
  • 25
  • Thank's Martin, it was my first choice, but it doesn't work. The html code I have is: – Vito Mar 10 '11 at 11:09
  • 1
    Is the #content div in the theme or the page content from Plone? If it's in the page content then you want to be using ` – Laurence Rowe Mar 13 '11 at 21:48
2

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)

Auspex
  • 2,175
  • 15
  • 35
  • 1
    Note that while **your** front page has "section-front-page" (which is the default for the site), that "section..." name may be different if you select another item to use as the default view for the site root. – Auspex Mar 09 '11 at 18:44