Drupal 7 – Create block.tpl.php by Block Theme module

If you want to customize the block.tpl.php for different blocks. The Block Theme module could serve this purpose well.

1. Download and enable the module.

 

2. Go to the Block Theme configuration page and create the template name pair as follow.

 

3. Then we need to create the block--blocktheme--eureka.tpl.php. I am using the Omega theme so i copy the block.tpl.php from the Omega core to my Omega starter theme folder and rename it to block--blocktheme--eureka.tpl.php.
 

4. Customize the block--blocktheme--eureka.tpl.php. In this example, i will add a hello world greeting before the block content.

 

5. Go the your block configuration page where you could select the Block Theme.

 

6. Save the block and check it out.

 

Done =)

Reference: Drupal Module – Block Theme

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s