Active
Project:
Views (for Drupal 7)
Version:
7.x-3.x-dev
Component:
block displays
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
8 Jun 2011 at 18:45 UTC
Updated:
24 Dec 2011 at 13:17 UTC
I am running into some situations where it would be nice for me to have a "CSS Class" option under the "Block Settings" section just like we have under the "Other" section. However, this class would be applied to the block div that contains the block id.
<div id="block-views-webad-conferences-block-1" class="block block-views contextual-links-region">
<div id="block-views-webad-conferences-block-1" class="block block-views contextual-links-region my-new-class">
In the After code you will notice the last class "my-new-class" this will be the class that would get added from the "Block Settings" section of the block display.
Hope this is clearly stated. Thanks in advance!
Comments
Comment #1
merlinofchaos commentedWhile this would be handy, it's kind of tough to actually do, since that's block.tpl.php and not actually controlled by Views.
Comment #2
dawehnerIn fact views could implement hook_preprocess_block and add the classes
Comment #3
merlinofchaos commentedThe difficulty there is that the view is destroyed by the time the block template runs. It would have to fetch the data some other way.
Comment #4
Steven Brown commentedUnfortunately I don't know the flow of events that occur in Drupal enough to make a suggestion. Would it be more effort than what it's worth to you Merlin? Its not like we can't live w/o it :) Just a nicety to have.
Comment #5
merlinofchaos commentedTo me? Probably yes. To someone else willing to write the patch? Hey if it can be written nicely I'd be willing to commit it.
Comment #6
dawehnerI'm wondering whether this setting should be an extra item in the ui, or be part of the existing css classes item?