Overriding block template file(block.tpl.php) in Drupal 7.x

2013 年 3 月 2 日4830

Posted by Rajat Bandyopadhyay on March 1, 2013 at 12:11pm

Hi, I am a novice in Drupal. Long story short, I am using Drupal 7.18 and Zen Theme 7.x-5.1 for creating a sub theme for my site. A sub-theme is also being created which is working fine till date. Now while overriding the block.tpl.php, I have copied the "block.tpl.php" file from the parent theme to my sub-theme. Now as per the instructions available over the internet, I have duplicated the block.tpl.php file and named it as : block--block-251.tpl.php, where `251` is the ID of the block in the "block" table of the site. To be more specific, the block is being built with a view. But alas, things are no way working out anyhow. Can anyone help me out by the correct nomenclature of the overridden block file please !!!

Comments

Posted by VM on March 1, 2013 at 2:06pm

did you clear the database base cache to reset the theme registry and pick up the new tpl.php file?

and make sure per: http://http://www.zjjv.com///node/1089656 that you are properly double hyphenating. based on the linked doc it would be something like : block--block--251.tpl.php

Login or register to post comments

0 0