For assistance with theme development.

How to disable twig auto escape for specific template

Hi, I'm using Drupal 8.8.1

I created a module for generate rss feed. I created an twig template file podcast-rss-feed.html.twig under templates folder , below is my code:

How get node title in webform?

I have webform with fields: name, phone and hidden field product.
For hidden field I use token [current-page:title]
Alll pages of pruduct have the button that pops up a webform.
When submitting a form I would expect that [current-page:title] returns title of the current product page I'm currently on. Instead it points to webform title.
Please tell me how to get a real title?

Twig Filter replace

I need replace field value to some text if value equal 0
in node--new_material.html.twig

{{ content.field_cena }} - it displays the value

These filter versions don't work

{{ content.field_cena|replace({'%0%': 'some text'}) }}
{{ content.field_cena|replace('0', 'some text') }}
{{ content.field_cena.0|replace({'%0%': 'some text'}) }}
{{ content.field_cena.0|replace('0', 'some text') }}

nothing is displayed.

Please tell me the solution!

Collapsible blocks


I have a custom block and I want to make it collapsible sideways when it appears on my custom page. I have looked for examples but I found nothing helpful. Could you please guide me?


Grids in Views: Aligning Image


I have a view page with grids like the following.

How can align the image at the center of the grid cell with equal padding on all 4 sides?

I am new to css, your help is appreciated.

How to choose the flag type display mode ?

I created a type of "article" node. A user can flagged the nodes.

On the "full" nodes, I want to display the link for flagged and the total number of flag. With the latest version of the module it is easy because it supports the counter in TWIG.

On the "teaser" of the node, I want to display only the total number of flags. But in the node display mode, there is nothing to select the flag display mode.

How to choose the display mode of the flag type from the display mode of the node ?

It's a shame that this feature is not available.



Subscribe with RSS Subscribe to RSS - Theme development