'multicolumnwizard' => [
'exclude' => 1 ,
'label' => 'MulticolumnField' ,
'config' => [
'type' => 'user' ,
'renderType' => 'multiColumnWizard' ,
'columnFields' => [
'exampleMultiColumnWizardTextInput' => [
'divClass' => 'col-sm-2' ,
'type' => 'text' ,
'label' => 'Textfield'
'showLabelAboveField' => true ,
],
'exampleMultiColumnWizardTextareaInput' => [
'divClass' => 'col-sm-2' ,
'type' => 'textarea' ,
'label' => 'Textarea' ,
'cols' => 40 ,
'rows' => 5
'showLabelAboveField' => true ,
],
'exampleMultiColumnWizardCheckbox' => [
'divClass' => 'col-sm-2' ,
'type' => 'checkbox' ,
'label' => 'Checkbox'
],
'exampleMultiColumnWizardSelect' => [
'divClass' => 'col-sm-2' ,
'type' => 'select' ,
'label' => 'Select' ,
'options' => [
'value' => 'name' ,
'value2' => 'name2' ,
'value3' => 'name3' ,
'value4' => 'name4' ,
'value5' => 'name5'
]
],
'exampleMultiColumnWizardSelectIcon' => [
'divClass' => 'col-sm-2' ,
'label' => 'Icon' ,
'type' => 'select' ,
'options' => '' ,
'optionsFunction' => [LIA\LiaMulticolumnwizard\Utilities\IconFactory::class . '->getIcons' , ['iconPath' => 'EXT:your_extension/Resources/Public/Icons.json' ]],
],
'exampleMultiColumnWizardReference' => [
'divClass' => 'col-sm-2' ,
'label' => 'Reference' ,
'type' => 'select' ,
'options' => '' ,
'optionsFunction' => [LIA\LiaMulticolumnwizard\Utilities\ReferenceFactory::class . '->getReference' , ['tableName' => 'pages' , 'valueField' => 'uid' , 'outputNameField' => 'title' ]],
],
'exampleMultiColumnWizardLanguage' => [
'divClass' => 'col-sm-2' ,
'label' => 'Languages' ,
'type' => 'select' ,
'options' => '' ,
'optionsFunction' => [LIA\LiaMulticolumnwizard\Utilities\TCAFactory::class . '->getAvailableLanguagesForAllSites' ],
],
'exampleMultiColumnWizardLinkInput' => [
'divClass' => 'col-sm-2' ,
'type' => 'link' ,
'label' => 'Link' ,
'linkUseField' => 'fieldname_hidden_link_field' ,
],
]
]
],
'fieldname_hidden_link_field' = [
'exclude' => 1 ,
'label' => 'Hidden link field used by the link wizard of exampleMultiColumnWizardLinkInput' ,
'config' => [
'type' => 'link' ,
]
];
Copied!
IconFactory
This factory creates an icon selection from the icons in the JSON file.
Your Icon.json file schould look like this.
Icons.json example
[
{"name" :"arrow-down" ,"file" :"arrow-down.svg" },
{"name" :"book" ,"file" :"book.svg" },
{"name" :"car" ,"file" :"car.svg" },
{"name" :"chevron-down" ,"file" :"chevron-down.svg" },
{"name" :"chevron-right" ,"file" :"chevron-right.svg" },
{"name" :"cloud-download" ,"file" :"cloud-download.svg" },
{"name" :"comment-alt-exclamation" ,"file" :"comment-alt-exclamation.svg" },
{"name" :"comment-alt" ,"file" :"comment-alt.svg" },
{"name" :"compass" ,"file" :"compass.svg" },
{"name" :"dollar-sign" ,"file" :"dollar-sign.svg" },
{"name" :"envelope" ,"file" :"envelope.svg" },
{"name" :"euro" ,"file" :"euro.svg" },
{"name" :"external-link" ,"file" :"external-link.svg" },
{"name" :"fax" ,"file" :"fax.svg" },
{"name" :"hands-helping" ,"file" :"hands-helping.svg" },
{"name" :"leaf" ,"file" :"leaf.svg" },
{"name" :"map-marker-alt-solid" ,"file" :"map-marker-alt-solid.svg" },
{"name" :"map-marker-alt" ,"file" :"map-marker-alt.svg" },
{"name" :"paper-plane" ,"file" :"paper-plane.svg" },
{"name" :"phone" ,"file" :"phone.svg" },
{"name" :"swatchbook" ,"file" :"swatchbook.svg" },
{"name" :"tasks" ,"file" :"tasks.svg" },
{"name" :"user-headset" ,"file" :"user-headset.svg" },
{"name" :"users" ,"file" :"users.svg" },
{"name" :"video" ,"file" :"video.svg" },
{"name" :"wrench" ,"file" :"wrench.svg" }
]
Copied!
Link Field
In order to use the link feature you need to also create a field of type link in the current TCA and reference it in the multicolumnwizard link
field in the linkUseField attribute. This field will be automatically hidden by Javascript.
Link Field Example
$ctype = &$GLOBALS['TCA' ]['tt_content' ]['types' ]['lia_ctypes_mcw_test' ];
$ctype['columnsOverrides' ]['multicolumnwizard' ]['config' ]['columnFields' ] = [
'exampleMultiColumnWizardLinkInput' => [
'divClass' => 'col-sm-2' ,
'type' => 'link' ,
'label' => 'Link' ,
'linkUseField' => 'fieldname_hidden_link_field' ,
],
];
$ctype['columnsOverrides' ]['fieldname_hidden_link_field' ] = [
'exclude' => 1 ,
'label' => 'Link' ,
'config' => [
'type' => 'link' ,
]
];
$ctype['types' ][1 ]['showitem' ] = '... , tx_lia_multicolumnwizard, fieldname_hidden_link_field, ...' ;
Copied!
Warning
The fieldname_hidden_link_field Field has to be added to showItems to be rendered in the Form, otherwise the linkwizard will not be shown.