From 7b80ee7e9be9adb1e98d14237f338c965078d404 Mon Sep 17 00:00:00 2001 From: Leo Feyer Date: Tue, 1 Oct 2013 16:56:41 +0200 Subject: [PATCH] Add the custom layout sections positions "top" and "bottom" (see #2885) --- contao/classes/FrontendTemplate.php | 4 ++-- contao/dca/tl_layout.php | 2 +- contao/languages/en/tl_layout.xlf | 6 ++++++ contao/templates/frontend/fe_page.html5 | 4 ++++ contao/templates/frontend/fe_page.xhtml | 4 ++++ 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/contao/classes/FrontendTemplate.php b/contao/classes/FrontendTemplate.php index c2e9602a11..9d801cf82a 100644 --- a/contao/classes/FrontendTemplate.php +++ b/contao/classes/FrontendTemplate.php @@ -217,7 +217,7 @@ public function output($blnCheckRequest=false) */ public function getCustomSection($strKey) { - return sprintf("\n
\n%s\n
\n", $strKey, $this->sections[$strKey] ?: ' '); + return '
' . $this->sections[$strKey] . '
' . "\n"; } @@ -259,6 +259,6 @@ public function getCustomSections($strKey=null) return ''; } - return "\n" . '
' . "\n" . $sections . "\n" . '
' . "\n"; + return '
' . "\n" . $sections . "\n" . '
' . "\n"; } } diff --git a/contao/dca/tl_layout.php b/contao/dca/tl_layout.php index 2d37fd57d0..92b1c797e2 100644 --- a/contao/dca/tl_layout.php +++ b/contao/dca/tl_layout.php @@ -218,7 +218,7 @@ 'default' => 'main', 'exclude' => true, 'inputType' => 'select', - 'options' => array('before', 'main', 'after'), + 'options' => array('top', 'before', 'main', 'after', 'bottom'), 'reference' => &$GLOBALS['TL_LANG']['tl_layout'], 'sql' => "varchar(32) NOT NULL default ''" ), diff --git a/contao/languages/en/tl_layout.xlf b/contao/languages/en/tl_layout.xlf index 24c11a9337..8dd76a4337 100644 --- a/contao/languages/en/tl_layout.xlf +++ b/contao/languages/en/tl_layout.xlf @@ -347,6 +347,9 @@ XHTML Transitional + + Before the wrapper + After the page header @@ -356,6 +359,9 @@ Before the page footer + + After the wrapper + Edit the style sheets diff --git a/contao/templates/frontend/fe_page.html5 b/contao/templates/frontend/fe_page.html5 index 74636fc31d..aca1f43d8f 100644 --- a/contao/templates/frontend/fe_page.html5 +++ b/contao/templates/frontend/fe_page.html5 @@ -21,6 +21,8 @@ onload): ?> onload="onload; ?>"> + getCustomSections('top'); ?> +
header): ?> @@ -70,6 +72,8 @@
+ getCustomSections('bottom'); ?> + mootools; ?> disableCron): ?> diff --git a/contao/templates/frontend/fe_page.xhtml b/contao/templates/frontend/fe_page.xhtml index f683f252fe..1252762b5d 100644 --- a/contao/templates/frontend/fe_page.xhtml +++ b/contao/templates/frontend/fe_page.xhtml @@ -22,6 +22,8 @@ onload): ?> onload="onload; ?>"> + getCustomSections('top'); ?> +
header): ?> @@ -71,6 +73,8 @@
+ getCustomSections('bottom'); ?> + mootools; ?> disableCron): ?>