How can i theme my block views?
I created a block-views-[viewname].php and the full content of the view is printed with:
print $block->content;

But i like to print the title and the content sepperatly. (something like $block->title of $view->title>)
Anybody knows a solution?

Comments

hsalazar’s picture

... and you will see, for instance, that the file block.tpl.php in the Aquamarine theme has the following code:

<div class="block block-<?php print $block->module; ?>" id="block-<?php print $block->module; ?>-<?php print $block->delta; ?>">
<h2 class="title"><?php print $block->subject; ?></h2>
<div class="content"><?php print $block->content; ?></div>
</div>

This means, of course, that the variable $block->subject contains the title of your block, while $block->content holds the actual content of the block.

If what you mean is you need to disaggregate more the actual body of the block, I'd suggest you install the ConTemplate module. This will let you create templates for any content type and give you access to all variables. You don't need to actually create the templates, but you can take good note of the syntax of every variable you have access to, so you can move them around as you need.

Hope this helps.

Cheers.

dotidentity’s picture

Thanks!
Ik fixed it know, with changing the view type tot a list type.
I will give ConTemplate a try!