The body in my site looks like:

<body class="not-front logged-in node-type-page no-sidebars page-content-register-now section-content">

page-content-register-now is the content-type+pagetitle.

As pagetitle can be changed by editors, unintentionally they might brake the theme.

Further down the page, there is a

<div class="node node-type-page" id="node-58">

that is much more accurate.

Not breaking any earlier theming, could the 'node-58' bit be added to the body-classes?

Comments

johnalbin’s picture

Status: Active » Closed (works as designed)

page-content-register-now is the content-type+pagetitle.

Actually, its not. Its "page-" + the path to the current page. In addition, the code cleans the path so that it is always a valid CSS class.

So, yes, if you change the path alias, it will change the body class. But hopefully you won't be changing the path often.

Keeling’s picture

I agree with the original post that the node ID should be added to the body classes array, because this value is unique. And a unique ID is the main point.

"Page + Path" is variable and can be changed under many scenarios. For example, "Page + Path" is not suitable to work with the Pathauto module because any change to a node's title changes its path.