Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
Hi there, I'm new to drupal since yesterday. I managed to make a custom theme and overwrite some templates by adding new .htm.twig templates for for example a block or a node(post type) I've also created a post type called 'persons'. I was wondering if it is possible to loop through for example all the person posts in a twig template.
I've already tried looking up specific ways. But none of them fit my situation.
What I basically want to a accomplish is something like this:
In my case I want to write some javascript code inside the paragraph-something.hmtl.twig taking elements from the theme variables and then putting this javascript attached to the bottom of the page. Something like:
{{ attach_library('my/code') }}
but being able to write the code dynamically and not link to a js file pre-comp.
I need to change the background of the parent li element for a submenu anchor element with the is-active" class. How do I add a "current" class to the parent li element? (that's one way to do it)
I don't think there's anyway to do it just using css and the existing classes that are available.
Why doesn't the Barrio theme (Bootstrap 5) support drop down menus? That's why I'm using Superfish. Bootstrap 4 supported drop down menus.