New answers tagged

0 votes

building a subtheme using stark as the base theme but getting this error in the info.yml

You need to pay attention to the details. Theme machine names (name of files) need to be all lowercase. Your .theme file is missing an opening <?php tag. Global-styling: needs to be lowercase as ...
leymannx's user avatar
  • 17.6k
1 vote
Accepted

How can I get the numeric ID for a block from within the block template or hook_preprocess_block?

You can check yourself with Xdebug or Kint. /** * Implements hook_preprocess_HOOK(). */ function MYMODULE_preprocess_block(&$variables) { // Check if it's a content block. if ($variables['...
leymannx's user avatar
  • 17.6k
0 votes
Accepted

Why can't I disable CSS caching?

For some reason, the isolated fixes didn't work for me. After many more attempts, I was finally able to find a solution that works for me, and it turned out to be a combination of most of my attempts. ...
GeorgeCiesinski's user avatar
0 votes

file_url() produces no output

Try: file_url(content.field_video['#items'].entity.uri.value) Note this does not directly support translations.
Prestosaurus's user avatar
  • 1,997
0 votes

How do I theme a modal popup?

Have you tried this? On your custom module, add a file custom_module.module If you already have that file, edit it, and add this function custom_module_theme() { return array( 'twig-template-...
Pedro's user avatar
  • 124
-2 votes

How do I set the title tag for the maintenance page?

If you have access to the backend, you can modify the string directly for a temporary change. Change /var/www/html/ to the location of your install and other strings to fit your needs. Login with SSH....
Michael McMahon's user avatar
1 vote
Accepted

How to remove a region from a content type?

Try to force install 5.0 version, that has D10 support: composer require 'drupal/context:^5.0@RC'
Vanish's user avatar
  • 116
-1 votes
Accepted

View not showing result based on taxonomy term contextual filter

I found the taxonomy_index table have missing data, so records did not show.
Drupal's user avatar
  • 1
1 vote

Why can't I disable CSS caching?

It's definitely the browser as commented by @No Sssweat. Clearing the browser cache should load a new version of static CSS files. Also putting the browser in dev mode or configuring the webserver to ...
4uk4's user avatar
  • 97k
0 votes

How to send variables to a custom theme from a custom module

Below Should work. In your hook_theme inside .module, set the variable you want as array or value in the variables. $item = 'Test content'; 'variables' => [ 'content' => 'content value ...
salah-1's user avatar
  • 214
0 votes

phpwkhtmltopdf engine pdf printing configuration issues

The location has to be configured as per this picture
Diana's user avatar
  • 3,264
2 votes
Accepted

Struggling to enable twig debugging

Since Drupal 10.1.0 Twig debugging seems to be actived/deactivated according some settings stored in the state table: Change record. This prevents that these settings can be accidentally committed. ...
leymannx's user avatar
  • 17.6k
0 votes
Accepted

Is there a reliable way to show Drupal messages from JavaScript?

This API available in Drupal since 8.7.0. See details here. Just an example: const messages = new Drupal.Message(); // Probably you want to clean up previously rendered messages: messages.clear(); ...
voleger's user avatar
  • 950
0 votes

Override user login form template

In addition to Yuseferis answer: I'm using this function to add theme suggestions for forms in Drupal 10: /** * Implements hook_theme_suggestions_HOOK_alter() for form templates. * * Make forms ...
Ralf E.'s user avatar
  • 31
0 votes
Accepted

Override Default Theme's 'page' TWIG template, but not the original page template pre-process hook

It seems like you want to override the page.html.twig template for specific pages while still benefiting from the preprocessing logic provided by your theme's bootstrap_barrio_preprocess_page function....
Z CHAMP's user avatar
  • 32
0 votes

how to print view title in views-view-unformatted.html.twig?

How do I get the URL value in the views-view-unformatted--domains_devs.html.twig? I'm using D10. <a href="[My_Link]"/>Go to Link</a>
harikris's user avatar
  • 349

Top 50 recent answers are included