You are here

README.txt in Block Attributes 7

BLOCK ATTRIBUTES
----------------

CONTENTS OF THIS FILE
---------------------

 * Introduction
 * Features
 * Implementation
 * Integration (with other modules)
 * Installation and configuration
 * Useful Resources
 * Troubleshooting (known Theme issues)
 * Developers: Extending the module
 * Future developments
 * Contributions are welcome!!
 * Credits / Contact
 * Link references


INTRODUCTION
------------

The Block Attributes module allows users to specify additional HTML attributes
for blocks, through the block's configuration interface, such as class, id,
style, title and more.

Following up with a couple of related requests in the Block Class module:
 * Add ability to set a block's CSS ID [39]
 * Block attributes? [40]

It appeared the ability for users to configure Blocks' HTML ID, classes or
custom styles has been a recurring request (for quite some time).
Therefore, this module attempts to provide a solution for these cases and
support more HTML attributes for blocks.

Since this module is entirely based on the template variables defined in
block.tpl.php (Drupal 7, or your theme block template's variables), make sure
you take a closer look at the Implementation and Troubleshooting paragraphs
below to learn more about known theme compatibility issues.

For developers and themers, it is entirely possible to extend currently
supported attributes or template variables, see paragraph below "Developers:
Extending the module".


FEATURES
--------

First, a few concrete use cases for which this module will certainly come in
handy:
 * Give a block a specific HTML ID so it can be easily selected using jQuery or
   CSS (Watch out: an HTML ID is supposed to be unique on a page).
 * Add additional classes or specific styles to a block or its title.
 * Give a block or its title a particular text alignment.
 * Add a specific keyboard shortcut for a block on a page.

Block Attributes can be configured globally through an admin settings form [1],
allowing users to define which attributes should be enabled or disabled on each
block's configuration form and their default values for new core blocks [2]
creation (see screenshot of the Block Attributes admin configuration
form [1]).

The module currently supports and allows users to set for each block the
following attributes (per block settings):
 * Accesskey
 * Align
 * Id
 * Class
 * Style
 * Title
Not yet suported: dir, lang, tabindex (see API document[3]).

Through Block Attributes' API [3], developers have the flexibility to add any
number of custom attributes, parameters or properties that could be implemented
at the theme level (displaying custom template variables configurable through
blocks' configuration forms, so possibilities are endless, see section
"Developers: Extending the module").


IMPLEMENTATION
--------------

Basically, this module is a code mix between the Menu attributes [4] and Block
Class [5] modules, based on the possibilities offered by Drupal block's theme
structure [6] and supported HTML attributes (see "Future developments" for
Drupal 8 and new template or HTML standards).

As more theme variables appeared in Drupal 7's Block template [7] (such as HTML
ID, see Core issues #569362, #306358, other themes issues #1422958 or GDO's
Addition of an attributes array [8] and probably many more discussions/issues),
it appeared more and more theming parameters could potentially be configured
through the interface for more advanced themers' needs.

Currently, the module operates on the following block theme variables (D7) [9]:
(Block scopes/sections in parenthesis)
 * Block HTML ID: $block_html_id (Block level attribute).
 * Block CSS classes: $classes (Block level attribute).
 * Block's other HTML attributes: $attributes (Block level attributes).
 * Block title attributes: $title_attributes (Block title attributes).
 * Block content attributes: $content_attributes (Block content attributes).

Most of the work had to be done around the database storage, greatly inspired
from Block Class' 7.x-2.x branch [10], creating a new database field where all
the parameters could be saved in a serialized array (since there are multiple
attributes to be saved), very much the same way it is done by Menu Attributes in
the database's 'menu_links.options' field.

