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
-1
votes
0answers
9 views

Magnific Popup (mfp) does not show alt or title in bottom bar (D7)

I have an existing site built in D7. I've created a new page that displays a views based grid of images of one specific content type. When you click on an image, magnific pop-up creates an overlay ...
0
votes
0answers
8 views

field widget form element not updating #attributes via #ajax callback

I am trying to do a simple update to a form element in my field widget, I have a start and a end dates in the field widget and I need the start date to be the min date of the end date, so I call an ...
1
vote
1answer
19 views

How to add template suggestions for form elements of a certain form ID?

I'm looking to edit some Twig templates for certain form elements, but I need template suggestions only for certain form IDs. How do I go about that? I currently have the following functions in my ....
-2
votes
0answers
12 views

How do I theme multiple uploaded files?

I want to create a file field where I can upload multiple files but I want to change design of the uploaded file. I want to remove checkbox, I want to display only count of the file instead of name of ...
0
votes
0answers
9 views

Show field conditionally + display each form part in div

I've followed the tutorial in order to create field conditionnaly, but the field is always shown. This is possibly due to the way I'm calling my form ? And if I do as I did in my template, how can I ...
0
votes
1answer
15 views

Adding Count Up module to custom front page

My end goal is to put several Count Up numbers on my custom front page. But I'm having trouble getting it implemented. First, I installed the Count Up library (https://github.com/inorganik/CountUp.js) ...
0
votes
0answers
19 views

Using TB Megamenu, how to close one submenu when I open another submenu?

I'm building a couple of (Drupal 8.9.13 and Drupal 9 based) sites where I use TB Megamenu megamenu module (https://www.drupal.org/project/tb_megamenu) to create the menu. All is working fine on ...
0
votes
0answers
14 views

Adding layout builder enabled template suggestions on page-level twig

I want to detect if Layout Builder is enabled (D8), so that I can add a new page and page-level twig templates that will allow a completely different structure for my site - in this case based on ...
0
votes
1answer
31 views

How to add custom attributes to description meta tag?

I need to add 'class' and 'data-type' attributes to meta tag containing description attribute. I was able to locate the core Metatag module, however I'm unable to find any documentation on how to ...
0
votes
0answers
19 views

CSS is not loading when create a new template node from newly created content type

The issue me having is that i cant able to successfully create a new page from newly create Content Type (if i use existing content types for create node template its working properly). i have tried ...
0
votes
1answer
16 views

How to create a template for the product variation?

I have enabled debugging in the drupal service file. My product type display the rendered entity of the RSS view in the variation field. When I inspect a product page no model for the variatin is ...
0
votes
1answer
26 views

How can I style the webform submissions table?

Using Drupal 9 and Webform, I'm unable to find the twig template used to output /contact/form/submissions. Is there a place in the documentation that lists the twig templates? I see there is a View ...
0
votes
0answers
59 views

jQuery dependency on a custom theme is not adding jQuery?

I know that this question has been asked previously many times but any of the solutions are not working in my case so please, I request if anyone can help me with this situation please provide me ...
1
vote
1answer
48 views

Twig: How to show static text in the template to the Anonymous User?

On a Drupal 8.9.13 website, I've removed the permission "View published content" from the Anonymous user. By default, when someone visits the front page, Drupal will then display: Access ...
0
votes
0answers
8 views

How do I fix Bootstrap 3 logo dropping down below navbar

I will be working on a project soon using drupal 8 that has bootstrap 3 installed. so I set up a test server (located here: test server) to start familiarizing myself. I figured out a bunch of things,...
0
votes
0answers
9 views

How to display webform multiple results in a table rather than a list

On the webform page itself (data entry), it's possible to instruct a composite element that allows multiple values to "Display elements in table columns" (under Build » Advanced » Multiple ...
0
votes
1answer
14 views

How to display specific button for certain user?

I have a simple Drupal 7 page with 3 buttons. Page is only accessible by logged-in users. I have 3 roles - role 1, role 2 & role 3 What I would like to do is to show only button 1 when a user with ...
1
vote
1answer
41 views

