This forum is for assistance with theme development.

Override a view button - no file name suggestion

Hello

I have an exposed field with a button that I want to override.

I tried to override with input-button--submit.html.twig but it affects all buttons of my website. I only want to override the button of my view.

Anyone can tell me how to override a view button ?

Thank you.

Custom Template - Use Existing Field Content

I am trying to include a custom template in a MODULE.

This tutorial is helpful getting started...

https://www.drupal.org/docs/8/theming/twig/create-custom-twig-templates-...

But it only shows you how to create a random variable in the controller. When I try to create a template for a custom node type in my module, it can't access the {{ content }} at all. How do I pass {{ content }} into the custom template?

Extending Templates in Modules

I have a template in a module. I would like to extend that template. It seems like the usual way to do this is by referencing the directory like this:

{% extends directory ~ '/templates/paragraph--card.html.twig' %}

But the "directory" variable seems to be set to the current theme directory rather than the module directory. So, instead, I have to link directly to the file like this:

Custom template for node preview?

I have a twig template with a custom layout for a specific content type. I would like the node preview to use the custom template. There does not seem to be a method for doing this. The template naming conventions do not address preview modes, and none of the file name suggestions in the twig debugging info address my particular content type. Is there a method for doing this?

Custom template for a form build in a custom module

Hi,

I have form that is build in a custom module and using the debug mode I can see its using the core templates currently. But I need to use custom templates to theme the form and its fields. How can I make custom theme suggestions and use custom templates for some specific fields or use one custom form template and all the fields.

Drupal version: 8.5.6

Thanks.

Contact form reference to an entity

Hi,
I have a site on a Drupal 8. I would like to include a reference to an entity in a contact form.
I explain myself:
On each page of my 'Product' content type, I have a contact form. In my content type I have a field called "field_reference". I would like to be able to create a field in my contact form that refers to this field but that the user does not have to fill in. 

If my product "A" reference is: 123
In my form I would like to have:

Pages

Subscribe with RSS Subscribe to RSS - Theme development