Views: Add class to body based on Views In Drupal, every Views page has a class that is stored in $css_name (inside views-view.tpl.php). 

Is there are any way to get this class to appear in the body class of the page? 

Ideally, I would like to prefix it with page- (So views-index, would become page-views-index). I would also like to do it without install extra modules.
Two simple ways I might approach this:


Context Module
jQuery


1) Context Module: create a new context where Condition is "Views" (select the appropriate view) and the Reaction is "Theme HTML" (add the class you want to display in the body there).

Cons: the class is not dynamic, unfortunately. Or at least I have not investigated any way to make dynamically name the class (i.e. page-[node:field_field_yourfieldvalue]). Because of this, you will most likely need to create a new context for each variation if you choose this approach.

2) jQuery: if you want to get the classes in views and add an altered version of these classes to the body tag, then you could use some javascript to pull that off. Something to the effect of this might work:

var myClasses = $(.view-name).attr('class');

$('body').addClass(myClasses);


Something like that, just cleaned up. Hope that helps :)