Complex Custom Layout Presets

Permalink 2 users found helpful
The custom grid layout does not show up in the layout dropdown menu. I have implemented the custom grid in to the theme. By adding code to the PageTheme class in page_theme.php

//this is the code from the elemental theme
public function getThemeAreaLayoutPresets()
{
    $presets = array(
        array(
            'handle' => 'left_sidebar',
            'name' => 'Left Sidebar',
            'container' => '<div class="row"></div>',
            'columns' => array(
                '<div class="col-sm-4"></div>',
                '<div class="col-sm-8"></div>'
            ),
        ),
        array(
            'handle' => 'right_sidebar',


I also tried to delete and reinstall the theme but it still does not work.

Any idea what I should do?

 
rge replied on at Permalink Best Answer Reply
I found the problem we need to include the ThemeProviderInterface;

use Concrete\Core\Area\Layout\Preset\Provider\ThemeProviderInterface;
class PageTheme extends Theme implements ThemeProviderInterface{
}


I Guess the documentation about this is not complete.
http://www.concrete5.org/documentation/developers/5.7/designing-for...
AnttiP replied on at Permalink Reply
I'm having problems including the ThemeProviderInterface; to page_theme.php without getting syntax errors. Here's what my page_theme.php looks from the beginning:

<?php
namespace Application\Theme\Redox;
class PageTheme extends \Concrete\Core\Page\Theme\Theme {
 /* layout tool preset */         
    public function getThemeAreaLayoutPresets()
   {
       $presets = array(
           array(
               'handle' => 'small_two_large_four',
               'name' => 'Small Two Large Four',
               'container' => '<div class="row"></div>',
               'columns' => array(
                   '<div class="col-sm-6 col-md-3"></div>',
                   '<div class="col-sm-6 col-md-3"></div>',
                   '<div class="col-sm-6 col-md-3"></div>',


Could anyone give advice where to include the code in the reply above?
rge replied on at Permalink Reply
Hi,

This should work.

<?php
namespace Application\Theme\Redox;
use Concrete\Core\Page\Theme\Theme;
use Concrete\Core\Area\Layout\Preset\Provider\ThemeProviderInterface;
class PageTheme extends Theme implements ThemeProviderInterface
{
 /* layout tool preset */         
    public function getThemeAreaLayoutPresets()
   {
       $presets = array(
           array(
               'handle' => 'small_two_large_four',
               'name' => 'Small Two Large Four',
               'container' => '<div class="row"></div>',
               'columns' => array(
AnttiP replied on at Permalink Reply
Thousand thanks!
It is simple when you know what to do... ;)
Dutchwave replied on at Permalink Reply
Dutchwave
Thank you aswell.

One problem though, how do you add "data-equalizer" to the container?
'container' => '<div class="row" data-equalizer></div>', won't work.

Hope its possible.
Kiesel replied on at Permalink Reply
Fiuu, thanks for that. You saved me from a major headache.

And yes, the documentation is still not a jour with this.