Mike - can you test something for me? I just noticed a problem with the plugin in an embedded installation and need to know if it is this particular installation, or happens with all embedded installs.
The problem is the generation of a page's head_title and head_subtitle, which many template uses as <h1> and <h2> headings. In bulletproof, these tags are generated in the banner:
Code: Select all
<h1><span class="{if $template_option.firbtitle == 'false'}in{/if}visible"><a class="homelink1" href="{$serendipityBaseURL}">{$head_title|@default:$blogTitle|truncate:80:" ..."}</a></span></h1>
<h2><span class="{if $template_option.firbdescr == 'false'}in{/if}visible"><a class="homelink2" href="{$serendipityBaseURL}">{$head_subtitle|@default:$blogDescription}</a></span></h2>
Frontpage & default condition: First line (<h1>) is blog title. Second line (<h2>) is blog description.
Detailed Entry: First line is ENTRY title. Second line is BLOG title.
The problem is seen on detailed entry pages:
The first line is the entry specific <title> element, not the entry title
The second line never changes… it is always the blog description, and never changes to the blog title like it is supposed to because that variable is blank, and the template's default kicks in: $head_subtitle|@default:$blogDescription.
In /plugins/serendipity_event_metadesc/serendipity_event_metadesc.php, on line 153, you will find this:
Code: Select all
// If we modified the <title>...
if (!empty($this->meta_title)) {
// We've messed up the banner. Put it back the way it was.
// Set smarty variables for banner back to normal "entry title - blog description"
$serendipity['smarty']->assign(
array(
'head_title' => $this->save_title,
'head_subtitle' => $this->save_subtitle
)
);
Can you change it to this, which is only adding 4 html comments to the page output:
Code: Select all
// If we modified the <title>...
if (!empty($this->meta_title)) {
// We've messed up the banner. Put it back the way it was.
// Set smarty variables for banner back to normal "entry title - blog description"
echo '<!-- save_title, which should be entry title, is: "' . $this->save_title . '" -->'. "\n";
echo '<!-- save_subtitle, which should be blog title, is: "'. $this->save_subtitle . '" -->'. "\n";
$serendipity['smarty']->assign(
array(
'head_title' => $this->save_title,
'head_subtitle' => $this->save_subtitle
)
);
echo '<!-- smarty head_title, which should be entry title, is: "' . $serendipity['head_title'] . '" -->'. "\n";
echo '<!-- smarty head_subtitle, which should be blog title is: "' . $serendipity['head_subtitle'] . '" -->'. "\n";
}
When I make this change, then view a detailed entry's source, this is unfortunately what I am seeing:
Code: Select all
<title>entry specific page title element</title>
<!-- save_title, which should be entry title, is: "HTML Meta Plugin test entry" -->
<!-- save_subtitle, which should be blog title, is: "This is the blog's title" -->
<!-- smarty head_title, which should be entry title, is: "entry specific page title element" -->
<!-- smarty head_subtitle, which should be blog title is: "" -->
In other words, the code that should restore the smarty head_title and head_subtitle does not appear to be working... the head_title is still equal to the <title> element, and the head_subtitle is blank, which is a leftover from the code at line 139:
Code: Select all
$serendipity['head_title'] = htmlspecialchars($this->meta_title);
// Clear the subtitle (many templates use it along with the title)
$serendipity['head_subtitle'] = '';
Anyway, if you can check your installation to see if it behaves the same, I would appreciate it.
If anyone has an explanation as to why, or how to fix, I would appreciate that as well!
