heimrichhannot/contao-newspicker-bundle

A bundle providing a news picker widget

0.1.2 2021-06-08 07:36 UTC

This package is auto-updated.

Last update: 2024-04-08 13:35:52 UTC


README

This bundle adds an newsPicker inputType to contao.

Usage

Setup

Install with composer or contao manager

Usage in 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",
];