Zen very helpfully adds body_classes for node types (node-type-page, node-type-story, etc.). I propose the addition of similar classes for identifying and distinguishing Views-generated pages from others. For example, one group of such classes might expose the system responsible for the page: page-source-node, page-source-views, page-source-panels, page-source-system. Another might identify the specific View: view-vid-123 or view-viewname or view-viewname-page_1. I realize Views already supplies IDs and classes on a View itself, but sometimes I want to style differently something outside the view—the page header or something—on a specific View or display. I guess we'll see what everyone else thinks. :)

Comments

mattiasj’s picture

I need exactly the same thing since some of my views-generated pages need different css than others. Is this possible already using preprocess function in body_classes?

grasmash’s picture

subscribe

Sinan Erdem’s picture

Have a look at: http://drupal.org/node/707410

Code goes into template.php file...

mattiasj’s picture

Thanks. That code will check for a menu item, but in certain cases you have views pages without menus, for example term views and for those the code won't work.

johnalbin’s picture

Status: Active » Fixed

It doesn't check for a menu link, it checks the menu router. Those are separate things.

I'm not adding new features to the 6.x-1.x branch, but you can copy that code from Zen 6.x-2.x's template.php and put it in your 6.x-1.x-based sub-theme.

mattiasj’s picture

Thanks JohnAlbin, I will try it out!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.