Use twig for filtering.

Created on 11 June 2021, over 3 years ago
Updated 13 February 2024, 10 months ago

Problem/Motivation

When formatting addresses that have additional punctuation that cannot be address be added/removed depending on the address passed.

eg.

100 Flinders St, Melbourne VIC 3000

So using the format of %address_line1%, %address_line2%, %locality% %administrative_area% %postal_code% will actually end up with the following

100 Flinders St,, Melbourne VIC 3000

Proposed resolution

Adding Twig gives the formatter access to conditional blocks, which will allow the formatter to add additional content dependent on the data,

Using the formatter

{% if address_line1 %}{{ address_line1 }},{% endif %} {% if address_line2 %}{{ address_line2 }},{% endif %} {{ locality }} {{ administrative_area }} {{ postal_code }}

API changes

I have implemented this so the existing fields can be used, or alternatively you can use the twig fields.

Feature request
Status

Fixed

Version

2.0

Component

Code

Created by

🇦🇺Australia gordon Melbourne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024