I need the possibility to link images with audio files in the file management. I followed this tutorial and the field is created, but only as a simple input field. https://docs.contao.org/dev/reference/dca/fields/#meta-wizard-fields
Then i added a standard DCA setup
<?php
$GLOBALS['TL_DCA']['tl_files']['fields']['meta']['eval']['metaFields']['audiolink'] = [
'inputType' => 'fileTree',
'eval' => ['filesOnly' => true, 'fieldType' => 'radio', 'mandatory' => false],
'sql' => ['type' => 'string', 'length' => 255, 'default' => ''],
];
but this does not work.
With this i get the Page Tree Wizard
<?php
$GLOBALS['TL_DCA']['tl_files']['fields']['meta']['eval']['metaFields']['audiolink'] = [
'attributes' => 'maxlength="255"', 'dcaPicker' => true
];
Then i tried this
<?php
$GLOBALS['TL_DCA']['tl_files']['fields']['meta']['eval']['metaFields']['audiolink'] = [
'attributes' => 'maxlength="255"', 'fileTree' => true
];
but this does not work, too. So how to get the "fileTree" Wizard working at file management?
You can't, the meta wizard supports only
textfields (andtextareafields since Contao 4.9.10).Instead of using
tl_files.meta, you could add an additional field totl_files:However, this of course means that you can select this file only per file and not per language per file.