I want to add a body class that will only appear on the actual node display (e.g. mysite.com/node/1
). I don't want this body class to appear on the node/edit page (e.g. (mysite.com/node/1/edit
) or the node/add page.
The reason for this is that I am making custom node form templates. At the moment, the css gets wrongly applied to the node Display.
I know I could just add a wrapper DIV to my templates, but I would rather use the body class, as it will be more efficient for my theming work flow.
I have successfully applied body classes to the edit and add displays with the following code in template.php
function MYTHEME_preprocess_html(&$variables) {
if ((arg(0)=='node' && arg(2)=='edit') || (arg(0) == 'node') && (arg(1) == 'add')) {
$variables['classes_array'][] = 'node-edit-page';
}
}
Is there something similar I could use to target the actual node display? I tried doing a KPR dump of the page, node and HTML hooks with theme_devel, but I could not find anything useful.