Separate div content on first page only with XDV

I am trying to delete the contents of a div only for the home page on this line (in rules.xml)

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

It doesn't work ... why? I think this is normal :)

+4
source share
2 answers

You can also use the CSS selector:

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

This resolves the same XPath expression, but is much easier on the eye.

+4
source

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

To use this syntax, you will have to match all classes for the body tag

Using:

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

(works for me in FireBug)

+2
source

Source: https://habr.com/ru/post/1343041/


All Articles