Remove the main content title from the front page of the site
Sometimes we have a lot of blocks from views and such on our front page, going where the content usually goes, so we don't want our front page to be the /node stream. We could make it a View page but if all the other Views are blocks, it seems wrong to play favorites (and may be annoying for theming or changing things later). Plus, it's nice to have that one node for the little bit of (easily editable) static content.
Here's the function for "example" theme's template.php to remove the page title:
<?php
function example_preprocess_page(&$vars, $hook) {
// Remove title (ie a node title on a node page) when on the front page
if ($vars['is_front']) {
$vars['title'] = '';
}
}
?>
Another option to allow all of our blocks with various views to be first on a page, and then a static node below them, is to make the ordering of regions in the content area more sensible.
Here is my variation of the content column in Zen's page.tpl.php:
<div id="content" class="column"><div class="section">
<?php if ($mission): ?>
<div id="mission"><?php print $mission; ?></div>
<?php endif; ?>
<?php print $breadcrumb; ?>
<?php print $messages; ?>
<?php print $help; ?>
<?php print $content_top; ?>
<?php if ($title): ?>
<h1 class="title"><?php print $title; ?></h1>
<?php endif; ?>
<?php if ($tabs): ?>
<div class="tabs"><?php print $tabs; ?></div>
<?php endif; ?>
<div id="content-area">
<?php print $content; ?>
</div>
<?php print $content_bottom; ?>
<?php if ($feed_icons): ?>
<div class="feed-icons"><?php print $feed_icons; ?></div>
<?php endif; ?>
</div></div> <!-- /.section, /#content -->
Comments
Post new comment