Hi there,

I have created a block with views. When I print out the theme_hook_suggestions in my preprocess_block function in template.php, I see the following options:

    [0] => block__highlighted
    [1] => block__views
    [2] => block__views__experience_list-block_1
  • When I copy my block.tpl.php file, and rename it block--highlighted.tpl.php I get the override - it works.
  • When I copy my block.tpl.php file, and rename it block--views.tpl.php I get the override - it works.
  • When I copy my block.tpl.php file, and rename it block--views--experience_list-block_1.tpl.php it doesn't override the default template, despite being a theme suggestion.

Not sure if this is user error or a problem with Views. I have tried to replicate the problem with other modules (e.g. core block module), but all suggested templates seem to be working in those cases.

Views version 7.x-3.x-dev (Feb 24th)

Many thanks for your help.

Comments

Jeff Burnz’s picture

What about hyphens, does it work with block--views--experience-list-block-1.tpl.php, or block--views--experience-list.tpl.php?

baronmunchowsen’s picture

No luck with either 'block--views--experience-list-block-1.tpl.php' or 'block--views--experience-list.tpl.php', but many thanks for your suggestions.

baronmunchowsen’s picture

I can add my own suggestion:
>> block__experiences
and create the file
>> block--experiences.tpl.php

This works, however doesn't explain the mystery of the suggested template from drupal/views...

stoomagoo’s picture

In my case, neither work (as in, neither the suggested templates, nor one I add to the list). Currently very confused.

sanjay chauhan’s picture

Hi

thanks for suggestion ,it really work on drupal 7.