Based on W3C's HTML4 standards for the HTML markup for which we would like to add attributes (DIV and H2), there seems to be a few common attributes that could be supported by the module: align, class, style, title and accesskey (although accesskey is not recommended, it still works in most modern browsers).

The accesskey could be limited to the block level scope and the class attribute should not be configurable for the content scope (see #2461265: Allow different attributes for different scopes of block's theme for more details on scopes).
Referring to Core Block's template file block.tpl.php:

  1. Block level's HTML ID is already using block's theme variable $block_html_id.
  2. Block level's classes would have to be rendered through $classes.
  3. All other block level attributes would have to be rendered through $attributes (accesskey, align, style, title).
  4. Rendering of title and content scopes attributes through $title_attributes and $content_attributes was previously handled in #2461265: Allow different attributes for different scopes of block's theme and committed at b854133.

(only 2 and 3 would require some work, 1 and 4 are already done/implemented in the module)

The addition of these attributes would provide much more theming flexibility by allowing users to customize through the interface the HTML alignment, styles, classes or ID for different sections of any block.

Please let me know if you would have any questions, objections, comments, suggestions, recommendations or concerns on any aspects of this feature, I would be glad to provide more information or explain in more details.

Any questions, feedback, testing, changes, ideas or recommendations would be highly appreciated.
Thanks to all in advance.

Comments

  • DYdave committed c23ba48 on 7.x-1.x
    Issue #2461275 by DYdave: Added five new configurable HTML attributes:...
DYdave’s picture

Status: Active » Fixed

Quick follow-up on this feature:

  • Added five new attributes to the module: accesskey, align, class, style and title (block_attributes_block_attribute_info).
  • accesskey is limited to the Block level scope and class is excluded from the Block content scope (accesskey is only visibile under the Block attributes fieldset and the CSS classes text field is not visible under the Block content attributes fieldset).
  • Modified rendering for block level attributes to leverage theme variables $classes and $attributes (block_attributes_preprocess_block).

I went ahead and committed the changes against the 7.x-1.x branch at c23ba48.

At this point, the module should allow for any block, full control through the interface over the values of the following five block theme variables:
$block_html_id, $classes, $attributes, $title_attributes, $content_attributes

I allowed myself to mark this issue as fixed for now, but feel free to re-open it, or post a new ticket, at any time if you have any further objections with this ticket or related commit c23ba48 (we would surely be happy to hear your feedback).

Please let me know if you would have any further comments, feedback, questions, issues, objections, suggestions or concerns on the commit or this feature request in general, I would be glad to provide more information or explain in more details.

Thanks in advance to everyone for your testing, reviews, feedback and comments on this issue.
Cheers!

Status: Fixed » Closed (fixed)

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