- Issue created by @mrshowerman
- Issue was unassigned.
- Status changed to Needs review
5 months ago 7:46am 19 July 2024 - 🇩🇪Germany mrshowerman Munich
OK, I think this is ready for review.
The new module has a settings form at /admin/config/services/openculturas_address_links where you can specify URLs of your chosen directions and public transport provider. You can use tokens to include location coordinates or its plaintext address.
By default, the public transport URL is empty, and the directions URL is set togeo:[geofield:latlon]
to make it BC with the current behaviour.Example settings from KultinO:
https://www.google.de/maps/dir/?api=1&destination=[geofield:latlon]
(directions)
For OpenStreetMap, this could also be
https://routing.openstreetmap.de/?z=18&loc=[geofield:latlon]&hl=[language:langcode]&srv=0
.https://www.vbn.de/fahrplaner/?start=yes&language=[language:langcode]&L=vs_vbn&Z=[address:address]
(public transport)
I've updated the
openculturas_base_preprocess_paragraph()
hook in the base template, so it now calls the new service for including links. This wil only work if the new module is activated, thus we will need an update script that enables it.For sites that prefer using field formatters together with field copies (like KultinO), the module also contains two new formatters.
- 🇩🇪Germany hexabinaer Berlin, Germany
Awesome, I'll look into it.
On first reading of your description I wondered if this could work as a generic module (without OC dependency).
- 🇩🇪Germany mrshowerman Munich
I've asked myself the same thing. Theoretically, it could also be seen as an independent module, but as we only use it in an OC context (so far), I have treated it in the same way as the other modules for the time being.
- Assigned to tobiasb
-
tobiasb →
committed 2cb468e8 on 2.3.x
Issue #3462443: Configurable directions and public transport links
-
tobiasb →
committed 2cb468e8 on 2.3.x
- Issue was unassigned.
- Status changed to Fixed
3 months ago 3:42pm 6 September 2024 - 🇩🇪Germany tobiasb Berlin
Merged module. Some changes for CS/phpstan/rector happyness.
The config values in
openculturas_address_links.settings
are now nullable. Because a empty string is not a valid uri.The modul will be installed via update-hook.
- 🇩🇪Germany mrshowerman Munich
Awesome.
I'd really like to get credit for this one 😉 - 🇩🇪Germany hexabinaer Berlin, Germany
@mrshowerman On trying to construct a link with tokens there's a glitch:
- Click in either of the 2 fields
- Open token browser
- Select a token, e. g. [geofield:latlon]
Always results in a modal message "First click a text field to insert your tokens into.".
Automatically closed - issue fixed for 2 weeks with no activity.