As per the subject I am trying to theme the actual header (<h2>) area of a block that is generated by views. Specifically I want to add custom content beyond what can be done with CSS. That area is outside the scope of what can be manipulated from the views infterface (via Theme: Information). The displays header property of a view is not appropriate as it rendered from within a 'display output' template which is what I'd consider the content of the block.
I've found this page, http://drupal.org/node/104319, however regardless of the naming of my template it is never recognized (I need per block specific templates.) I've followed the conventions listed out on the page and have also pulled the delta from the blocks table in the database to no avail. Lastly I've tried to setup a preprocessor function as I've seen suggested in places ([template]_preprocess_block) but it is never recognized. I am careful to always to rerun my theme configuration when adding functions/files.
Does anyone have an idea how I can do this? Or a way to provide my own suggestions?
Comments
This is fairly easy. You need
This is fairly easy. You need to create a block.tpl.php for the block that views creates.
Create your block in views and place it where you want it.
Take a look at the html source and see what id the block is given.
An example id for a view block is: div id="block-views-news_block_view"
Go into the theme folder find the block.tpl.php file and duplicate it.
Give it the name "block-views-news_block_view.tpl.php"
Now the block in question div id="block-views-news_block_view" will reference the newly minted "block-views-news_block_view.tpl.php" file.
Test it out, it should work.
You might want to check out this module http://drupal.org/project/blocktheme
It is really easy to use. It comes with a nice video tutorial.
Thanks for the tips, but
Thanks for the tips, but there is a key point missing that created my issue. The file 'block.tpl.php' must be created in addition to the template for the specific block. Without the 'block.tpl.php' it fails to recognize the other templates.