This widget allows you to pick elements from arbitray data containers. The selected element will then be rendered in its back end view.
This is used to pick a record for the “Content element” content element for example:
When picking the element, a back end view will be rendered in the popup which allows you to switch between page articles, news articles,
calendars etc. where you will be able to go into one of the parents to select a content element from there. The preview is then rendered via
tl_content in this case.
You could also select news articles for example:
The picker popup will show you the regular back end view of the news archives in this case which allows you to then select a news article from any of these archives.
This table only shows the options relevant to the core functionality of this widget. See the DCA reference for a full field reference.
||Reference another table to pick from (can also be done via
||Reference another table to pick from via
||Set this to true if you want to be able to select multiple values.|
Depending on the widget configuration, the widget persists different values to the database. You have to take care of the correct SQL column definition yourself. A single record will be saved as an integer, the primary key reference. Multiple selected values are stored as a serialized array. Since you do not know the length in advance, a blob column is preferred.
// ... 'myNewsReference' => [ 'label' => ['Referenced news', 'Help text'], 'inputType' => 'picker', 'sql' => [ 'type' => 'integer', 'unsigned' => true, 'default' => 0, ], 'relation' => [ 'type' => 'hasOne', 'load' => 'lazy', 'table' => 'tl_news', ], ], // ...
// ... 'myContentElements' => [ 'label' => ['Referenced elements', 'Help text'], 'inputType' => 'picker', 'eval' => [ 'multple' => true, ], 'sql' => [ 'type' => 'blob', 'notnull' => false, ], 'relation' => [ 'type' => 'hasMany', 'load' => 'lazy', 'table' => 'tl_content', ], ], // ...
This picker is used for content element and article include content element as well as the article teaser content element in order to pick and preview the referenced element or article.