This forum is for assistance with theme development.

Inherite theme suggestions created by the parente theme

I have a theme X that implements X_theme_suggestions_page_alter. It adds a new template suggestions named "page__fwidth" for some content types.

When the theme X is enabled the theme loads the file named page--fwidth.html.twig for the desired content type.

Now, if I create a sub-theme Y that has X as the base theme and activate it, the suggestion defined by X is not available. Probably because the file X/X.theme is not loaded. How can I have all the stuff in X.theme loaded when the theme Y is activated?

Thank you

How to add javascript in head tag?

Hello, i am new in Drupal. I need to add a script in js to the <head></head> tag. Where is this part of the body in the drupal template.

I am working with drupal 9 and 10. Thanks you help.

Olivero, customize grid layout

Olivero's sidebar (.sidebar-grid .region--sidebar) is a bit too small, especially on the larger screens, to insert graphically interesting contextual blocks.
How to enlarge it safely?
I tried overriding in a custom-grid.css the grid-columns of '.sidebar-grid > .site-main, .sidebar-grid .region--sidebar' and apparently it works.
I'll probably have to increase the max-width of page-wrapper a little as well.

Then in cascade I will possibly have to make adjustments for the various @media.

Twig file don't get the value of Texonomy

Friends,

I created a view with four fields. Two of them are text fields and other two get the value from texonomy. I created four "Twig" files for eatch field.

1. Text field

views-view-field--dictionary--page-1--title.html.twig

Code used for output

{{row.content['#row']._entity.title.value}}

2. Text field

views-view-field--kosh--page-1--field_meaning.html.twig

Code used for output

{{row.content['#row']._entity.field_meaning.value}}

3. Value from Taxonomy

views-view-field--kosh--page-1--grammar.html.twig

Attacking /admin/flush

Hi,

We have a government client for whom we have built a Drupal website. Their IT Team has responded back with the following.

"When they are scanning they are attacking /admin/flush as a credentialed scan its doing a brute force as admin to this resource which is constantly doing a cache rebuild in drupal. As such the site never responds back by the time the second “attempt” happens and it falls over because constantly clearing the drupal cache never happens.

"Demonstrate block regions" and new regions

I did read the document at the URL below (Adding Regions to a Theme).

https://www.drupal.org/docs/theming-drupal/adding-regions-to-a-theme

The regions part of my .info.yml follows.

Pages

Subscribe with RSS Subscribe to RSS - Theme development