Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Add the custom layout sections positions "top" and "bottom" (see #2885)
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Oct 1, 2013
1 parent 5421af9 commit 37d2684
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions system/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Contao Open Source CMS changelog
Version 3.2.RC1 (2013-10-XX)
----------------------------

### New
Added the custom layout sections positions "top" and "bottom" (see #2885).

### Fixed
Use serialized arrays to store order field data (see #6255).

Expand Down
4 changes: 2 additions & 2 deletions system/modules/core/classes/FrontendTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ public function output($blnCheckRequest=false)
*/
public function getCustomSection($strKey)
{
return sprintf("\n<div id=\"%s\">\n%s\n</div>\n", $strKey, $this->sections[$strKey] ?: '&nbsp;');
return '<div id="' . $strKey . '">' . $this->sections[$strKey] . '</div>' . "\n";
}


Expand Down Expand Up @@ -259,6 +259,6 @@ public function getCustomSections($strKey=null)
return '';
}

return "\n" . '<div class="custom">' . "\n" . $sections . "\n" . '</div>' . "\n";
return '<div class="custom">' . "\n" . $sections . "\n" . '</div>' . "\n";
}
}
2 changes: 1 addition & 1 deletion system/modules/core/dca/tl_layout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ''"
),
Expand Down
6 changes: 6 additions & 0 deletions system/modules/core/languages/en/tl_layout.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,9 @@
<trans-unit id="tl_layout.xhtml_trans">
<source>XHTML Transitional</source>
</trans-unit>
<trans-unit id="tl_layout.top">
<source>Before the wrapper</source>
</trans-unit>
<trans-unit id="tl_layout.before">
<source>After the page header</source>
</trans-unit>
Expand All @@ -356,6 +359,9 @@
<trans-unit id="tl_layout.after">
<source>Before the page footer</source>
</trans-unit>
<trans-unit id="tl_layout.bottom">
<source>After the wrapper</source>
</trans-unit>
<trans-unit id="tl_layout.edit_styles">
<source>Edit the style sheets</source>
</trans-unit>
Expand Down
4 changes: 4 additions & 0 deletions system/modules/core/templates/frontend/fe_page.html5
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
</head>
<body id="top" class="{{ua::class}}<?php if ($this->class): ?> <?php echo $this->class; ?><?php endif; ?>"<?php if ($this->onload): ?> onload="<?php echo $this->onload; ?>"<?php endif; ?>>

<?php echo $this->getCustomSections('top'); ?>

<div id="wrapper">

<?php if ($this->header): ?>
Expand Down Expand Up @@ -70,6 +72,8 @@

</div>

<?php echo $this->getCustomSections('bottom'); ?>

<?php echo $this->mootools; ?>

<?php if (!$this->disableCron): ?>
Expand Down
4 changes: 4 additions & 0 deletions system/modules/core/templates/frontend/fe_page.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
</head>
<body id="top" class="{{ua::class}}<?php if ($this->class): ?> <?php echo $this->class; ?><?php endif; ?>"<?php if ($this->onload): ?> onload="<?php echo $this->onload; ?>"<?php endif; ?>>

<?php echo $this->getCustomSections('top'); ?>

<div id="wrapper">

<?php if ($this->header): ?>
Expand Down Expand Up @@ -71,6 +73,8 @@

</div>

<?php echo $this->getCustomSections('bottom'); ?>

<?php echo $this->mootools; ?>

<?php if (!$this->disableCron): ?>
Expand Down

0 comments on commit 37d2684

Please sign in to comment.