mirror of
https://github.com/a2nt/silverstripe-webpack.git
synced 2024-10-22 17:05:31 +02:00
IMPROVEMENT: Page Default container type
This commit is contained in:
parent
f427afdcd3
commit
e6972464de
@ -10,6 +10,9 @@ SilverStripe\View\SSViewer:
|
||||
- '$public'
|
||||
- '$default'
|
||||
|
||||
Page:
|
||||
default_container_class: 'container'
|
||||
|
||||
#SilverStripe\Admin\LeftAndMain:
|
||||
# extra_requirements_javascript:
|
||||
# - 'colymba/gridfield-bulk-editing-tools:client/dist/js/main.js'
|
||||
|
@ -170,7 +170,7 @@ class ElementRows extends DataExtension
|
||||
|
||||
$object = $object ? $object : $this->owner;
|
||||
|
||||
if(!$object->isRoot()){
|
||||
if (!$object->isRoot()) {
|
||||
$size = $object->getField('Size');
|
||||
$max = $size ? $max / (self::colsNumber() / $size) : $max;
|
||||
$parent = $object->Parent()->getOwnerPage();
|
||||
@ -185,8 +185,8 @@ class ElementRows extends DataExtension
|
||||
{
|
||||
$db = Config::inst()->get(self::class, 'db');
|
||||
$sizes = $db['Size'];
|
||||
$sizes = preg_replace('!Enum\("([0-9,]+)","([0-9]+)"\)!i','$1', $sizes);
|
||||
$sizes = explode(',',$sizes);
|
||||
$sizes = preg_replace('!Enum\("([0-9,]+)","([0-9]+)"\)!i', '$1', $sizes);
|
||||
$sizes = explode(',', $sizes);
|
||||
|
||||
return max($sizes);
|
||||
}
|
||||
@ -216,7 +216,7 @@ class ElementRows extends DataExtension
|
||||
$container_styles = array_keys(self::$container_styles);
|
||||
|
||||
if (!$type && $this->isRoot()) {
|
||||
$type = $container_styles[0];
|
||||
$type = \Page::DefaultContainer();
|
||||
}
|
||||
|
||||
return $type;
|
||||
|
@ -9,6 +9,13 @@ use DNADesign\Elemental\Models\ElementContent;
|
||||
|
||||
class Page extends SiteTree
|
||||
{
|
||||
private static $default_container_class = 'container';
|
||||
|
||||
public static function DefaultContainer()
|
||||
{
|
||||
return self::config()->get('default_container_class');
|
||||
}
|
||||
|
||||
/*
|
||||
* Shows custom summary of the post, otherwise
|
||||
* Displays summary of the first content element
|
||||
|
Loading…
Reference in New Issue
Block a user