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! :)

CommentFileSizeAuthor
#2 page_title.module_2.patch326 bytesniklp

Comments

niklp’s picture

Further 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.

niklp’s picture

Assigned: Unassigned » niklp
Status: Active » Needs review
StatusFileSize
new326 bytes

Ok 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!

johnalbin’s picture

Status: Needs review » Postponed (maintainer needs more info)

Can’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 &lt;title> tag which would be displayed like this Explaining the <title> tag.

niklp’s picture

My 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.

nicholasthompson’s picture

Status: Postponed (maintainer needs more info) » Fixed

Nik - 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.

niklp’s picture

I'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.

johnalbin’s picture

Nik, 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_title variable (except for the changes page_title module asked you to do).

niklp’s picture

I'm crap. I wasn't running the latest "release". I'll nudge Nick to try and commit a 1.0.

Anonymous’s picture

Status: Fixed » Closed (fixed)