This bundle adds a location entity to contao.
Install via composer: composer require heimrichhannot/contao-location-bundle
and update your database.
A typical use case for location is to set location in another entity like news or events. So you need to add it to the destiny bundle dca. There are many ways in contao to make a connection to locations like selects or checkboxes. Our recommendation is to use the contao picker widget:
$dca['tl_news']['fields']['locations'] = [
'inputType' => 'picker',
'relation' => ['type' => 'hasOne', 'load' => 'eager', 'table' => 'tl_location'],
'eval' => [
'multiple' => true, //
'tl_class' => 'w50 clr autoheight'
],
'sql' => 'blob NULL',
]