New answers tagged theming
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 ...
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['...
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.
...
0
votes
file_url() produces no output
Try:
file_url(content.field_video['#items'].entity.uri.value)
Note this does not directly support translations.
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-...
-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....
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'
-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.
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 ...
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 ...
0
votes
phpwkhtmltopdf engine pdf printing configuration issues
The location has to be configured as per this picture
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. ...
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();
...
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 ...
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....
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>
Top 50 recent answers are included
Related Tags
theming × 107317 × 2740
8 × 2498
views × 1444
entities × 724
nodes × 724
blocks × 628
forms × 536
javascript × 428
hooks × 410
media × 314
users × 305
navigation × 296
6 × 292
routes × 284
taxonomy-terms × 225
panels × 165
commerce × 160
webforms × 129
9 × 121
caching × 111
paragraphs × 106
comments × 103
search × 99
files × 96