Views : Custom Template - Twig support

Created on 28 March 2024, 3 months ago

Problem/Motivation

Is it possible to use twigs in custom template (views) ?

Custom field :

Name: Coaston
Tel : +155151xxx 

in custom Template have [name] and [tel_number] so It would be very useful if we can use conditions to display specific fields based on values like :

{% set conditionx = name %}

{% if conditionx == 'Coaston' %}
Admin
{% else %}
Not Admin
{% endif %}

Using this we can hide or replace any field based on conditions.

✨ Feature request
Status

Closed: works as designed

Version

2.0

Component

Code

Created by

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

Comments & Activities

  • Issue created by @coaston
  • Status changed to Closed: works as designed 3 months ago
  • πŸ‡ΊπŸ‡ΈUnited States apmsooner

    No, the custom template formatter is just doing string token replacement. You can use the other formatters or create your own template override with the specific logic you need.

Production build 0.69.0 2024