madeyourday / contao-rocksolid-custom-elements

RockSolid Custom Elements Contao Extension
http://rocksolidthemes.com/de/contao/plugins/custom-content-elements
MIT License
48 stars 12 forks source link

More templates for one .php file? #41

Closed rocchidavide closed 9 years ago

rocchidavide commented 9 years ago

Is it possible to select the .html5 template to load inside a _config.php file? The idea is to have more templates for one config file

ausi commented 9 years ago

There is no such option built in, but you can include other templates in the template itself. e.g.:

A field in the config:

'myTemplate' => array(
    'label' => array('Template', ''),
    'inputType' => 'select',
    'options' => array(
        'my_template_1',
        'my_template_2',
        'my_template_3',
    ),
),

Template:

<?php include __DIR__ . '/' . $this->myTemplate . '.html5';