Description
The Site Title is always at top and the Page Heading/ID is at the top of the embedding page. This allows for nice printing in the Printer Friendly use of the Embed page rendering. In general this seems like a more correct idea, that the page includes the Page name. I know the Page name is not stored in the database, but it still seems correct to me.
Comments
The Mod
--- wiki.1.0.0.pl Thu Sep 12 10:53:14 2002
+++ wikipatch.PageHeadingOnPage.pl Wed Jan 07 00:41:30 2004
@@ -1292,29 +1292,28 @@
$title =~ s/_/ /g; # Display as spaces
}
$result .= &GetHtmlHeader("$SiteName: $title");
- return $result if ($embed);
+ if (!$embed) { #Not indented code so the patch will work with other patches.
$result .= '<div class=wikiheader>';
- if ($oldId ne '') {
- $result .= $q->h3('(' . Ts('redirected from %s',
- &GetEditLink($oldId, $oldId)) . ')');
- }
if ((!$embed) && ($LogoUrl ne "")) {
$logoImage = "img src=\"$LogoUrl\" alt=\"$altText\" border=0";
if (!$LogoLeft) {
$logoImage .= " align=\"right\"";
}
$header = &ScriptLink($HomePage, "<$logoImage>");
+ $result .= $header;
}
- if ($id ne '') {
- $result .= $q->h1($header . &GetBackLinksSearchLink($id));
- } else {
- $result .= $q->h1($header . $title);
+ $result .= "<H1>$SiteName</H1>\n";
+ if ($oldId ne '') {
+ $result .= $q->h3('(' . Ts('redirected from %s',
+ &GetEditLink($oldId, $oldId)) . ')');
}
if (&GetParam("toplinkbar", 1)) {
$result .= &GetGotoBar($id) . "<hr class=wikilineheader>";
}
$result .= '</div>';
+ }
+ $result .= &GetHeaderLink('', $id, $title);
return $result;
}
@@ -1339,6 +1338,15 @@
return $q->header(-type=>"$type; charset=$HttpCharset");
}
return $q->header(-type=>$type);
+}
+
+sub GetHeaderLink {
+ my ($extraText, $id, $title) = @_;
+
+ my $result = $title;
+ $result = ($id ne '') ? &GetBackLinksSearchLink($id) : $title;
+ $result = qq(<div class=pageHeading><H1>$extraText$result</H1></div>);
+ return $result;
}
sub GetHtmlHeader {