This forum is for assistance with theme development.

Twig templates vs HOOK_form_alter. Which is better for form field customizing?

Recently, I was discussing some theming challenges and the suggestion was made that I should use HOOK_form_alter over custom twig templates. But an explanation wasn't really provided. 

It got me thinking, my theme I'm building is starting to amass a large number of twig templates for pages and fields. Probably about 30 - 40 right now. This is because some form elements require editing 2 - 3 templates to tap into all areas of the field. i.e. page template > form element container template > form element template > input template.

Bulma/Octavia theme , moving side bar from tight to left : SOLVED

Hi, I saw a few nice themes, which i want to use. But unfortunately the side bar is on the right. I want to move it to the left. Has anyone a clue for me?

Thanks,

Fred

Change Bartik Powered by block

Maybe a silly question. Is there a way to change the default poweredby block. And if can i also add a php code in it to get te current year? Such as this: "Copyright 1995 - <?php echo date('Y');?> "

Thanks

How do I make a theme suggestion using a field ID and the node ID?

I'm trying to make a theme suggestion for a form element. I would like to use the field ID and the node ID. So, for a form element with field ID 'first name' on node 23, the suggestion would be: form-element--first-name--23.html.twig

I cobbled together the function below with some elements from this article, but it doesn't work. Drupal 8 / 9 – Adding theme suggestions for node id specific field template.

how to override parent theme's function ?

I'm making a subtheme and I need to replace a function of the parent theme (defined in .theme file) by my own. How can I do that?

for example if I want to replace
function theme_preprocess_html(&$variables)
by my own function?

thank you for your help

How to change banner image with the seasons?

The banner on our (Drupal 8) town website is a photo image of autumn leaves.  I would like to be able to change the banner photo according to the season.  Could I use the Rotating Banner module to upload and sequence the photo images?  That is, can duration be set in days or weeks instead of minutes or hours?  If not via the Rotating Banner module, how else might a seasonal banner change be managed?

Pages

Subscribe with RSS Subscribe to RSS - Theme development