Other than changing the orientation of concept towards blocks, overall, module's
API, permissions, admin form (with JS vertical tabs), HTML attributes,
SimpleTests, Scopes/Groups, Panels integration, etc... had all to be slightly
adapted to match closer with Block's theme variables, but in general, most of
Menu attributes [4] and Block Class [5] features could cross-over very nicely
with a great amount of similarities (Some parts could even be re-used almost
exactly "as is", such as for the admin form or the vertical tabs'
block_attributes.js).


INTEGRATION (WITH OTHER MODULES)
--------------------------------

For any issues related with the Theme, please check the "Troubleshooting"
paragraph below.
Otherwise, module should integrate properly with other modules for more advanced
setups, such as Display Suite [11]'s block fields, Panels [12] blocks, Context
[13] or Features [14] with Features Extra [15]'s FE Block.

An example of a more advanced setup and integration usage could be displaying a
custom block with custom HTML attributes, through a custom context all of that
imported from code through a custom feature. Since block attributes are defined
as a new field, FE Block makes it possible to export all of blocks' HTML
attributes to code files, making the deployment process easier.

For debugging compatibility issues, it is highly recommended to test a problem
first on a supported theme such as Bartik [16], to ensure it is not a theme
related issue (see "Troubleshooting" below).
To report a compatibility issue, please create a new ticket in the bug tracker
with the component "Compatibility".


INSTALLATION AND CONFIGURATION
------------------------------

0 - Prerequisites:
Requires the Core Block module to be enabled (see Core modules [17]).

1 - Download the module and copy it into your contributed modules folder:
[for example, your_drupal_path/sites/all/modules] and enable it
from the modules administration/management page (requires the block module to be
enabled).
More information at: Installing contributed modules (Drupal 7) [18].

2 - Configuration:
After successful installation, browse to the Block configuration page, for the
specific block to be customized and directly start configuring block's HTML
attributes (See screenshot [19]).
For example, for the 'Powered by Drupal' block configuration page:
The path would be: admin/structure/block/manage/system/powered-by/configure
and breadcrumb: Home » Administration » Structure » Blocks

3 - Global Configuration (optional):
To define default values for newly created blocks' attributes or enable/disable
certain ones, browse to the Block Attributes settings form page, either by using
the "Configure" link (next to module's name on the modules listing page), or
page's menu link displayed as a tab on the block admin listing page (See
screenshot [1]).
Path: /admin/structure/block/attributes
Home » Administration » Structure » Blocks


USEFUL RESOURCES
----------------

Whether developer, site builder or themer, you may be able to find more
information on blocks' theme structure or attributes in the following links:
 * W3C's index of the HTML 4 Attributes [20] and HTML 5 Global Attributes [21].
 * Drupal Core Block's documentation: Working with blocks (content in regions)
   [2].
 * Block Attributes API [3] and README.TXT [22] files.
 * [Theming]Working with preprocess and process functions: Setting up variables
   for use in a template [23] and HTML attributes and classes generated through
   theme variables [24].
 * Drupal's Block template file: block.tpl.php (D7) [25] and block.html.twig
   (D8) [26]
 * Drupal 7 API's block.module [27] and block.tpl.php [9]
 * Drupal 8 API's block.module [28] and block.html.twig [29]

Any suggestions of additional resources that would be useful to the community
would be warmly welcome and greatly appreciated.
Feel free to add your suggestions by creating a new ticket in the bug tracker
with the component "Documentation" or re-opening the issue #2461335 with your
comment.


TROUBLESHOOTING (KNOWN THEME ISSUES)
------------------------------------

Probably one of the most common issues is related with blocks' configuration
results not being reflected for a given theme, in other words:
The configuration for a block has been saved properly but the configured
attributes are not displaying in the active theme.

To try narrowing down theme issues, a few simple things could be attempted
first, such as flushing browser's and website's caches, checking in the HTML
code for the presence of configured block's HTML attributes or ensuring block's
theme file is not overridden.

