joomlaboat / custom-tables

The Custom Tables extension allows you to create, manage, and display custom data on your Joomla site. It is helpful if you need to display data that is not part of the standard Joomla content structure. For example, you could use this extension to create a custom table for product information, customer data, or any other type of data that you need to display on your site. The Custom Tables is the CRUD solution for Joomla 3.x and 4.x - CREATE, READ, UPDATE and DELETE. You can add tables, fields, and layouts to create catalogs, forms, or details pages. It has 40 Field Types: Integer (numbers), Decimal, Text String, Time, Email, Color, Image, File, User, Language, etc.
https://joomlaboat.com/custom-tables
GNU General Public License v2.0
35 stars 11 forks source link

Twig "if" statement #60

Closed froemer4773 closed 9 months ago

froemer4773 commented 9 months ago

How to use the Twig if statement in a block? I would like to color a row in a table if a field value contains red, for example

{% if <> = "rot" %}

{% else %} {% endif %} Field-Name is: {{ category }}
joomlaboat commented 9 months ago

Hi froemer4773,

{% if category != "rot" %}

NOT ROT

{% else %}

ROT

{% endif %}

or

{% if category.value == "rot" %}

ROT

{% else %}

NOT ROT

{% endif %}

joomlaboat commented 9 months ago

If the category is Table Join field type then: {% if category != "rot" %}NOT ROT{% else %}ROT{% endif %}

froemer4773 commented 9 months ago

Hi froemer4773,

{% if category != "rot" %}

NOT ROT

{% else %} ROT

{% endif %} or

{% if category.value == "rot" %}

ROT

{% else %} NOT ROT

{% endif %}

This is the solution ... greate and THX