Category "twig"

Convert rows to columns using Twig - D8

I have a content type "Awards" that has data structured as below: I want to group this data as below: Want to group them on a "State" basis. So when I click on

Twig auto import macros by environment

Is it possible (and how) to automatically include specific macro files into every twig file by using PHP (not Twig lang). Example: I got the file select2 wh

Symfony Error: "An exception has been thrown during the rendering of a template"

I am trying to include <link href="{{ asset('css/mystyle.css') }}" rel="stylesheet"/> in my twig file and render it. But it gives me Uncaught P

using random function but it's displaying duplicates

I am using the random function in twig and it is randomizing the images I need but it is repeating the logos. How can I make it so that the images are not repea

Symfony/Twig: Stop rendering the rest of a template

I've been searching the internet for this, but I can't find anything regarding this. I'm creating a simple twig template that is going to be used on multiple l

Twig - How to check if variable is a number / integer

How to check if variable is a number, integer or float? I can't find anything about this. Making project in Symfony 3.

Symfony-Twig: insert fontawesome icon in a form_widget

To validate a form I am using a standard: {{ form_widget(form.save, {'attr': {'class': 'btn btn-sm btn-danger'}, 'label': 'Submit form'}) }} I want to insert

How to minify Symfony / Twig generated HTML code to satisfy Google PageSpeed Insight?

When testing my Symfony 2.8 based webpage with Google PageSpeed Insights I am getting warned, that the HTML code is not minified. This is true, while Assetic

How to escape Twig delimiters in a Twig template?

Twig uses the {{ }}, {% %}, {# #} delimiters. But how can I display {{ }} in a Twig template? I'm not talking about HTML escaping. I ask the question as I wan