Skip to content

Commit

Permalink
Fixes for Article Print Pages
Browse files Browse the repository at this point in the history
Fixes for #777
- Includes fixes to {page_title} to behave more like page title on
actual page
- Update print templates with fixes for link to css and other small
changes
  • Loading branch information
eSilverStrike committed Apr 13, 2017
1 parent d23b6c4 commit fe84efa
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
11 changes: 8 additions & 3 deletions public_html/article.php
Expand Up @@ -139,9 +139,14 @@
' xmlns="http://www.w3.org/1999/xhtml"');
}
$story_template->set_var('direction', $LANG_DIRECTION);
$story_template->set_var('page_title', $story->DisplayElements('page_title'));
$story_template->set_var('story_title',
$story->DisplayElements('title'));

$page_title = $story->DisplayElements('page_title');
if (empty($page_title)) {
$page_title = $_CONF['site_name'] . ' - ' . $story->DisplayElements('title');
}
$story_template->set_var('page_title', $page_title);

$story_template->set_var('story_title', $story->DisplayElements('title'));
header('Content-Type: text/html; charset=' . COM_getCharset());
header('X-XSS-Protection: 1; mode=block');
header('X-Content-Type-Options: nosniff');
Expand Down
13 changes: 11 additions & 2 deletions public_html/layout/denim/article/printable.thtml
@@ -1,28 +1,37 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html{lang_attribute}>
<head>
<title>{page_title}</title>
<meta name="robots" content="NOINDEX">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>{page_title}</title>
<link rel="stylesheet" type="text/css" href="{layout_url}/css_{direction}/print.css">
<link rel="stylesheet" type="text/css" media="print" href="{layout_url}/css_{direction}/print.css">
<link rel="shortcut icon" href="{layout_url}/images/favicon.ico">
<link rel="canonical" href="{article_url}">
</head>
<body id="print" dir="{direction}">
{# begin {templatelocation} #}

<div id="wrapper">
<div id="header">
<h2>{story_title}</h2>
<p>{lang_contributedby} {story_author} {story_date}</p>
</div>

<div id="story">
{story_text_no_br}
</div>

<p>{comments_with_count}</p>

<hr class="hidden">

<div id="footer">
<p>{page_title} - {site_name}<br>{article_url}</p>
<p>{page_title}<br>{article_url}</p>
</div>
</div>

{# end {templatelocation} #}
</body>
</html>
8 changes: 3 additions & 5 deletions public_html/layout/modern_curve/article/printable.thtml
@@ -1,18 +1,17 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html{lang_attribute}{xmlns}>
<head>
<title>{page_title}</title>
<meta name="robots" content="NOINDEX"{xhtml}>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"{xhtml}>
<meta http-equiv="Content-Style-Type" content="text/css"{xhtml}>
<link rel="stylesheet" type="text/css" href="{layout_url}/print.css"{xhtml}>
<link rel="stylesheet" type="text/css" media="print" href="{layout_url}/print.css"{xhtml}>
<link rel="shortcut icon" href="{layout_url}/images/favicon.ico"{xhtml}>
<link rel="canonical" href="{article_url}"{xhtml}>

<title>{page_title}</title>

</head>

<body dir="{direction}">

{# begin {templatelocation} #}

<h1 id="printable-story_title">{story_title}</h1>
Expand All @@ -33,6 +32,5 @@
</dl>

{# end {templatelocation} #}

</body>
</html>

0 comments on commit fe84efa

Please sign in to comment.