Take the 2-minute tour ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I Copied the file

bootstrap\theme\system\block.tpl.php

to my subtheme

bootstrap_subtheme\templates\block.tpl.php

I made another 2 copies and renamed them to

bootstrap_subtheme\templates\block--sidebar-first.tpl.php
bootstrap_subtheme\templates\block--sidebar_first.tpl.php

In the subtheme.info file it says regions[sidebar_first] = 'Primary'

The block.tpl override works but the sidebar-first.tpl.php does not get overridden.

What am I doing wrong?

share|improve this question
    
I have changed the underscore but it doesn't fix my issue. –  sas Feb 23 at 9:43
    
You've cleared the cache as well? –  Neograph734 Feb 23 at 9:46
add comment

1 Answer

up vote 2 down vote accepted

The name of your template block--sidebar_first.tpl.php is correct. Clear the cache to override the template. OR Put this function in template.php and clear the cache. You will get the suggested template for your block.

On suggested name replace double underscore with double dash for your tpl file, and clear the cache.

function THEMENAME_preprocess_block(&$variables) {
    print_r($variables['theme_hook_suggestions']);     
}
share|improve this answer
    
Using the returned function names. block--blockgroup-sidebar.tpl.php does not work. block--block__52.tpl.php works. Witch is a little odd to me. –  sas Feb 23 at 10:01
    
The block--blockgroup_sidebar.tpl.php doesnt work, even after clearing cache. –  sas Feb 23 at 10:41
    
can you put here all the actual name suggested by above function? –  Rupesh Feb 23 at 10:43
    
Array ( [0] => block__blockgroup-sidebar [1] => block__block [2] => block__block__52 ) Array ( [0] => block__blockgroup-sidebar [1] => block__system [2] => block__system__main_menu ) Array ( [0] => block__blockgroup-sidebar [1] => block__block [2] => block__block__53 ) –  sas Feb 23 at 10:46
    
block--blockgroup-sidebar.tpl.php is correct as you used earlier. May be some other module override this template. –  Rupesh Feb 23 at 10:51
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.