Can't find anything about this anywhere else:
Using PHP Template, when the page title and node title are the same (i.e., when viewing a specific node), you will end up with a duplicate title on the page. This can be seen here:
http://www.scottforcongress.com/new/?q=node/view/38
Obviously, that's not acceptable. ;) Unfortunately, page_title isn't passed through to the node template, so there's no way to check for duplication in order to omit the node title. I should be able to do this in node.tpl.php, but page_title isn't passed so there's no way to check it:
<?php if ($page_title != $title): print $title
endif;
?]
This is causing some real ugly display on some pretty high profile sites (see the one above), so a quick fix of some kind would be GREATLY appreciated.
Comments
Comment #1
seanrThis site has gone live _with the bug still occuring_. The live URL is here:
http://www.scottforcongress.com/?q=node/view/38
Comment #2
seanrFixed this by changing the title code to the following in node.tpl.php
if ((arg(0) == "node") && (arg(1) == "view")) { } else {if ($node->type != "page"):if ($page == 0):print $node_url " title="print $title">endif;print $titleendif;}Comment #3
seanrEr, let's try that again:
if ($node->type != "page"):if ($page == 0):print $node_url " title="print $title">endif;print $titleendif;}?]
Comment #4
sgwealti commentedI'm having this problem too. Did it ever get fixed? I'm using Drupal 4.6.2 and the newest PHPtemplate theme engine with the Bluemarine theme.
Comment #5
mr700 commentedDoes the following code solve the problem for you as it does for me?
Maybe the check should simply be
if (!$page), but I have to try it /I first 'debugged' it and then red the docs.../.Comment #6
Moniek Paalvast commentedHi mr700,
if ($page == '') and if (!$page) both solved the problem for me.
THX
Comment #7
morbus iffPHPTemplate is part of core in 4.7. Moving.
Comment #8
gregglesWhere does that set of lines go?
I'll make a patch if someone can point me in the right direction.
Comment #9
wulff commentedThis was fixed in revision 1.2 of node.tpl.php.
Comment #10
(not verified) commented