Questions tagged [theming]
Use it for questions about rendering or modifying the HTML markup produced by a module/theme.
10,778 questions
0
votes
1
answer
19
views
Responsive Image Style module not respecting sizes provided
I'm not sure where I'm going wrong here. I'm working on setting up several responsive image sets for various sized images and starting with small. I have two image styles for this, one scales to 200px ...
3
votes
0
answers
36
views
CSP: Nonce value appearing on script but not policy
I'm using the CSP module on my site and attempting to add a nonce to my GTM script.
I'm able to get a nonce value on the script element, e.g. <script nonce="zRaBCyoyymExSEt4jIfolw"> ...
5
votes
1
answer
104
views
How does YAML inheritance for sub themes work?
I am working on a modules to extend themes. I would like to use a YAML file for this, so that I can define properties in THEME.MYMODULE.yml. But I am struggling to inherit the properties from a parent ...
0
votes
0
answers
85
views
To create a new theme, why not just copy starter_kit theme instead of run `php core`...? Or use drush theme generate as basis
The apparently official documentation, https://www.drupal.org/docs/core-modules-and-themes/core-themes/starterkit-theme , says to generate a new theme, do this:
php core/scripts/drupal generate-theme ...
-3
votes
2
answers
187
views
When should I choose "php core" or "drush generate theme" for the basis of a custom theme? [closed]
("We" as in developers in general)
Looking at what appears to be the official documentation, https://www.drupal.org/docs/core-modules-and-themes/core-themes/starterkit-theme there's a ...
0
votes
0
answers
40
views
how to print paragraph fields in theme [duplicate]
My Article content type has a paragraph field.
My paragraph at /admin/structure/paragraphs_type/myparagraph/fields has fields called field_big_text and field_small_text
I can print the paragraph field ...
1
vote
1
answer
65
views
How to create a custom Twig template for new user registration emails with a custom theme?
I'm working on a Drupal 10.4.6 site using a custom theme, and I need to customize the content and structure of the email sent to new users upon successful registration. Currently, the default Drupal ...
0
votes
1
answer
68
views
How to group webform elements (only) visually
In my webforms, I would like to (visually) group certain elements for my visitors:
I've successfully managed to build this using container elements (sections) in the Drupal webform backend ui.
...
0
votes
2
answers
332
views
Warning: Array to string conversion in __TwigTemplate
I've set up a 'content card' paragraph type which can be used to create blocks of content in a grid structure. Each card can have multiple taxonomy categories associated with it, eg: Video, quote, ...
0
votes
0
answers
62
views
Why isn't this giving me a working twig function?
I am trying to create a twig extension (for D11). The extension should allow be to get the value of a url parameter by giving in the 'name' of parameter.
I've setup everything, and I'm still getting
...
0
votes
0
answers
51
views
Preprocess function name for a specific view and specific field
The API document the function mytheme_preprocess_views_view_field
But it is not explained how to address a specific field in a specific display of a view.
Can someone explain this here ?
0
votes
1
answer
81
views
How to render an image from a reference field?
Currently, I am rendering image like below:
<img src={{ file_url(content.field_hero.0['#entity'].field_featured_image.entity.uri.value) }} alt={{ content.field_hero.0['#entity']....
0
votes
1
answer
92
views
How pass a variable to a custom form template?
with Drupal 10.3.x. is possible to pass a variable to a form template?
I am building a custom form. Without variables, the template works: if I define the template as
function my_module_theme(): array ...
0
votes
1
answer
88
views
Programmatically rendered menu not visible to anonymous users
I'm trying to setup a subnav system on my site so that content creators can select a menu via a reference field and that menu will be rendered on that page.
I have this field working on one of my ...
0
votes
1
answer
58
views
How to make the more link of a view in a template?
In Drupal 11 I created a view with the more active link to a page. I want to modify the template to display the link in a href, but it does not work and I only want the raw link.
How to make the more ...