I have a view, displaying in a block, with a views-view--VIEWNAME--block-1.tpl.php:
<div class="X">
<h2>
<?php
print render($title_prefix);
if ($title): print $title; endif;
print render($title_suffix);
?>
</h2>
...some view content...
</div>
Most of the content in this template has been copied straight from the template given by theme => information => display template in the view settings.
This displays (with some whitespace differences):
<section id="block-views-VIEWNAME-block-1" class="block block-views">
<h2>BLOCK TITLE</h2>
<div class="content">
<div class="X">
<h2></h2>
</div>
</div>
...some view content...
</section>
Why is the view not displaying the view title inside the <h2>
? The title is definitely set for the view.
I've put the following code in the view template:
print print_r(array_keys(get_defined_vars()), 1);
And the result (including "title" at index 30) is:
Array
(
[0] => template_file
[1] => variables
[2] => view
[3] => view_array
[4] => theme_hook_suggestion
[5] => theme_hook_suggestions
[6] => zebra
[7] => id
[8] => directory
[9] => classes_array
[10] => attributes_array
[11] => title_attributes_array
[12] => content_attributes_array
[13] => title_prefix
[14] => title_suffix
[15] => user
[16] => db_is_active
[17] => is_admin
[18] => logged_in
[19] => is_front
[20] => rows
[21] => css_name
[22] => name
[23] => display_id
[24] => header
[25] => footer
[26] => exposed
[27] => more
[28] => feed_icon
[29] => pager
[30] => title
[31] => attachment_before
[32] => attachment_after
[33] => dom_id
[34] => classes
[35] => attributes
[36] => title_attributes
[37] => content_attributes
)