heimrichhannot/contao-location-bundle

This bundle adds a location entity to contao.

2.2.1 2022-12-10 20:27 UTC

This package is auto-updated.

Last update: 2024-04-10 23:06:26 UTC


README

This bundle adds a location entity to contao.

Features

Setup and Usage

Installation

Install via composer: composer require heimrichhannot/contao-location-bundle and update your database.

Usage

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',
]