Block Machine Name


This project is not covered by Drupal’s security advisory policy.

Block Machine Name is a small module that adds a machine name field to custom blocks (support for menu_blocks and imageblock is in the latest dev).

Purpose:
Its primary intent is to solve the problem of styling and rendering blocks that use numeric auto-increment ID's which may later not match their production values when the blocks are recreated later. Machine names can also be used to identify blocks in custom code.

Classes:
If you give your custom block a machine name such as 'my_cool_block', the block will be given a class of 'block-my-cool-block' (underscores will be converted to dashes).

Template Suggestions:
The module will also provide a template suggestion - in the above example, you could create a tpl named 'block--my-cool-block.tpl.php' (tpl files always use dashes).

Similar Modules:
Block Class will also allow you to get your own classes into a block, but these are not based on a unique ID, and no corresponding template suggestion is offered.
Features Extra also provides a machine name for blocks, but does not currently utilize the machine name for classes or template suggestions.
I have also tested running fe_blocks and Block Machine Name together - they should run together transparently just fine.

Thanks to the maintainers of Features Extra as this code is borrowed almost exclusively from their project.


Block Machine Name项目的Drush安装命令:复制到剪贴板

注:个别模块仍需开启相关子模块。
周安装量: 
1385
维护状态: 
积极维护中
开发状态: 
积极开发中

推荐版本下载:

版本下载地址发布日期发布说明翻译下载
7.x-1.0-beta1tar.gz (8.95 KB) | zip (10.11 KB)2013年4月9日发布说明简 | 繁 | 更多