This forum is for assistance with theme development.

Drupal behavior execution and bigpipe

I keep struggling with getting JS executed when I need to target a DOM element that is added via bigpipe and when I'm logged in on my Drupal site.

The following code runs when I'm not logged in but never executes when i am logged in:

How print a media field into the bootstrap

Hi

To print a field type image in Bootstrap I use the following code and work fine

file_url(node.field_image.entity.uri.value)

 but if I want to print a Media entity don't work, some idea?

Thanks

Problem with Views and node--fws.html.twig - formatting page

New to Drupal and I'm not a program. 

In Drupal 9 I added a new content type "FWS," Created a view for the FWS content type. My problem is the pages generated by Views is not formatted. 

I created node--fws.html.twig to format the page, but it only half works. 

My first problem is I can't get the initial field, field_title, to display at all. The other fields display, but with the label and field value. 

Here's the HTML in the .twig

Remove link on users portraits in blog posts

Hello,

I search to remove the <a> link on the portraits in my blog posts on a Drupal 9.x

Here is a part of my page's code:

Get field value from hook theme_preprocess_field

Hi,

Working on a sub theme of Radix and trying to access the value of a node's field using the theme hook theme_preprocess_field.

This value can then dynamically set the css class of the rendered field.

In the code stub below the field name is accessible in the hook but not the value inside the field.

Adding site/home/front link in block content

I have just migrated to D9.

I need to add site/home/front link in custom block content.

In D7 this used to be easy: adding a site to site front (using PHP snippet):

<a href="<?php global $base_path; print $base_path; ?>" Go to this link </a>

I can't figure out how to do this in D9 since twig codes don't work here.

Can anyone suggest what to do?

Pages

Subscribe with RSS Subscribe to RSS - Theme development