Since the module currently operates on the Core block theme variables [9]
$block_html_id, $classes, $attributes, $title_attributes, $content_attributes
(see "Implementation" above), if any of these variables were missing from your
theme's block.tpl.php file, it is very likely some configurations of scopes or
attributes might be dysfunctional.
Therefore, it is highly recommended to use a theme whose block template at least
supports these theme variables.
For example, Zen [30] theme's block.tpl.php [31] doesn't output the
$content_attributes variable, which is why none of the configurations under
Block Content Attributes could be displayed without modifying template's code
(similar issue for the Bootstrap [32] theme and probably many more).

In any case, to report any theme related issue, please create a new ticket in
the bug tracker with the component "Theme".

If any problems arise from using advanced setups, such as blocks displayed
through Panels, DS, Context, FE Block exports, etc... please refer to the
section above named "Integration". For troubleshooting/debugging module
compatibility issues, please test the problem first on a supported theme such as
Bartik [16] (that's been tested and for which we are certain the module works,
eliminating the possibility of being a theme issue).


DEVELOPERS: EXTENDING THE MODULE
--------------------------------

As mentioned above, it is possible to add any custom attribute, restricted or
not to a section of a block (block, title, content) by leveraging module's API
[3].

For example, by implementing a hook_block_attribute_info, a new drop-down select
could be added in the Block Attributes fieldset for every block's configuration
form, allowing users to select some custom values through the interface. The
values could then be retrieved at any point (with a block_load) [33], by
accessing the options property: $block->options['attribute_example']. The value
could then be output through a custom theme variable, added with a
[THEME]_preprocess_block function in the active theme folder's template.php file
(for more information see template_preprocess_block [34],
block_attributes_preprocess_block [35] and "[Theming]Working with preprocess and
process functions" in the "Useful Resources"). Lastly, the theme variable would
have to be printed in the HTML markup of the active template's block.tpl.php.

Comments, discussions, examples, cases, issues or patches related with
implementations of module's API hooks would be highly welcome and greatly
appreciated.


FUTURE DEVELOPMENTS
-------------------

Module is subject to changes and restrictions from the W3C and HTML Standards
(see W3C's links to HTML 4 and 5 attributes in the "Useful Resources").

Among some of the features that could probably be supported but haven't been
tested/developed yet, adding more properties, such as the dir, lang, title
attributes or suffix/prefix (as needed) and further extending attributes in
general. Additionally, allowing users to enable/disable certain scopes/groups,
could also be an interesting feature since it appears numerous contributed
themes made the choice to ignore certain theme variables (see
"Troubleshooting"'s Zen example).

Drupal 8's version would most likely require a major rework to support HTML5's
attributes, markup and the new theme structure [26]. The updating process from
D7 to D8 (if there is ever any, other than manual, especially due to theme and
HTML standards changes), might require some work as well, not to mention
extensive testing.

Down the road, perhaps, this module could be merged into a global module
(drupal_attributes or entity_attributes) that could hold all attributes related
modules for node, menu, block, user, etc... especially with D8's new
object/entity oriented approach .

Lastly, efforts could be made and hopefully sustained on the overall
maintenance, with improved documentation, tutorials/presentations of how
module's features could be leveraged or extended, module's translations [36],
more simpletests (Automated Test Cases) and of course the usual bug fixes.


CONTRIBUTIONS ARE WELCOME!!
---------------------------

Feel free to follow up in the issue queue [37] for any contributions, bug
reports, feature requests.
Tests, feedback or comments in general are highly appreciated.


CREDITS / CONTACT
-----------------

We are particularly grateful to the Drupal community behind the Menu attributes
[4] and Block Class [5] modules, their authors and all their contributors for
their great work from which this module was greatly inspired and without which
it would perhaps be far from having the number of supported features it has
today.
Hopefully, new features, patches or tests added to this module might as well be
ported/adapted to be contributed and shared back in return.

Currently maintained by David Suissa (DYdave) [38]; all initial development,
documentation and testing by David Suissa.

This module was sponsored by:
DAVYIN [http://www.davyin.com/] | 上海戴文 [http://www.davyin.cn/].


LINK REFERENCES
---------------

1: https://www.drupal.org/files/project-images/block_attributes-global-admin-con
fig-form2-text.jpg
2: https://www.drupal.org/documentation/modules/block
3: http://drupalcode.org/block_attributes/tree/block_attributes.api.php
4: https://www.drupal.org/project/menu_attributes
5: https://www.drupal.org/project/block_class
6: http://drupalcode.org/drupal/tree/modules/block/block.tpl.php?h=7.x
7: https://www.drupal.org/update/themes/6/7
8: https://groups.drupal.org/node/19929
9: https://api.drupal.org/api/drupal/modules!block!block.tpl.php/7
10: https://www.drupal.org/node/1936358
11: https://www.drupal.org/project/ds
12: https://www.drupal.org/project/panels
13: https://www.drupal.org/project/context
14: https://www.drupal.org/project/features
15: https://www.drupal.org/project/features_extra
16: https://www.drupal.org/documentation/themes/bartik
17: https://www.drupal.org/node/1283408
18: http://drupal.org/documentation/install/modules-themes/modules-7
19: https://www.drupal.org/files/project-images/block_attributes-poweredby-block
-config-form4-text.jpg
20: http://www.w3.org/TR/html4/index/attributes.html
21: http://www.w3.org/TR/html-markup/global-attributes.html
22: http://drupalcode.org/block_attributes/tree/README.txt
23: https://www.drupal.org/node/223430
24: https://www.drupal.org/node/254940#html-class-variable
25: http://drupalcode.org/drupal/tree/modules/block/block.tpl.php?h=7.x
26:
http://drupalcode.org/drupal/tree/core/modules/block/templates/block.html.twig
27: https://api.drupal.org/api/drupal/modules%21block%21block.module/7
28: https://api.drupal.org/api/drupal/core%21modules%21block%21block.module/8
29: https://api.drupal.org/api/drupal/core%21modules%21block%21templates%21block
.html.twig/8
30: https://www.drupal.org/project/zen
31: http://drupalcode.org/zen/tree/templates/block.tpl.php
32: http://drupalcode.org/bootstrap/tree/templates/block/block.tpl.php
33: https://api.drupal.org/api/drupal/modules%21block%21block.module/function/bl
ock_load/7
34: https://api.drupal.org/api/drupal/modules%21block%21block.module/function/te
mplate_preprocess_block/7
35: http://drupalcode.org/block_attributes/tree/block_attributes.module#n65
36: https://localize.drupal.org/translate/projects/block_attributes
37: https://www.drupal.org/project/issues/block_attributes
38: https://www.drupal.org/u/dydave
39: https://www.drupal.org/node/863554
40: https://www.drupal.org/node/2211703

File

README.txt
View source
  1. BLOCK ATTRIBUTES
  2. ----------------
  3. CONTENTS OF THIS FILE
  4. ---------------------
  5. * Introduction
  6. * Features
  7. * Implementation
  8. * Integration (with other modules)
  9. * Installation and configuration
  10. * Useful Resources
  11. * Troubleshooting (known Theme issues)
  12. * Developers: Extending the module
  13. * Future developments
  14. * Contributions are welcome!!
  15. * Credits / Contact
  16. * Link references
  17. INTRODUCTION
  18. ------------
  19. The Block Attributes module allows users to specify additional HTML attributes
  20. for blocks, through the block's configuration interface, such as class, id,
  21. style, title and more.
  22. Following up with a couple of related requests in the Block Class module:
  23. * Add ability to set a block's CSS ID [39]
  24. * Block attributes? [40]
  25. It appeared the ability for users to configure Blocks' HTML ID, classes or
  26. custom styles has been a recurring request (for quite some time).
  27. Therefore, this module attempts to provide a solution for these cases and
  28. support more HTML attributes for blocks.
  29. Since this module is entirely based on the template variables defined in
  30. block.tpl.php (Drupal 7, or your theme block template's variables), make sure
  31. you take a closer look at the Implementation and Troubleshooting paragraphs
  32. below to learn more about known theme compatibility issues.
  33. For developers and themers, it is entirely possible to extend currently
  34. supported attributes or template variables, see paragraph below "Developers:
  35. Extending the module".
  36. FEATURES
  37. --------
  38. First, a few concrete use cases for which this module will certainly come in
  39. handy:
  40. * Give a block a specific HTML ID so it can be easily selected using jQuery or
  41. CSS (Watch out: an HTML ID is supposed to be unique on a page).
  42. * Add additional classes or specific styles to a block or its title.
  43. * Give a block or its title a particular text alignment.
  44. * Add a specific keyboard shortcut for a block on a page.
  45. Block Attributes can be configured globally through an admin settings form [1],
  46. allowing users to define which attributes should be enabled or disabled on each
  47. block's configuration form and their default values for new core blocks [2]
  48. creation (see screenshot of the Block Attributes admin configuration
  49. form [1]).
  50. The module currently supports and allows users to set for each block the
  51. following attributes (per block settings):
  52. * Accesskey
  53. * Align
  54. * Id
  55. * Class
  56. * Style
  57. * Title
  58. Not yet suported: dir, lang, tabindex (see API document[3]).
  59. Through Block Attributes' API [3], developers have the flexibility to add any
  60. number of custom attributes, parameters or properties that could be implemented
  61. at the theme level (displaying custom template variables configurable through
  62. blocks' configuration forms, so possibilities are endless, see section
  63. "Developers: Extending the module").
  64. IMPLEMENTATION
  65. --------------
  66. Basically, this module is a code mix between the Menu attributes [4] and Block
  67. Class [5] modules, based on the possibilities offered by Drupal block's theme
  68. structure [6] and supported HTML attributes (see "Future developments" for
  69. Drupal 8 and new template or HTML standards).
  70. As more theme variables appeared in Drupal 7's Block template [7] (such as HTML
  71. ID, see Core issues #569362, #306358, other themes issues #1422958 or GDO's
  72. Addition of an attributes array [8] and probably many more discussions/issues),
  73. it appeared more and more theming parameters could potentially be configured
  74. through the interface for more advanced themers' needs.
  75. Currently, the module operates on the following block theme variables (D7) [9]:
  76. (Block scopes/sections in parenthesis)
  77. * Block HTML ID: $block_html_id (Block level attribute).
  78. * Block CSS classes: $classes (Block level attribute).
  79. * Block's other HTML attributes: $attributes (Block level attributes).
  80. * Block title attributes: $title_attributes (Block title attributes).
  81. * Block content attributes: $content_attributes (Block content attributes).
  82. Most of the work had to be done around the database storage, greatly inspired
  83. from Block Class' 7.x-2.x branch [10], creating a new database field where all
  84. the parameters could be saved in a serialized array (since there are multiple
  85. attributes to be saved), very much the same way it is done by Menu Attributes in
  86. the database's 'menu_links.options' field.
  87. Other than changing the orientation of concept towards blocks, overall, module's
  88. API, permissions, admin form (with JS vertical tabs), HTML attributes,
  89. SimpleTests, Scopes/Groups, Panels integration, etc... had all to be slightly
  90. adapted to match closer with Block's theme variables, but in general, most of
  91. Menu attributes [4] and Block Class [5] features could cross-over very nicely
  92. with a great amount of similarities (Some parts could even be re-used almost
  93. exactly "as is", such as for the admin form or the vertical tabs'
  94. block_attributes.js).
  95. INTEGRATION (WITH OTHER MODULES)
  96. --------------------------------
  97. For any issues related with the Theme, please check the "Troubleshooting"
  98. paragraph below.
  99. Otherwise, module should integrate properly with other modules for more advanced
  100. setups, such as Display Suite [11]'s block fields, Panels [12] blocks, Context
  101. [13] or Features [14] with Features Extra [15]'s FE Block.
  102. An example of a more advanced setup and integration usage could be displaying a
  103. custom block with custom HTML attributes, through a custom context all of that
  104. imported from code through a custom feature. Since block attributes are defined
  105. as a new field, FE Block makes it possible to export all of blocks' HTML
  106. attributes to code files, making the deployment process easier.
  107. For debugging compatibility issues, it is highly recommended to test a problem
  108. first on a supported theme such as Bartik [16], to ensure it is not a theme
  109. related issue (see "Troubleshooting" below).
  110. To report a compatibility issue, please create a new ticket in the bug tracker
  111. with the component "Compatibility".
  112. INSTALLATION AND CONFIGURATION
  113. ------------------------------
  114. 0 - Prerequisites:
  115. Requires the Core Block module to be enabled (see Core modules [17]).
  116. 1 - Download the module and copy it into your contributed modules folder:
  117. [for example, your_drupal_path/sites/all/modules] and enable it
  118. from the modules administration/management page (requires the block module to be
  119. enabled).
  120. More information at: Installing contributed modules (Drupal 7) [18].
  121. 2 - Configuration:
  122. After successful installation, browse to the Block configuration page, for the
  123. specific block to be customized and directly start configuring block's HTML
  124. attributes (See screenshot [19]).
  125. For example, for the 'Powered by Drupal' block configuration page:
  126. The path would be: admin/structure/block/manage/system/powered-by/configure
  127. and breadcrumb: Home » Administration » Structure » Blocks
  128. 3 - Global Configuration (optional):
  129. To define default values for newly created blocks' attributes or enable/disable
  130. certain ones, browse to the Block Attributes settings form page, either by using
  131. the "Configure" link (next to module's name on the modules listing page), or
  132. page's menu link displayed as a tab on the block admin listing page (See
  133. screenshot [1]).
  134. Path: /admin/structure/block/attributes
  135. Home » Administration » Structure » Blocks
  136. USEFUL RESOURCES
  137. ----------------
  138. Whether developer, site builder or themer, you may be able to find more
  139. information on blocks' theme structure or attributes in the following links:
  140. * W3C's index of the HTML 4 Attributes [20] and HTML 5 Global Attributes [21].
  141. * Drupal Core Block's documentation: Working with blocks (content in regions)
  142. [2].
  143. * Block Attributes API [3] and README.TXT [22] files.
  144. * [Theming]Working with preprocess and process functions: Setting up variables
  145. for use in a template [23] and HTML attributes and classes generated through
  146. theme variables [24].
  147. * Drupal's Block template file: block.tpl.php (D7) [25] and block.html.twig
  148. (D8) [26]
  149. * Drupal 7 API's block.module [27] and block.tpl.php [9]
  150. * Drupal 8 API's block.module [28] and block.html.twig [29]
  151. Any suggestions of additional resources that would be useful to the community
  152. would be warmly welcome and greatly appreciated.
  153. Feel free to add your suggestions by creating a new ticket in the bug tracker
  154. with the component "Documentation" or re-opening the issue #2461335 with your
  155. comment.
  156. TROUBLESHOOTING (KNOWN THEME ISSUES)
  157. ------------------------------------
  158. Probably one of the most common issues is related with blocks' configuration
  159. results not being reflected for a given theme, in other words:
  160. The configuration for a block has been saved properly but the configured
  161. attributes are not displaying in the active theme.
  162. To try narrowing down theme issues, a few simple things could be attempted
  163. first, such as flushing browser's and website's caches, checking in the HTML
  164. code for the presence of configured block's HTML attributes or ensuring block's
  165. theme file is not overridden.
  166. Since the module currently operates on the Core block theme variables [9]
  167. $block_html_id, $classes, $attributes, $title_attributes, $content_attributes
  168. (see "Implementation" above), if any of these variables were missing from your
  169. theme's block.tpl.php file, it is very likely some configurations of scopes or
  170. attributes might be dysfunctional.
  171. Therefore, it is highly recommended to use a theme whose block template at least
  172. supports these theme variables.
  173. For example, Zen [30] theme's block.tpl.php [31] doesn't output the
  174. $content_attributes variable, which is why none of the configurations under
  175. Block Content Attributes could be displayed without modifying template's code
  176. (similar issue for the Bootstrap [32] theme and probably many more).
  177. In any case, to report any theme related issue, please create a new ticket in
  178. the bug tracker with the component "Theme".
  179. If any problems arise from using advanced setups, such as blocks displayed
  180. through Panels, DS, Context, FE Block exports, etc... please refer to the
  181. section above named "Integration". For troubleshooting/debugging module
  182. compatibility issues, please test the problem first on a supported theme such as
  183. Bartik [16] (that's been tested and for which we are certain the module works,
  184. eliminating the possibility of being a theme issue).
  185. DEVELOPERS: EXTENDING THE MODULE
  186. --------------------------------
  187. As mentioned above, it is possible to add any custom attribute, restricted or
  188. not to a section of a block (block, title, content) by leveraging module's API
  189. [3].
  190. For example, by implementing a hook_block_attribute_info, a new drop-down select
  191. could be added in the Block Attributes fieldset for every block's configuration
  192. form, allowing users to select some custom values through the interface. The
  193. values could then be retrieved at any point (with a block_load) [33], by
  194. accessing the options property: $block->options['attribute_example']. The value
  195. could then be output through a custom theme variable, added with a
  196. [THEME]_preprocess_block function in the active theme folder's template.php file
  197. (for more information see template_preprocess_block [34],
  198. block_attributes_preprocess_block [35] and "[Theming]Working with preprocess and
  199. process functions" in the "Useful Resources"). Lastly, the theme variable would
  200. have to be printed in the HTML markup of the active template's block.tpl.php.
  201. Comments, discussions, examples, cases, issues or patches related with
  202. implementations of module's API hooks would be highly welcome and greatly
  203. appreciated.
  204. FUTURE DEVELOPMENTS
  205. -------------------
  206. Module is subject to changes and restrictions from the W3C and HTML Standards
  207. (see W3C's links to HTML 4 and 5 attributes in the "Useful Resources").
  208. Among some of the features that could probably be supported but haven't been
  209. tested/developed yet, adding more properties, such as the dir, lang, title
  210. attributes or suffix/prefix (as needed) and further extending attributes in
  211. general. Additionally, allowing users to enable/disable certain scopes/groups,
  212. could also be an interesting feature since it appears numerous contributed
  213. themes made the choice to ignore certain theme variables (see
  214. "Troubleshooting"'s Zen example).
  215. Drupal 8's version would most likely require a major rework to support HTML5's
  216. attributes, markup and the new theme structure [26]. The updating process from
  217. D7 to D8 (if there is ever any, other than manual, especially due to theme and
  218. HTML standards changes), might require some work as well, not to mention
  219. extensive testing.
  220. Down the road, perhaps, this module could be merged into a global module
  221. (drupal_attributes or entity_attributes) that could hold all attributes related
  222. modules for node, menu, block, user, etc... especially with D8's new
  223. object/entity oriented approach .
  224. Lastly, efforts could be made and hopefully sustained on the overall
  225. maintenance, with improved documentation, tutorials/presentations of how
  226. module's features could be leveraged or extended, module's translations [36],
  227. more simpletests (Automated Test Cases) and of course the usual bug fixes.
  228. CONTRIBUTIONS ARE WELCOME!!
  229. ---------------------------
  230. Feel free to follow up in the issue queue [37] for any contributions, bug
  231. reports, feature requests.
  232. Tests, feedback or comments in general are highly appreciated.
  233. CREDITS / CONTACT
  234. -----------------
  235. We are particularly grateful to the Drupal community behind the Menu attributes
  236. [4] and Block Class [5] modules, their authors and all their contributors for
  237. their great work from which this module was greatly inspired and without which
  238. it would perhaps be far from having the number of supported features it has
  239. today.
  240. Hopefully, new features, patches or tests added to this module might as well be
  241. ported/adapted to be contributed and shared back in return.
  242. Currently maintained by David Suissa (DYdave) [38]; all initial development,
  243. documentation and testing by David Suissa.
  244. This module was sponsored by:
  245. DAVYIN [http://www.davyin.com/] | 上海戴文 [http://www.davyin.cn/].
  246. LINK REFERENCES
  247. ---------------
  248. 1: https://www.drupal.org/files/project-images/block_attributes-global-admin-con
  249. fig-form2-text.jpg
  250. 2: https://www.drupal.org/documentation/modules/block
  251. 3: http://drupalcode.org/block_attributes/tree/block_attributes.api.php
  252. 4: https://www.drupal.org/project/menu_attributes
  253. 5: https://www.drupal.org/project/block_class
  254. 6: http://drupalcode.org/drupal/tree/modules/block/block.tpl.php?h=7.x
  255. 7: https://www.drupal.org/update/themes/6/7
  256. 8: https://groups.drupal.org/node/19929
  257. 9: https://api.drupal.org/api/drupal/modules!block!block.tpl.php/7
  258. 10: https://www.drupal.org/node/1936358
  259. 11: https://www.drupal.org/project/ds
  260. 12: https://www.drupal.org/project/panels
  261. 13: https://www.drupal.org/project/context
  262. 14: https://www.drupal.org/project/features
  263. 15: https://www.drupal.org/project/features_extra
  264. 16: https://www.drupal.org/documentation/themes/bartik
  265. 17: https://www.drupal.org/node/1283408
  266. 18: http://drupal.org/documentation/install/modules-themes/modules-7
  267. 19: https://www.drupal.org/files/project-images/block_attributes-poweredby-block
  268. -config-form4-text.jpg
  269. 20: http://www.w3.org/TR/html4/index/attributes.html
  270. 21: http://www.w3.org/TR/html-markup/global-attributes.html
  271. 22: http://drupalcode.org/block_attributes/tree/README.txt
  272. 23: https://www.drupal.org/node/223430
  273. 24: https://www.drupal.org/node/254940#html-class-variable
  274. 25: http://drupalcode.org/drupal/tree/modules/block/block.tpl.php?h=7.x
  275. 26:
  276. http://drupalcode.org/drupal/tree/core/modules/block/templates/block.html.twig
  277. 27: https://api.drupal.org/api/drupal/modules%21block%21block.module/7
  278. 28: https://api.drupal.org/api/drupal/core%21modules%21block%21block.module/8
  279. 29: https://api.drupal.org/api/drupal/core%21modules%21block%21templates%21block
  280. .html.twig/8
  281. 30: https://www.drupal.org/project/zen
  282. 31: http://drupalcode.org/zen/tree/templates/block.tpl.php
  283. 32: http://drupalcode.org/bootstrap/tree/templates/block/block.tpl.php
  284. 33: https://api.drupal.org/api/drupal/modules%21block%21block.module/function/bl
  285. ock_load/7
  286. 34: https://api.drupal.org/api/drupal/modules%21block%21block.module/function/te
  287. mplate_preprocess_block/7
  288. 35: http://drupalcode.org/block_attributes/tree/block_attributes.module#n65
  289. 36: https://localize.drupal.org/translate/projects/block_attributes
  290. 37: https://www.drupal.org/project/issues/block_attributes
  291. 38: https://www.drupal.org/u/dydave
  292. 39: https://www.drupal.org/node/863554
  293. 40: https://www.drupal.org/node/2211703