Why is the CSS in my sub-theme not working? [closed]

I'm a Drupal newbie, but hoping someone can assist. The site was working okay, but I've tried to implement a sub-theme and things seem to have gotten messed up. What I was trying to achieve is to ...
0
votes
1answer
18 views

Twig adds an unwanted 'row' class that doesn't appear in class array

My site theme includes customised templates for 4 regions in the footer, all containing identical code: set classes = [ 'region', 'region-' ~ region|clean_class, 'col-sm-12', 'col-md-...
0
votes
1answer
30 views

Is there a way to see all the available variables inside content?

I am using Drupal 9 with twig files I have a page where in one section I need to show thumbnails of the latest posts. So I created a new view as a block, and placed this block under Content in admin/...
0
votes
0answers
21 views

How can I add the current node author to JSON-LD tag?

How we can show author name of node in head? I've created a schema html.html.twig file where I need to display author name without input in meta tags in admin. I want to get dynamically. <script ...
0
votes
1answer
22 views

What am I doing wrong in my theme that's breaking CAPTCHA?

I have a bug in my CAPTCHA implementation. When I click the "Get new captcha!" link, it does not refresh the image CAPTCHA. After a ton of research in issue queues, testing and breaking my ...
0
votes
0answers
15 views

What is internalviewpath in html template suggestions

Top of the list of template suggestions for the html template says: html--[internalviewpath].html.twig The internalviewpath part is confusing. Is it a normal path(eg: node/123)? Is it related to ...
0
votes
0answers
12 views

Customizing book-tree.html.twig

I'm looking at the book-tree.html.twig template and I want to achieve two things. I've searched the web and experimented a bunch and have had no luck. Here's the template: {% macro book_links(items, ...
1
vote
1answer
16 views

Pass values to twig file from #theme options

I need to create a select field in a config form and pass values to it along with custom #theme options. Its easy to pass header & row values. But after selecting a value from select box, I need ...
1
vote
2answers
37 views

How to find the url of a media library image field in a preprocess function?

I have a preprocess function that I am using to grab one of 3 profile images. Basically we're replacing a couple stand-alone image fields with a media library reference field. The goal is to display ...
1
vote
2answers
73 views

Twig conditional render if specific field in array of referenced entities contains text

In a Twig template, I'm conditionally rendering a sidebar based on whether custom field content.field_body (Paragraphs entity reference revisions field type) contains any items. {% if content....
0
votes
1answer
25 views

Dynamic value in Twig or preprocess based on config and getHost()

I need to dynamically change a value in Twig templates by selecting a configuration value (defined in a custom module) based on the current environment. I did the following in a Form class, which ...
0
votes
1answer
33 views

Show a summary calculated from webform submitted values on the submission preview page only (not on form) and re-use in e-mail handler

We need to display a computed summary of submitted information on both the submission preview page and in e-mails that are sent out. I'd expect this is a common usecase and wanted to check if i'm ...
0
votes
1answer
14 views

Twig template for content in body

I want to put some custom information in the content area of book pages (so, after the author info and before the add child page, etc. links). In the node template, the content comes in with both the ...
2
votes
1answer
26 views

How to properly check the menu for emptiness in twig?

I use Simplify Menu to display the necessary menu markup. How do I make sure that the menu is not empty (there are items there) and if there are menu items, they are enabled? {% set items = ...
0
votes
0answers
18 views

How do I create a custom administration sub-theme without the tools block name collision?

A subtheme was created using the drupal console in order to customise the mediteran administration theme. vendor/drupal/console/bin/drupal generate:theme --base-theme mediteran When I try to install ...
-1
votes
1answer
44 views

Why can't I override the base region.html.twig template

I created a custom theme that has the bootstrap_barrio contrib theme as base theme. Everything is setup and working except that my custom region--content.html.twig in the /templates folder of my ...
-2
votes
1answer
17 views

Country code in taxonomy shown as flag

I am using ISO 3166-1 alpha-2 codes for countries as a taxonomy in several pages of a given type. When listing those pages in a view, I would like to display the corresponding country flag, rather ...
0
votes
0answers
11 views

Passing new template to form

I have a form that's built via the FormAPI (admin UI) from an entity that has been created via a module. In the module, I have a hook_theme() setup that tells the system to use the template provided ...
0
votes
2answers
51 views

How do I embed an Ionic webapp?

I am building a partially decoupled Drupal 8 site. Drupal hosts all the content, but I also built mobile apps and a webapp in Ionic. The mobile apps are working fine, and now I want to host the ...
2
votes
0answers
29 views

Theming a file link by adding custom file name suggestions

I want to display a bunch of data inside a view table, where each dataset has up to three different files. The user should be able to download these files by clicking a custom button or image in this ...
0
votes
0answers
19 views

How do I get theme suggestions for a custom block attached via an entity reference field?

I have created a custom block type with the machine name "score_card". I am displaying it on a node page via a paragraph with an entity reference field that references blocks. I would like ...
0
votes
0answers
18 views

Custom form returns NULL in custom template

I have: A custom form A custom theme A custom module for this form I am trying to get the custom form to display on a custom template which is in a custom theme. The directory structure for the ...
0
votes
0answers
10 views

How to get a multilevel taxonomy reference field to output as nested UL in node tpl?

I have a simple 2 level taxonomy vocabulary field but I can't seem to find a way to output the terms (labels) in a nested UL in my node TPL. There are no display formatter options at all and I can't ...
1
vote
1answer
31 views

Template suggestion does not work for table in a custom block / Might there be a way around?

I created a block on pages of the "Author" content type that lists all the articles the author has contributed to in a table (via contextual filter). Now I want to customize the table layout....
0
votes
0answers
19 views

How do I add an active class for a views row?

I have a view block that lists different nodes. If I am viewing the block on any of those pages I'd like to add an .active class (or at least some kind of identifier) to highlight it with CSS as a ...
0
votes
0answers
26 views

File not found while retrieve the path after submit form

I have upload a csv file. It get uploaded on the physical path but while retrieve the path I get error file found. File get uploaded in sites/default/files/data_file/myfile.csv After print variable $...
1
vote
1answer
21 views

Newbie Taxonomy and Content Question

I'm new to Drupal (having used Perch CMS and PHP for years). Forgive me if I bumble the terminology a bit. I've been furiously going over documentation and tutorials. Sorry in advanced for being ...
0
votes
0answers
14 views

How to select the user desired crop in the “Manage Display” section of a paragraph type for an image field?

I'm currently using ImageWidget crop to give some aspect ratios for users to pick when editing content (1:1, 1:2, 2:1, 2:3, 16:9), that is properly set up in the "Manage Form Display" ...
0
votes
2answers
68 views

How to create template suggestion for image like IMAGE--BLOCK-TYPE or IMAGE--FIELD-TYPE

I'm struggling to make template suggestions like IMAGE--BLOCK-TYPE or IMAGE--FIELD-TYPE. I have three different block types(image1, image2, image3) with one image field(field_image_1, field_image_2 ...
2
votes
0answers
40 views

How do I change layout?

A disclaimer first: I am a professional medievalist, not a programmer or a front-ender. I have some front-end knowledge, but not a lot. So, please, be easy on me. Now, I am customizing a Bootstrap 4 ...
0
votes
0answers
27 views

How can I get the value of the field_percentage field?

I'm trying to create a custom template for the paragraph-progress-bar component. The component I created has 2 fields: title (field_title) and percentage (field_percentage, integer field limited from ...
0
votes
1answer
39 views

How can I reference an entity field in a template file?

I am trying to theme the node add/edit form for a custom content type (for example, Album). I implemented hook_form_alter() in the theme. function mytheme_form_alter(&$form, \Drupal\Core\Form\...
0
votes
1answer
59 views

Attempting to merge in an array of items into Twig classes

I have a Twig template where I'd like to merge in an array of items as classes. So far I have this code: {% set classes = [ 'media', 'media--type-' ~ media.bundle()|clean_class, not media....

1
2 3 4 5
210