Hi there,

I have gone through the views themeing tutoerial (I use panel + view(block view)), but couldn't find the the way to customize and theme the block title.

Can someone share me some infor if possible?

I tried that views-table-.tpl.php, copying from the views wizard output(list base), but seems it doesn't work.

Thanks,
ILayer.

Comments

nevets’s picture

The block will have a unique id (block-{module}-{delta}), a class common to all blocks from a given module (block-{module}) and a class common to all blocks (block). Using the firebug extension to firefox makes these easy to find.]
Your block title html will vary depending on the theme but is oftern an h2 tag. So that is enough to theme the block title.

ilayer’s picture

Thanks nevets for the help.

I tried the HTML template file (block.tpl.php), but it seems this file doesn't invovle the block render.

I checked the source code of the page, I saw below,
===========================================

...div class="panel-col-first">
    div>
       div class='view view-myblogs-block'><div class='view-content view-content-myblogs-block'>
         table class="show-table">
            thead><tr><th class="">myblogs</th> </tr></thead>
            tbody>
               tr class="odd"><td class="view-field-node_title">...
            </tbody></table>
...

=================================
I didn't see the item of block title has been rendered.

I use view to create one block view (named "myblogs-block"), and put it with others together, in panels layout.

I read this source code, see the DIV hierarchy is panel-col-first (panel generated) --> view --> view-myblogs-block -->...., no place to hold the title item.

What did I wrong with it? no clue so far.

Thanks,
ilayer

[edited to add <code> / </code> tags, nevets]

nevets’s picture

You could add css using 'view-content-myblogs-block' and 'th', something like

.view-content-myblogs-block th {
  color: red;
}

You willl of course want to add your own styling.

If you need different/additional html you would need to theme the view.

ilayer’s picture

One more question, regarding theming the view, for example, if I want to add some extra items to the block title area, where should I put the HTML code?

theme function phptemplate_views-view-table(...) seems only focus on the table content, not the block title area.

Thanks a lot.

ilayer

nevets’s picture

But I am not an expert at it. Look at the views documentation (I also go to the download page to find the link) There is a section on theming.

ilayer’s picture

I would read them again..

ilayer