0

我在 Contao 中使用 TL_DCA 功能,我想将字段包装在左右容器中。

$GLOBALS['TL_DCA']['table_name'] = array
(
    // Config
    'config' => array
    (
        'dataContainer' => 'Table',
    ),

    // List
    'list' => array
    (),

    // Fields
    'fields' => array
    (
        'field1' => array
        (
            'label' => array('Suchname', 'Suchname'),
            'exclude' => true,
            'inputType' => 'text'
        ),
        'field2' => array
        (
            'label' => array('Firma', 'Firma'),
            'exclude' => true,
            'inputType' => 'text'
        ),
        'field3' => array
        (
            'label' => array('Name', 'Name'),
            'exclude' => true,
            'inputType' => 'text',
            'eval' => array('mandatory' => true)
        ),
        'field4' => array
        (
            'label' => array('Vorname', 'Vorname'),
            'exclude' => true,
            'inputType' => 'text'
        ),
    )
)

将 Field 和 Filed 2 包装在左类中,将 Field 3 和 Field 4 包装在右类中。所以请在这里帮忙。

提前致谢..!!!

4

1 回答 1

0

可以为字段指定特定的 css 类:

'eval' => array('tl_class'=>'w50'),

w50 代表宽度 = 50%

例如:

   'field1' => array
    (
        'label' => array('Suchname', 'Suchname'),
        'exclude' => true,
        'inputType' => 'text',
        'eval' => array('tl_class'=>'w50'),
    ),
    'field2' => array
    (
        'label' => array('Firma', 'Firma'),
        'exclude' => true,
        'inputType' => 'text'
        'eval' => array('tl_class'=>'w50'),
    ),
于 2018-07-20T09:04:14.270 回答