New answers tagged

1 vote

How to force the browser to refresh the CSS/JS files

After changes you also have to increase the version number in your library.yml file to generate new aggregated CSS files.
Hudri's user avatar
  • 5,463
0 votes

How do I get the node URL in a Twig template?

This worked for me: <a href="{{ url('<current>') }}">{{ 'Reload'|t }}</a>
Joe Hyde's user avatar
  • 220
1 vote
Accepted

How do I get the image URL with the same style setting in Manage Display?

If you only want to get style img url can use paragraph preprocess hook like this: use Drupal\Core\Entity\Entity\EntityViewDisplay; use Drupal\image\Entity\ImageStyle; function ...
mini's user avatar
  • 802
1 vote

How do I print the help text description above the field for all textareas?

There is a module for this, which supports Drupal 7,8,9,10+ https://www.drupal.org/project/top_description
JamesWilson's user avatar
  • 2,148
0 votes

How do I get the image URL with the same style setting in Manage Display?

You need to get image style in paragraph preprocess hook: use Drupal\Core\Entity\Entity\EntityViewDisplay; function Mymodulename_preprocess_paragraph(&$vars) { $component = EntityViewDisplay::...
mini's user avatar
  • 802
0 votes

How to disable ampersand encoding in {{ attributes }}

The combination of both, |replace and |raw, does remove the encoding. <div {{ attributes|replace({'&amp;': '&'})|raw }}> I needed data-attributes to remain untouched, the closest I got ...
Hudri's user avatar
  • 5,463
0 votes

Twig LoaderError: Template is not defined

I came across this error when I wanted to use a database state, which was created with Version 10.2.2 and my Drupal instance was on 10.1.2. Updating fixed the issue.
burk3rt's user avatar
0 votes

HTML style attributes have a prefix in their values after changing directory and settings

While doing this I updated the htaccess file and drupal's settings.php to make sure references to the root directory There is nothing to do in these files or others to change the directory from where ...
4uk4's user avatar
  • 99.2k

Top 50 recent answers are included