Closed (fixed)
Project:
Page Title
Version:
5.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
20 Dec 2006 at 12:06 UTC
Updated:
17 May 2007 at 13:04 UTC
Jump to comment: Most recent file
If my page title is
There's nobody here but us chickens
it renders (without the space, natch) as
There& #039;s nobody here but us chickens
This obviously doesn't look that good! :)
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | page_title.module_2.patch | 326 bytes | niklp |
Comments
Comment #1
niklp commentedFurther to this, am I assuming that this issue is across all versions, but I haven't verified this.
A cure for the problem is to modify the output of the $head_title variable in page.tpl.php. I am assuming you can't modify the one in template.php as that would screw up some rendering on the content's page title?
I have successfully changed (in v5 RC1 Garland theme) template.php as per the installation instructions, and then modified page.tpl.php thus:
From:
<title><?php print $head_title ?></title>To:
<title><?php print html_entity_decode($head_title) ?></title>I suspect that this modification might be against the principles of seperation of presentation from content, although I'm not sure how the Drupal community would regard this.
Comment #2
niklp commentedOk well, I've moved this "fix" out from the theme level and made a patch. It doesn't belong at theme level anyway, I don't think. I've just added a line to the module to properly render the output. As far as I can tell, the function that I've altered doesn't affect any other part of the way this module works; it merely controls the outputting of the text version of the page title to pass to the theme.
All I've done is wrap the title thus:
return $title;becomes:
return html_entity_decode($title);Et voila!
Comment #3
johnalbinCan’t reproduce with the latest page_title.
While editing a node, if I enter the Page Title as
testing of page's title, the resulting display of the title tag is the same:testing of page's title.In addition, your patch would break titles entered like this
Explaining the <title> tagwhich would be displayed like thisExplaining the <title> tag.Comment #4
niklp commentedMy mistake, I thought I'd closed this one. GNassar over here has provided a more elegant fix, though I have not verified whether your point, "in addition" is covered by this or not.
Comment #5
nicholasthompsonNik - I've applied the patch found here: http://drupal.org/node/124169
This seems to fix the issue you were having and JohnAlbin's suggestion of the less than entity by title> doesn't break (at least not in Drupal 5 on my test box).
Cheers.
Comment #6
niklp commentedI'm actually now thinking this might possibly be a theme related issue - I have a vague recollection that I've seen page titles working under Garland but not under Zen. I've not had time to check this out properly though.
Comment #7
johnalbinNik, look in the page.tpl.php file. The title should use this code:
<title><?php print $head_title ?></title>Also, look in the template.php and make sure it isn’t modifying the
head_titlevariable (except for the changes page_title module asked you to do).Comment #8
niklp commentedI'm crap. I wasn't running the latest "release". I'll nudge Nick to try and commit a 1.0.
Comment #9
(not verified) commented