This forum is for assistance with theme development.

What is the Correct Method to Retrieve the Node ID of an Item in menu.html.twig?

I am a Drupal beginner; is this approach correct? Are there any other methods?

In menu.html.twig, I successfully used the following statement to retrieve the node ID of an item:

item.original_link.pluginDefinition.route_parameters.node

Display problem with Bartik 1.0.2 Theme with Drupal 10.1.6

Hello friends,

I am using Drupal 10.1.6. I want the theme like Bartik, because change the color of all section is easy. I installed Bartik theme and the Color module. When i make the Bartik theme as default, screen becomes very big. Only Logo takes the full computer screen. Please gide me to resolve the problem.

Thankyou & Regards

Problems after activating Stylizer

Hello
Sorry about this, but I am working with Drupal 7 and i'm in trouble...

I activated the "Stylizer" and "Colors" modules.
After i did that, the edit article page is different: Now I have more fields, and some buttons doesn't work - i cannot change from plain text to php editing, for example. I deactivated the modules, but the changes persist...

I am searching about it and trying solutions, but I cant understand what happened. I assume i have different codes that conflict with each other.

Display svg image paragraph field with Twig

Hi,

I'm trying to display a single <div> with 3 fields from paragraph:

  • field_svg = svg media library file (I use the svg_image_field module that deals with D10 media library core module)
  • field_first = integer
  • field_second = text

The following code works fort field_first and field_second. NOT ok for field_svg, of course.

Display field suffix in Twig

Hello,

in the paragraph field "myparagraph", I'd like to display the field_first value AND ALSO the field_first SUFFIX.
I setup the field in order to display both prefix and suffix. That works when using the common Twig code {{ content.field_fieldname }}. NOT when displaying all infos like that:

creating a navbar layout the right way

Hey, 
I am trying to make a navbar with search box as shown below:

https://ibb.co/D1xCHQQ

Usually I would create a twig block and use twig module to import the blocks all into one then add css to make it display flex.

As I am self taught, I would like to know if there is a better way to achieve this layout without the need of creating custom twig files. 
I am trying to find ways to use minimal custom twig files. 

Any guidance is highly appreciated. 

Pages

Subscribe with RSS Subscribe to RSS - Theme development