I'm working on a site that has some interesting challenges in layout that would be made much much easier if I could get the title on the front page and the title on node pages to get called up in the same way.
With page.tpl.php the title variable is called thus:
<?php if ($title != ""): ?>
<h2 class="content-title"><?php print $title ?></h2>
<?php endif; ?>
Some way further down, the $content
is called.
In node.tpl.php the title variable is called thus:
<?php if ($page == 0): ?>
<h2><a href="/<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>
I am assuming there must be good reasons for this, but I'm too new at the code structure (or I'm just too dense) to figure it out.
My question is this: Is there an essential reason why the title variable is called by node vs. page using mutually exclusive conditionals? Would there be potentially dire (and/or unforseen) consequences to simply call ALL $title
calls via node.tpl.php (without the conditional), and take out the $title
call in page.tpl.php altogether?
I suppose I will just give it a shot in the morning, but what I'm afraid of is that it will seem to work, only to surprise me later.
Any thoughtful reply would be greatly appreciated!