Questions tagged [theming]

Use it for questions about rendering or modifying the HTML markup produced by a module/theme.

Filter by
Sorted by
Tagged with
0
votes
1answer
505 views

How to get the managed_file progress bar working in a custom theme?

I'm trying to get the managed_file progress bar working in a custom theme. Right now, when I start an upload, the empty progress bar widget appears in the form, but it doesn't visually update while ...
0
votes
1answer
7 views

Fetching and rendering custom-library generated blocks in twig

I am using the following code in my theme to fetch 3 blocks (each containing 4 fields) generated via the custom block library interface i:e all 3 block are of the HomePage-Block type: function ...
0
votes
1answer
763 views

How to change background image based on current node?

I am trying to change the header background image of my website based on the current node. I have added an image field to my content type, field_hero_image, and, in preprocess function ...
0
votes
1answer
21 views

Output node reference field data in page.html.twig

I have a homepage node-type in which I have an entity-reference field holding 3 references to 3 separate custom blocks. The theme I'm working on requires that my 3 element reference field needs to be ...
0
votes
0answers
20 views

Can not override template for specific view

I'm new to Drupal so this might be a noobish question. I have a view called 'Category' where all posts are listed that belongs to the chosen category. I would like to override the views-view-...
2
votes
2answers
1k views

How to override a module theme function in a custom module but still allow themes to override the template file?

I'm writing a fairly simple module which allows the removal of colons from field output on a per field basis and I need to override the core field module's theme_field function in my module. I can ...
0
votes
0answers
10 views

Exposed form block disappear when views has no results

I created a view template for my website in which i put my exposed form block with twig tweak module. It works when there is at least 1 result. But when my view has no result, the exposed form ...
0
votes
1answer
884 views

How to override views-view-field.tpl.php in custom module?

I am trying to override views-view-field.tpl.php in my custom module as suggested in override views-view-fields.tpl.php in custom module but looks like it's syntaxes are old. My codes are like: In ...
0
votes
1answer
36 views

Naming convention for field type templates?

It seems that the naming convention for field types is undocumented. Looking at the classy theme shows a seemingly arbitrary convention. For example, the Text (formatted, long, with summary) type as ...
1
vote
1answer
21 views

twig template suggestion for comment reply form

there is no template suggestion for a comment reply form in Drupal 8, how can i create one? i am not talking about the reply form displayed in the node for which Drupal suggest a template : field--...
1
vote
1answer
19 views

separate the page title from page content

