Issue #1938848 by Jaesin, Cottser, jenlampton, hefox, Shawn DeArmond, frob, boze, joelpittet, mrf, dcrocks: seven.theme - Convert PHPTemplate templates to Twig.

8.0.x
Alex Pott 2013-05-24 09:53:16 -07:00
parent 8f7dc88de3
commit 3d24449a97
3 changed files with 59 additions and 64 deletions

View File

@ -6,12 +6,12 @@
*/
/**
* Implements hook_preprocess_HOOK() for maintenance-page.tpl.php.
* Implements hook_preprocess_HOOK() for maintenance-page.html.twig.
*/
function seven_preprocess_maintenance_page(&$vars) {
// While markup for normal pages is split into page.tpl.php and html.tpl.php,
// the markup for the maintenance page is all in the single
// maintenance-page.tpl.php template. So, to have what's done in
// maintenance-page.html.twig template. So, to have what's done in
// seven_preprocess_html() also happen on the maintenance page, it has to be
// called here.
seven_preprocess_html($vars);

View File

@ -0,0 +1,57 @@
{#
/**
* @file
* Seven's theme implementation to display a single Drupal page while offline.
*
* All of the available variables are mirrored in page.html.twig.
*
* @see template_preprocess()
* @see template_preprocess_maintenance_page()
* @see seven_preprocess_maintenance_page()
*
* @ingroup themeable
*/
#}
<!DOCTYPE html>
<html lang="{{ language.langcode }}" dir="{{ language.dir }}">
<head>
<title>{{ head_title }}</title>
{{ head }}
{{ styles }}
{{ scripts }}
</head>
<body{{ attributes }}>
{{ page_top }}
<header id="branding">
{% if title %}<h1 class="page-title">{{ title }}</h1>{% endif %}
</header>
<div id="page">
<div id="sidebar-first" class="sidebar">
{% if logo %}
<img id="logo" src="{{ logo }}" alt="{{ site_name }}" />
{% endif %}
{{ sidebar_first }}
</div>
<main id="content" class="clearfix">
{% if messages %}
<div id="console">{{ messages }}</div>
{% endif %}
{% if help %}
<div id="help">
{{ help }}
</div>
{% endif %}
{{ content }}
</main>
</div>
<footer role="contentinfo">
{{ page_bottom }}
</footer>
</body>
</html>

View File

@ -1,62 +0,0 @@
<?php
/**
* @file
* Seven's theme implementation to display a single Drupal page while offline.
*
* All of the available variables are mirrored in page.tpl.php.
*
* @see template_preprocess()
* @see template_preprocess_maintenance_page()
* @see seven_preprocess_maintenance_page()
*
* @ingroup themeable
*/
?>
<!DOCTYPE html>
<html lang="<?php print $language->langcode ?>" dir="<?php print $language->dir ?>">
<head>
<title><?php print $head_title; ?></title>
<?php print $head; ?>
<?php print $styles; ?>
<?php print $scripts; ?>
</head>
<body class="<?php print $attributes['class']; ?>">
<?php print $page_top; ?>
<header id="branding">
<?php if ($title): ?><h1 class="page-title"><?php print $title; ?></h1><?php endif; ?>
</header>
<div id="page">
<div id="sidebar-first" class="sidebar">
<?php if ($logo): ?>
<img id="logo" src="<?php print $logo ?>" alt="<?php print $site_name ?>" />
<?php endif; ?>
<?php if ($sidebar_first): ?>
<?php print $sidebar_first ?>
<?php endif; ?>
</div>
<main id="content" class="clearfix">
<?php if ($messages): ?>
<div id="console"><?php print $messages; ?></div>
<?php endif; ?>
<?php if ($help): ?>
<div id="help">
<?php print $help; ?>
</div>
<?php endif; ?>
<?php print $content; ?>
</main>
</div>
<footer role="contentinfo">
<?php print $page_bottom; ?>
</footer>
</body>
</html>