Hi,

I have created a view for my latest news page but the page title "Latest News" is not displaying. The same is true of the drupal contact form page, no page title.

I switched the themes and the titles came up so I'm assuming this is something to do with the way titles are being printed. On other themes print $title; is in the page.tpl.php aswell as the node.tpl.php but in this theme there is no print $title; in the page.tpl.php.

I tried amending it myself but don't really know a whole lot about php so if you could come back with a fix that would be great.

CommentFileSizeAuthor
#2 Print view titles.txt326 byteswescottgj

Comments

wescottgj’s picture

Category: feature » support

Solved!

wescottgj’s picture

StatusFileSize
new326 bytes

For anyone else that has had the same issues see attached to fix it.

wescottgj’s picture

Category: support » feature
gtsopour’s picture

Assigned: wescottgj » gtsopour
Category: support » feature
Status: Active » Closed (fixed)
Issue tags: +corporate, +Corporate Theme, +Corporate Clean Theme

Hello wescottgj,

you are absolutely right with your mention. Based on Drupal core Garland theme and on your comments, I made and committed the following changes at page.tpl.php and node.tpl.php.

page.tlp.php

Add before $tabs rendering the following code

<?php print render($title_prefix); ?>
<?php if ($title): ?>
<h1<?php print $title_attributes; ?>><?php print $title ?></h1>
<?php endif; ?>
<?php print render($title_suffix); ?>

node.tpl.php

Make the following change

From

<?php print render($title_prefix); ?>
<?php if (!$page) { ?>
<h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
<?php } else { ?>
<h1<?php print $title_attributes; ?>><?php print $title; ?></h1>
<?php } ?>
<?php print render($title_suffix); ?>

To

<?php print render($title_prefix); ?>
<?php if (!$page): ?>
<h2<?php print $title_attributes; ?>><a href="<?php print $node_url; ?>"><?php print $title; ?></a></h2>
<?php endif; ?>
<?php print render($title_suffix); ?>

These changes will be included in next CorporateClean release 7.x-1.1

Thanks
/George

gtsopour’s picture

Category: feature » bug

I changed the issue's category from feature request to bug report. Thank you for your understanding.

jenyaart’s picture

I used the #4 fix and that worked: the title are now showing on Views. However this fix created another issue.

Now the title also shows up on the Homepage even though the entire "content" region on home page is disabled via Context module.

George, any chance you can make the title go away when it's not needed? =)

Thank you for the fix btw!

jenyaart’s picture

Just figured it out myself... smart lil me =)

Here is the updated code to put in page.tpl.php

            <!-- fix for the missing titles is Views -->
            <?php print render($title_prefix); ?>
			<?php if (!$is_front && !empty($title)): ?> <!-- checking if home page skip title-->
			<h1<?php print $title_attributes; ?>><?php print $title ?></h1>
			<?php endif; ?>
			<?php print render($title_suffix); ?>
            <!--end fix -->