I am using {{ page.content }} to print all my page content. It is printing my all content but I want to remove title from this content and print it separately in different div structure (without using ...
3
votes
1answer
540 views

When reimplementing Drupal.tableDrag.prototype.dropRow(), how do I access classes of would-be parent?

Using code below, I can access classes of a row that's being dropped: Drupal.tableDrag.prototype._dropRow = Drupal.tableDrag.prototype.dropRow; Drupal.tableDrag.prototype.dropRow = function(event, ...
0
votes
1answer
1k views

How do I print the node title and body?

This is the code which I have put in node.html.twig. It doesn't print the body and title of the node, whose bundle is Basic page. How do I print node title and body of a node? {% set classes = [ '...
-1
votes
1answer
58 views

Specifying display of a new Paragraph type with images using HTML/twig?

I created "figure" Paragraphs type, which contains an image field and a caption field. How (from start to finish) do I specify in HTML/twig how to render this new Paragraphs type? As an example, how ...
0
votes
1answer
81 views

Template preview not working properly

I've got a huge problem with my template preview. For all of my post (page, article and so on), I have not the good region in my page. My theme is extended Classy. If I go to see the page (not ...
1
vote
1answer
803 views

How can I make a template for a product type in Commerce?

I want to be able to write my own markup for the fields (see image below) of each product type – how do I do this? My main reason for this is that I want to group them with my own HTML rather than the ...
7
votes
6answers
15k views

How to print paragraphs in twig template?

I have a content type, basic, where i have added a Paragraph field field_pr that has two fields: field_text, field_color. I have a twig template node--basic--full.html.twig where I want to print the ...
0
votes
2answers
775 views

How can I rewrite the output of image field to become a div with this image as a background image?

I have a view to display a content that have an image field, and I need to display this image as a background image of a div so I can apply some CSS on it. what I tried to do is to rewrite the output ...
3
votes
2answers
10k views

Override form element twig template

I want to override the twig template for specific fields on a form which I created via the Contact module in Drupal 8. However, I can't find any documentation, and the suggestions in the HTML ...
-1
votes
0answers
23 views

How do I apply HTML IDs to field output result?

I'm trying to build a block for tb_megamenu of a view of items of a certain content type. I want to use some JavaScript so that when the end user hovers over a title then associated content appears on ...
0
votes
2answers
604 views

Add class to all labels in a comment form

Pretty straight forward. For every label within a comment form, I wish to add a particular class to it. Using only functions in template.php, in Drupal 7, how can this be done? If it can't be done ...
-2
votes
0answers
34 views

How to get BOOLEAN value of a Media Image in node.html.twig?

I was able to get the URL of the verctor_graphics reference media field with the following code: file_url(node.field_vector_graphics[0].entity.field_media_image.entity.fileuri) But how can I get the ...
1
vote
1answer
1k views

print custom image field for taxonomy page (page--taxonomy.html.twig) template

How do I load an image from a taxonomy custom field into a custom location on the taxonomy page template? It's easy to accomplish it when the image is in a node. The following code works for images, ...
-3
votes
0answers
22 views

A simple way to add a background image to content region [closed]

I tried the background image module, but it give me various issues. Is there a really simple way to add a background image to all the website on the content region? The theme is Bartik.
0
votes
1answer
611 views

Panel content page not displaying correctly after restoring backup on different server

I recently had to restore a backup to a new server, and many things seem to be working fine, but others are not. For example The panes page which is suppose to show links neatly on the page in a ...
-1
votes
0answers
87 views

How to add theme hook suggestions for admin theme

I would like to style one of my custom post type edit screens in the admin section differently from others. It is actually a slider and I would like the content editor to have drag/drop alignment ...
-1
votes
0answers
17 views

How to add taxonomy term description to page--taxonomy--term.html.twig? [duplicate]

How can I add a taxonomy term description field value into page--taxonomy--term.html.twig?
0
votes
1answer
972 views

Theme video-embed-iframe.html.twig by content type

I am using Drupal 8 and trying to theme video-embed-iframe.html.twig by content type. with the current naming suggestions this is not possible. I am using Media with video embed field containing in ...
0
votes
1answer
976 views

How to get url and description of FileFieldItemList's items in node template

I have a content type called publication which results the node's twig template: node--publication.html.twig. This content type contains a multiple file fields where the description is allowed. I ...
1
vote
1answer
170 views

date_popup + theme = infinite loop

I'm trying to create a templated form including date_popup field in a custom module. There is a very basic example : mkl_variousTest.module ( dependency : date_popup from date API ) <?php //...
1
vote
1answer
602 views

programmatically create one bean block to the default theme

I am trying to programmatically create beans in a custom module using entity_metadata_wrapper. This is creating a bean for each installed theme. (In Drupal 7) Is there a way I can create only one ...
1
vote
1answer
671 views

How to set a field value from parent template in Twig?

I have node--article--teaser.html.twig which calls image-formatter.html.twig to printout the field_image. Everything works fine except that I don't want the field_image itself to be a linked. i.e ...
0
votes
0answers
17 views

How to get drupal to check for a twig template in the active theme folder before checking the module folder?

I'm developing a contrib module for Drupal 8 that sends email notifications to group members when new content has been posted in groups they have subscribed to. The module defines some new view modes ...
1
vote
1answer
30 views

Suggested template file is not working for Custom Search's template

I have installed Custom Search module for my drupal7 setup. I am trying to modify template files for search-result and search-results. By default its using template files from contrib module's theme ...
-4
votes
1answer
41 views

How do I add CSS classes to all the form elements?

How can I add the same CSS class (form__text) to form elements in Drupal 8?
0
votes
1answer
772 views

Unable to fetch paragraph's multi field values inside node twig

I have a content type as "worker". I have a Paragraph "test" and I am referencing "test" paragraph inside my content type "worker". This allows multiple values to be saved. How can I get the multiple ...
0
votes
0answers
32 views

Add a region to the page--front.html.twig

I've created a few new region in my yml regions: header: "Header" jumbotron: "Jumbotron" chiffres: "Chiffres" steps: "Etapes" presentation: "Presentation des formules" ...
0
votes
1answer
22 views

How to check if custom variation field is null in twig?

I would like to know how to check if a custom variation field has content in a twig template (commerce-product.html.twig with variations injected). I have tried with some filters and conditions but ...
0
votes
0answers
11 views

Mode display specific Media Image formater template

i am having this template suggestion function amu_www_theme_suggestions_image_formatter_alter(array &$suggestions, array $variables) { $entity = $variables['item']->getEntity(); $...
3
votes
1answer
611 views

How to change the title of a modal window?

I have a link that displays a modal window. The link redirects to a page view. When I click on it, it is marked in the title of the modal window Array. How to customize the title ? <?php ...
1
vote
1answer
596 views

How to override template for view mode of a entity within a module?

I see in theme suggestion array that I can override template for my custom entity type based on view mode like this: custom_entity__custom_entity__view_mode_name Now I want to put custom-...
0
votes
1answer
589 views

Theme file upload form element

I want to theme all the file upload fields on my site but I don't know how to name the template file. I want to alter the form-element.html.twig file but as I have multiple file fields I don't think ...
0
votes
0answers
26 views

How to reference on Computed Twig in another Computed Twig

I am creating a webform that collects data on the number of private offices that a company wants in their workspace and then does calculations based on those quantities. I can easily do the basic ...
2
votes
1answer
25 views

How to pass field value to referenced node template?

I have content type A. It has field reference to content type B. I'm rendering referenced node B from content type A twig template like: {{ content.field_referenced_object }} And that works well. ...
0
votes
1answer
615 views

Insert a collapsible fieldset or region in a panels layout

I created a custom layout for a panels display and I would like to have a region or multiple regions in my custom layout be collapsible with javascript/jquery. Ideally the state of the collapible ...
1
vote
1answer
877 views

How do I customize node.tpl to print an entity reference field in a specific format

I have content type called collection that has an entity reference field (multiple) that references another content type called books. One the collection node page, I want to render all of the books ...
1
vote
1answer
888 views

Block overriding with template file doesn't work

The Drupal version I'm using is v7.34. I'm using sub-theme created from Bootstrap as base theme. My problem is, I want to override the "User Login Block" and put it in the header region (top bar), so ...
0
votes
4answers
71 views

How can I design the standard user login form with twig?

I want to change the labels "Username" and "Password" and delete "Create new account" link of the standard login form of Drupal 8. Is it possible to do this with twig?
1
vote
1answer
339 views

How can show pdf preview first image?

Hope you can help me. I use drupal 8. I want pdf preview like this http://prntscr.com/j08ljo. Need uploud pdf file in node and showing just first image in front page. I check use module pdfpreview ...
4
votes
2answers
8k views

How do I theme exposed filters?

I'm theming a Drupal 8 Views page. I created the twig template file and can output the 2 exposed filters with the code below. The problem is that nothing happens when I click Apply on the exposed ...

1
2 3 4 5
207