By takaakikato on
Hi,
I need some help about <title> in nodes except the main page.
Every node shows "Blah, blah, blah... | TheNameOfWebSite".
I would like to delete the pipe sign and the name of the website because readers complained about the part is not necessary and, in fact, cumbersome when they want to bookmark some pages.
Any help would be appreciated.
Comments
Try the Page title module:
Try the Page title module: http://drupal.org/project/page_title. I think it does what you need.
______________________
Dominik Lukes
http://www.dominiklukes.net
http://www.hermeneuticheretic.net
http://www.czechupdate.com
http://www.techwillow.com
Overkill
There's a much simpler way to do this stuff then using a contributed module.
In page.tpl.php we've got this :
<title><?php print $head_title ?></title>Where is $head_title defined ?
I'd like to know myself.
Doing a search site-wide for the string "head_title" I found nothing !!!!!????
Ok
It's in phptemplate.engine
The code that sets the $head_title is here :
$head_title = array(strip_tags(drupal_get_title()), variable_get('site_name', 'Drupal'));Then on line 206 of the same file, we have :
'head_title' => implode(' | ', $head_title),SO, the way to fix this is very simple.
STEP 1 : open the file phptemplate.engine in the editor of your choice.
STEP 2 : go to line 189 and change it to :
$head_title = array(strip_tags(drupal_get_title()));And you're done.
Great!
Thanks for your help, guys. I'll try that out.
--
Samurai Coder
And...
and if you want to avoid touching the core, either:
_phptemplate_variables()in your 'template.php'. Search for more info.sorry mooffie
Yes, that's right : phptemplate.engine is considered core, yes, even if it's in the /themes folder. Sorry about that. It's the engine of all templates! Let's not touch the engine. Do you have your mechanic card ? Neither do I. LOL...
Title first than node
This is my situation: node title | page title
How to change this to: page title | node title ??
I am trying to edit the drupal_get_title() but this doesnt do the trick.
try this
STEP 1 : open the file phptemplate.engine in the editor of your choice.
STEP 2 : go to line 189 and replace it from :
$head_title = array(strip_tags(drupal_get_title()), variable_get('site_name', 'Drupal'));to
$head_title = array(variable_get('site_name', 'Drupal'), strip_tags(drupal_get_title()));Do not do this. Do this
Do not do this.
Do this instead:
function _phptemplate_variables($hook, $vars = array()) {
if ($hook == 'page') {
$vars['head_title'] = WHATEVER_YOU_WANT_TO_DO;
}
return $vars;
}
why not str_replace?
Into page.tpl.php 've did a str_replace of $head_title ... It's less intrusive than a module -_-'
<title><?php echo str_replace('|', '»', $head_title);?></title>___________
by Tassoman
geek, net addicted user