Closed (fixed)
Project:
Views (for Drupal 7)
Version:
7.x-3.0-alpha1
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Oct 2011 at 17:19 UTC
Updated:
15 Dec 2011 at 21:51 UTC
When I created a Block using views, this is the HTML that it generates
<div class="block block-views" id="block-views-latest-articles-block"
<h2>Latest Articles</h2>
<div class="content">
<div class="view view-latest-articles view-id-latest_articles view-display-id-block grid-5 omega view-dom-id-4">
<div class="view-content">
// Block Content comes here
</div>
</div>
</div>
</div>
I want to somehow add the CSS class that I mentioned in the view to the outer most div instead of the inner div. Is that possible?
Comments
Comment #1
dawehnerYou can use hook_preprocess_block in your theme to add something to $vars['classes_array'].
Comment #3
doublejosh commentedHere's how to add the view name among the classes with a Drupal 6 theme layer solution...
You can also just add a class via the views UI.
Comment #4
marvix commentedWould please show me from where, the only option is adding a class to the internal div, not to the main block div.
Comment #5
merlinofchaos commentedViews doesn't control or render the main block div, and it can't add classes there. It's simply not possible for the UI to add a class there, which is why the preprocess method shown here is necessary.
Comment #5.0
merlinofchaos commentedFixed Error