This forum is for assistance with theme development.

Pass Simple Query Result Into Twig

Hello, I'm currently undergoing an internship, our task is to make a custom twig to display, for example a list of taxonomy terms, I've added a vocabulary with a few terms.

I did this in two ways, for reference the DB table and rows are:
'taxonomy_term_field_data' and there I have my name row with the name(genre) of the movies.

Twig translated links not working correctly

I have 4 buttons with 2 languages and get them in Twig by

{% set buttons = view.field_link_button['#items'].value %}

{% for btn in buttons %}
<div class="text-center">
   {{ link(btn.title, btn.uri, {class: 'btn'} ) }}
</div>
{% endfor %}

and per each content have 1 link as below

link 1:

  • '/books'
  • '/fr/books'

link 2:

  • '/mags'
  • '/fr/mags'

link 3:

  • '/authors'
  • '/fr/authors'

link 4:

{{ title }} _in_ the view (page)?

I have a view (page) for which I removed the title block (which outputs the view-title) because it doesn't allow me to implement the design as request (need a wrapper around the view title and the exposed filters).

So I need the view title _in_ the view and the code is there ...

Warning: imagesx(), imagesy() and imagecopyresampled() in dashboard area

If i create or edit any content included images, i get this error in dashboard and the weird thing is that disappears after refresh browser

my PHP Version 7.4.20 and also GD enabled

form_element override

to have more control on each radio button of my custom module also to add onclick action for each element i have to override form element template to prevent affect other elements, so i used

function mymodule_theme_suggestions_form_element_alter(array &$suggestions, array $variables, $hook) {
  $suggestions[] = $hook . '__' . $variables['element']['#id'];
  $suggestions[] = $hook . '__form_id__' . $variables['element']['#id'];
}

and have

menu-local-task - changes do not work

Hello!

I am making theme for Drupal 8 || 9, based on Classy templates.
I need to make some changes to the display of links in menu-local-task.html.twig file. But any changes to it don't work.

In theme.info.yml file base theme is: base theme: false
Classy templates inside my theme folder.

Pages

Subscribe with RSS Subscribe to RSS - Theme development