ideas icon indicating copy to clipboard operation
ideas copied to clipboard

Filter modifier for Antlers

Open stephenmeehanuk opened this issue 1 year ago • 0 comments

Can we have a filter modifier?

I had this data from a testimonial block

 bq_cite:
          bq_name: null
          bq_position: 'Important Role'
          bq_company: 'Company Name'

Using this

{{ bq_cite | join(', ') }}

Output this, notice the comma at the start.

, Important Role, Company Name

I posted this in Discord, and a very helpful member helped me out with this:

{{$ collect($bq_cite)->filter()->join(',') $}}

Which works!

Is it possible to create an Antlers filter modifier?

stephenmeehanuk avatar Sep 06 '24 15:09 stephenmeehanuk