heimrichhannot/contao-newspicker-bundle

提供新闻选择器小工具的包

0.1.2 2021-06-08 07:36 UTC

This package is auto-updated.

Last update: 2024-09-08 14:29:58 UTC


README

此包向contao添加了一个新闻选择器输入类型。

用法

设置

使用composer或contao管理器安装

dca中的用法

// Single news picker
$GLOBALS['TL_DCA']['fields']['newsSelect'] = [
    'label'     => &$GLOBALS['TL_LANG']['tl_content']['newsSelect'],
    'inputType' => 'newsPicker',
    'eval'      => [
        'tl_class'  => 'clr',
        'multiple' => false,
    ],
    'sql'       => "int(10) unsigned NOT NULL default '0'",
];

// Multiple news picker
$GLOBALS['TL_DCA']['fields']['newsSelect'] = [
    'label'     => &$GLOBALS['TL_LANG']['tl_content']['newsSelect'],
    'inputType' => 'newsPicker',
    'eval'      => [
        'tl_class'  => 'clr',
        'multiple' => true,
    ],
    'sql'       => "blob NULL",
];