This forum is for assistance with theme development.

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:

Paragraph with multiple layout types - Best way to achieve

Hi

There are multiple ways to achieve what I need but was wondering if anyone could explain the `Drupal` (Version 8) way of achieving this.

I have four very similar paragraphs:

1. Title, subtitle and HTML copy (1 column 3 rows, full page width)
2. Two columns, each column containing content as per point 1 above.
3. Three columns with point 1 content in each column.
4. No title or subtitle. List of unordered bullet points instead of the HTML copy 

custom an input form

Hello,

I'm using bootstrap as a theme but I don't like the suffix of the bar search of an exposed field so I want to custom it.

I used {{ kint(suffix)}} in the input--form--control.html.twig and I got this :

'#value' =>Drupal\Core\Render\Markup(1)

protected string ->string(111) "<span class="icon glyphicon glyphicon-refresh ajax-progress ajax-progress-throbb..."

So I would like to set the span class...

I tried to work with preprocess function like this :

Modifying the global custom text of a view, it only modifies one language

When modifying the global custom text of a view, it only modifies one language, the others do not.

For example, when I modify this: https://i.imgur.com/JXjRrcp.png

And I delete this: https://i.imgur.com/7GAwosT.png

the page in the default language is displayed like this: https://i.imgur.com/3VDTJp5.png

Get reference entity values in field level twig template

I have created one custom block having reference entity field. I have two templates to render design. One is 'block--bundle--block_name.html.twig' and another one is 'field--field-field_name.html.twig'. 

Inside block--bundle--block_name.html.twig I have below code with some custom HTML-

{% block content %}        {{ content }}      {% endblock %}

And field--field--field-field_name.html.twig contains below with some custom HTML-

Pages

Subscribe with RSS Subscribe to RSS - Theme development