By ilayer on
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
To theme the block title use css,
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.
I just tried the block.tpl.php
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,
===========================================
=================================
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]
Ok, so views does not generate "normal" blocks
You could add css using 'view-content-myblogs-block' and 'th', something like
You willl of course want to add your own styling.
If you need different/additional html you would need to theme the view.
Got it. Thanks nevets.
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
Views seems to have a theme function for everything
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.
Thanks, nevets!
I would read them again..
ilayer