From 43934a326d906c3a6263aa455389d585e82f95e7 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Fri, 24 May 2013 09:59:07 -0700 Subject: [PATCH] Issue #1898424 by joelpittet, duellj, Cottser, mr.baileys: layout.module - Convert PHPTemplate templates to Twig. --- .../layouts/static/one-col/one-col.html.twig | 21 +++++++++++++++ .../layouts/static/one-col/one-col.tpl.php | 18 ------------- .../layouts/static/twocol/two-col.html.twig | 27 +++++++++++++++++++ .../layouts/static/twocol/two-col.tpl.php | 24 ----------------- .../layouts/static/one-col/one-col.html.twig | 20 ++++++++++++++ .../layouts/static/one-col/one-col.tpl.php | 18 ------------- .../layouts/static/two-col/two-col.html.twig | 26 ++++++++++++++++++ .../layouts/static/two-col/two-col.tpl.php | 24 ----------------- 8 files changed, 94 insertions(+), 84 deletions(-) create mode 100644 core/modules/layout/layouts/static/one-col/one-col.html.twig delete mode 100644 core/modules/layout/layouts/static/one-col/one-col.tpl.php create mode 100644 core/modules/layout/layouts/static/twocol/two-col.html.twig delete mode 100644 core/modules/layout/layouts/static/twocol/two-col.tpl.php create mode 100644 core/modules/layout/tests/layouts/static/one-col/one-col.html.twig delete mode 100644 core/modules/layout/tests/layouts/static/one-col/one-col.tpl.php create mode 100644 core/modules/layout/tests/themes/layout_test_theme/layouts/static/two-col/two-col.html.twig delete mode 100644 core/modules/layout/tests/themes/layout_test_theme/layouts/static/two-col/two-col.tpl.php diff --git a/core/modules/layout/layouts/static/one-col/one-col.html.twig b/core/modules/layout/layouts/static/one-col/one-col.html.twig new file mode 100644 index 000000000000..8f30223b50c7 --- /dev/null +++ b/core/modules/layout/layouts/static/one-col/one-col.html.twig @@ -0,0 +1,21 @@ +{# +/** + * @file + * Template for a 1 column layout. + * + * This template provides a simple one column display layout. + * + * Avaiable variables: + * - attributes: Attributes to be placed on the wrapping element. + * - content: All content items, each content item is keyed to one region of the + * layout. 'content' contains the following section: + * - content: Content in the content column. + * + * @ingroup themeable + */ +#} +<div class="layout-display layout-one-col {{ attributes.class }}"{{ attributes }}> + <div class="layout-region"> + {{ content.content }} + </div> +</div> diff --git a/core/modules/layout/layouts/static/one-col/one-col.tpl.php b/core/modules/layout/layouts/static/one-col/one-col.tpl.php deleted file mode 100644 index 61af8327956f..000000000000 --- a/core/modules/layout/layouts/static/one-col/one-col.tpl.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * @file - * Template for a 1 column layout. - * - * This template provides a simple one column display layout. - * - * Variables: - * - $content: An array of content, each item in the array is keyed to one - * region of the layout. This layout supports only one section: - * - $content['content']: Content in the content column. - */ -?> -<div class="layout-display layout-one-col <?php print $attributes['class']; ?>"<?php print $attributes; ?>> - <div class="layout-region"> - <?php print $content['content']; ?> - </div> -</div> diff --git a/core/modules/layout/layouts/static/twocol/two-col.html.twig b/core/modules/layout/layouts/static/twocol/two-col.html.twig new file mode 100644 index 000000000000..2bfade0a6a31 --- /dev/null +++ b/core/modules/layout/layouts/static/twocol/two-col.html.twig @@ -0,0 +1,27 @@ +{# +/** + * @file + * Template for a 2 column layout. + * + * This template provides a two column display layout, with each column equal in + * width. + * + * Available variables: + * - attributes: Attributes to be placed on the wrapping element. + * - content: All content items, each content item is keyed to one region of the + * layout. 'content' contains the following sections: + * - first: Content in the first column. + * - second: Content in the second column. + * + * @ingroup themeable + */ +#} +<div class="layout-display layout-two-col clearfix {{ attributes.class }}"{{ attributes }}> + <div class="layout-region layout-col-first"> + {{ content.first }} + </div> + + <div class="layout-region layout-col-second"> + {{ content.second }} + </div> +</div> diff --git a/core/modules/layout/layouts/static/twocol/two-col.tpl.php b/core/modules/layout/layouts/static/twocol/two-col.tpl.php deleted file mode 100644 index 810a052b2c18..000000000000 --- a/core/modules/layout/layouts/static/twocol/two-col.tpl.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * @file - * Template for a 2 column layout. - * - * This template provides a two column display layout, with each column equal in - * width. - * - * Variables: - * - $content: An array of content, each item in the array is keyed to one - * region of the layout. This layout supports the following sections: - * - $content['first']: Content in the first column. - * - $content['second']: Content in the second column. - */ -?> -<div class="layout-display layout-two-col clearfix <?php print $attributes['class']; ?>"<?php print $attributes; ?>> - <div class="layout-region layout-col-first"> - <?php print $content['first']; ?> - </div> - - <div class="layout-region layout-col-second"> - <?php print $content['second']; ?> - </div> -</div> diff --git a/core/modules/layout/tests/layouts/static/one-col/one-col.html.twig b/core/modules/layout/tests/layouts/static/one-col/one-col.html.twig new file mode 100644 index 000000000000..c4f263d3ff04 --- /dev/null +++ b/core/modules/layout/tests/layouts/static/one-col/one-col.html.twig @@ -0,0 +1,20 @@ +{# +/** + * @file + * Template for a one column layout. + * + * This template provides a very simple "one column" display layout. + * + * Avaiable variables: + * - content: All content items, each content item is keyed to one region of the + * layout. 'content' contains the following section: + * - middle: The only region in the layout. + * + * @ingroup themeable + */ +#} +<div class="layout-display layout-one-col clearfix"> + <div class="layout-region layout-col"> + <div class="inside">{{ content.middle }}</div> + </div> +</div> diff --git a/core/modules/layout/tests/layouts/static/one-col/one-col.tpl.php b/core/modules/layout/tests/layouts/static/one-col/one-col.tpl.php deleted file mode 100644 index e47f83ec473a..000000000000 --- a/core/modules/layout/tests/layouts/static/one-col/one-col.tpl.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php -/** - * @file - * Template for a one column layout. - * - * This template provides a very simple "one column" display layout. - * - * Variables: - * - $content: An array of content, each item in the array is keyed to one - * region of the layout. This layout supports the following sections: - * $content['middle']: The only region in the layout. - */ -?> -<div class="layout-display layout-one-col clearfix"> - <div class="layout-region layout-col"> - <div class="inside"><?php print $content['middle']; ?></div> - </div> -</div> diff --git a/core/modules/layout/tests/themes/layout_test_theme/layouts/static/two-col/two-col.html.twig b/core/modules/layout/tests/themes/layout_test_theme/layouts/static/two-col/two-col.html.twig new file mode 100644 index 000000000000..7c58a551b7c4 --- /dev/null +++ b/core/modules/layout/tests/themes/layout_test_theme/layouts/static/two-col/two-col.html.twig @@ -0,0 +1,26 @@ +{# +/** + * @file + * Template for a 2 column layout. + * + * This template provides a two column display layout, with each column equal in + * width. + * + * Available variables: + * - content: All content items, each content item is keyed to one region of the + * layout. 'content' contains the following sections: + * - left: Content in the left column. + * - right: Content in the right column. + * + * @ingroup themeable + */ +#} +<div class="layout-display layout-two-col clearfix"> + <div class="layout-region layout-col-left"> + <div class="inside">{{ content.left }}</div> + </div> + + <div class="layout-region layout-col-right"> + <div class="inside">{{ content.right }}</div> + </div> +</div> diff --git a/core/modules/layout/tests/themes/layout_test_theme/layouts/static/two-col/two-col.tpl.php b/core/modules/layout/tests/themes/layout_test_theme/layouts/static/two-col/two-col.tpl.php deleted file mode 100644 index 1d8dbe46b336..000000000000 --- a/core/modules/layout/tests/themes/layout_test_theme/layouts/static/two-col/two-col.tpl.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -/** - * @file - * Template for a 2 column layout. - * - * This template provides a two column display layout, with each column equal in - * width. - * - * Variables: - * - $content: An array of content, each item in the array is keyed to one - * region of the layout. This layout supports the following sections: - * - $content['left']: Content in the left column. - * - $content['right']: Content in the right column. - */ -?> -<div class="layout-display layout-two-col clearfix"> - <div class="layout-region layout-col-left"> - <div class="inside"><?php print $content['left']; ?></div> - </div> - - <div class="layout-region layout-col-right"> - <div class="inside"><?php print $content['right']; ?></div> - </div> -</div> -- GitLab