This forum is for assistance with theme development.

Theme changes not being reflected on website

Hi,

I created a local Drupal 10 site using ddev and Docker Desktop, and then I created a subtheme using drush:

ddev drush generate theme

But for some reason, once I wrote my CSS files, none of the CSS changes are being reflected on the website. The website is frozen with the default look of the subtheme (before I made my CSS changes).

Any ideas on why this might be happening?

Adding new css class to generated theme in Drupal 10

I have generated a new theme in Drupal 10 and am now modifying twig files. I have created a page--front.html.twig file from page.html.twig and am now making modifications to it. As part of the modifications, I want to change the css class layout-content to have a background color and thus replaced occurrences of layout-content with my-layout-content in this twig.html file

Change content link attributes - hook

Hi

I'm trying to change all occurrences of target="_blank" in my site's content but when using the link_alter hook it only seems to effect the admin menu.
Which hook should I use?

What I've tried

function MYNAME_module_link_alter(&$variables) {
 if (isset($variables['options']['attributes']['target']) && $variables['options']['attributes']['target'] == '_blank') {
  $variables['options']['attributes']['target'] = '_self';
}
}

Thanks

Cannot change default theme in Drupal 10

I am running Drupal 10 with Domain Access and was playing around with themes.

First, changing themes with domain-specific configuration wouldn't always work. Changing the theme with domain configuration disabled would work, for all subdomains.

Then, I tried the Domain Theme Switch module. Themes would change, but I could not configure them.

Field TWIG: how to get the #markup value?

Hello,

how is it possible to get the #markup value for twig treatments, before it could be formatted by other processes than the 'human_decimal' I need?
dump() show this structure:

[SOLVED] Unable to make twig suggestion for Views Table

I have twig suggestions turned on, and I need to make some display mods for the table.

The output is:

BEGIN OUTPUT from 'core/modules/views/templates/views-view-table.html.twig'

However, there are no suggestions.

What I tried in my theme folder were the following:

views-view-table-[viewname].html.twig

views-view-table-[viewname]-[block_x].twig

But none of these seem to work.

Pages

Subscribe with RSS Subscribe to RSS - Theme development