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
vote
1answer
1k views

How to create an Enquiry form with ability to submit a collection of enquiries

I am building a new site which has a large selection of different products/services on offer, the information for each is shown in it's own node. If the user has interest in a number of these ...
0
votes
2answers
58 views

how to display a media description in a twig template?

i want to display the media description available in the file field of a media ( media of type video, audio, image, etc...), it is an option to activate: Enable Description field The description ...
0
votes
1answer
497 views

Ajust the position of autocomplete fields

I working with the theme base bootstrap and my problem is that in autocomplete fields it's a bit offside of position, see the screenshot. How fix this ? I need this more to the left and below the ...
0
votes
1answer
613 views

How do I get a list of all CSS and JS that are attached to a page?

In Drupal 8, how do I get all CSS and JS that is attached to a page? In Drupal 7, I could use drupal_add_css() or drupal_add_js() without arguments, to get an array containing a list of all the files/...
0
votes
2answers
550 views

Save form when user refreshes page from browser or click on any anchor tag inside page

I have made a form in drupal. What I want is when the browser unload the page from any click whether by clicking on anchor tag or from browser refresh buttons I want to save data of my form through ...
0
votes
1answer
507 views

display view mode on node based on field setting or taxonomy term of user profile

I'm using Display Suite which is awesome and an easier solution if you're not a coder. Now that I have created several view modes I'd like to set a particular view mode that is based on a field ...
0
votes
0answers
18 views

How do you create skins for the views slideshow?

Supposedly, in Drupal 8 you can create custom styles for your slideshow (Views Slideshow), which the README refer to as "skins". Normally I'd use a css, but the module annoyingly includes a ...
1
vote
1answer
335 views

JCarousel Views - Multiple Rows

My problem is related to Drupal and the use of the JCarousel module for my views. I'm having a few problems with this, namely in getting a jcarousel like view style but with 2 rows instead of one. ...
2
votes
1answer
511 views

How to print and/or manipulate individual image attributes and suppress width and height via the image.html.twig template

I had to get rid of the width and height attributes in my images and wanted to learn better the possibilites of Twig in Drupal.
3
votes
3answers
8k views

How to change my maintenance page?

As the title explains, I want to make a custom maintenance page, different from the default one. For that I've read this tutorial: Theming the Drupal maintenance page. I copied the file /module/...
3
votes
2answers
641 views

Upload Image in system_theme_settings form using Zen on Domain Access System

I want to upload the image as the background in the settings page of the zen theme. In zen , It's easy to add an extra field in the theme-settings.php and it's worked at the single site system. ...
0
votes
1answer
157 views

Logo size should not reduce after uploading - Drupal 7

I have had uploaded a logo in my site. After uploading the image's size is reduced. Because of that, image quality is decreased and it doesn't look good. What should I need to do TO NOT REDUCE THE ...
0
votes
1answer
117 views

Only ONE CSS File for Visitors (and more for Admins)

So I just started creating a theme for my first big drupal project, and instantly had to quietly cry in a corner, as I saw how many css files Commerce Kickstart 2 and Omega4 are serving by default. ...
0
votes
2answers
518 views

Display Image logo along with site slogan and site name [closed]

I am using Impact theme for my site. It either displays text logo(site name, site slogan) or image logo. I want both image logo and text logo for my site. Any help is welcome.
0
votes
1answer
24 views

How do you make a Image View of a specific page?

I have a problem. The thing is that I know that you can have a [Content Type] with an image [Field], and then you can create a [View] to display the image [Field] in each of the pages that are of the ...
0
votes
1answer
76 views

Can you retrieve the Omega breakpoint settings?

As the title suggests, is it possible to retrieve the Omega breakpoints you set in the settings for your subtheme via any kind of function or call? Like the ones from the picture.
0
votes
1answer
32 views

Overriding, create theme from scratch or modifying core theme? [closed]

I have noticed there are many ways of doing this and just wanted some advice on which to go for. I have a static webpage and trying to migrate my CSS to Drupal. Can I inherit main functions of a core ...
1
vote
2answers
115 views

How to hide the text format field set using css?

I followed several recommendations and decided to go with using CSS to hide the text format. I don't want to use another module to do something minor like this. Just want to hide text format for this ...
0
votes
1answer
37 views

How can I check in Twig if an advanced theme setting option is unchecked?

I've a list of advanced theme option(checkbox) to not display, such as search bar. I did many research about custom advanced theme setting, but all the samples are {% if remove_searchbar %}{% endif %}....
0
votes
1answer
30 views

How can I use the grouped nid in a views template with two content types?

In Drupal 8.9x, I have a view with two content types in it: Each business (and its details are grouped), and underneath each business I'm displaying multiple offers by that business...and then I want ...
0
votes
1answer
28 views

Load Bootstrap CDN only if not is loaded before from another project

I want to load Bootstrap CDN but only if is not loaded before. How can I do this? Today I'm loading on Libraries.yml like this: And it works. But the problem is: in some cases the Drupal site already ...
1
vote
1answer
1k views

Schema.org itemprop=“url” inside anchor object (link)

I'm trying to use the preprocess function to change the default outpot of links <a href> to include Schema.org's itemprop="url" inside the anchor object, as well as adding a <span itemprop="...
4
votes
2answers
816 views

Get paragraph delta/weight in template

I have defined a paragraph type that has a text field and an image field. At the moment the twig template is something like this <div class='paragraph_wrapper'> <div class='text-container'&...
-1
votes
0answers
14 views

Resize “Select” Webform Element

I'm rather new with Drupal and especially the webform module. I've created a basic form with one of the elements being a "Select" type. When I referenced the form on my page, my drop-down (...
0
votes
1answer
648 views

Rate module thumbs up / down widget with button

I am using rate module to count likes and dislikes. Here I am using Thumbs up / down widget. My question is that how can I show a button below thumbs up and dislike button below thumbs down. In the ...
-2
votes
0answers
22 views

How to do query from sql and display result in twig in drupal 8 [closed]

I am new in drupal. I made modul, controller and twig now i need to do query and display result of custom content type on page. Can somebody post me code to see how to do it in which file. Thanks for ...
1
vote
2answers
689 views

How to set and inherit variables within different twig templates?

I'd like to set a variable in my node.html.twig template: {% set title = label %} {{ content }} The content consists of one field visible only, which has it's own template: file-link.html.twig How ...
1
vote
1answer
19 views

How can I link the file name to the file?

I created a content type with a "file" field type. This to upload a pdf file. Now I want to create a link to open that specific file, in my twig. If I do this : <div>{{content....
1
vote
1answer
33 views

Adding attributes to a link to an uploaded file

I have been asked to add target="_blank" to the links that are produced when a user uploads a file on a Drupal 8 site. The field type is "File". Multiple uploads are allowed. Twig ...
-1
votes
1answer
14 views

How to display default drupal search block in twig template

In twig_tweak module before version 2 (for Drupal 8) I could place the following code in my page twig template and it would work: {{ drupal_block('exposedformsearch_contentpage_1') }} This would ...
-3
votes
0answers
26 views

How do I customize CSS in the Bartik theme? [closed]

I want to make some style changes to my website for the Bartik theme. Can I do the changes and add classes to core/themes/Bartik/layout.css, or do I need to create a sub-theme? How do I create a sub-...
0
votes
1answer
739 views

Error message “responsive-utilities.less” not found

I did set-up the sub-theme with less for the Bootstrap theme. Following is the file structure, Installed less using(Instruction followed from here), $ npm install -g less Then ran a following ...
0
votes
1answer
453 views

Login page when using a Zen's sub theme

I've created a website based on a Drupal 7 Zen subtheme and now I would like to create a login page for the administrator. When I navigate to http://mysite.com/?q=user, I return to the main page as ...
12
votes
5answers
27k views

Custom template for 404 error pages

A quick noob question here! How to set a theme to use a custom template for 404 error pages instead of using page.tpl ?
0
votes
2answers
31 views

creating a custom report page with a table

Drupal 8.9.6, I'm trying to create a custom module admin report page. I have a custom sub theme of seven called wd_admin. I made a page controller that generates a table as markup, but want to use a ...
0
votes
1answer
652 views

printing an entity reference field in a special display mode

I have an entity reference field. The referenced entity has multiple display modes. I'd like to print this field 2 two times in a template, with 2 different display modes like so: {{ content....
1
vote
1answer
340 views

Render array doesn't render children

I can't add a form to a node. Using the following code, the generated HTML show only the node. If I return $form, the form is rendered correctly. What is my mistake ? function hook_menu() { $items['...
0
votes
2answers
640 views

How to display all children on parent node for custom content type?

I have a custom content type, let's call it 'parent'. I have another custom content type, let's call it 'child'. I created a template file where I can display the 'parent' content type fields any ...
-1
votes
1answer
44 views

How to use a Twig variable as View name in drupal_view() Twig Tweaks function? [duplicate]

This works: {{ drupal_view('nursing_resource_blog_teasers', 'block_1') } But this doesn't: {% set view_name = "nursing_resource_blog_teasers" %} {{ drupal_view(view_name , 'block_1') } It ...
0
votes
1answer
352 views

How do I print an image field value in views-view.html.twig?

It seems I'm able to print text field values with {{ view.field.field_example.getvalue(view.result[0]) }}, but this same method doesn't work for image fields. Please help.
2
votes
2answers
140 views

How can I stop the full HTML editor from deleting my <p> paragraph?

https://drupal.slack.com/archives/C1BB308HH/p1602318464360700 Link to slack question in #support JSFiddle of the offending html: https://jsfiddle.net/tyeth/xr4ohast/ Demo Video showing the paragraph ...
2
votes
0answers
55 views

Why can html.twig files be placed outside the templates folder?

In Drupal theme folder structure, there is written: Templates provide HTML markup and some presentation logic. Contrary to Drupal 7, in Drupal 8 template files (*.html.twig files) must be stored in ...
0
votes
1answer
508 views

Render block via twig template

I have programmatically created a block. In my module folder I added all suggested templates in a templates folder(mymodule/templates/suggestedtemplatename.html.twig). However the block is not using ...
0
votes
1answer
643 views

Variable in html.tpl.php

This seemingly simple task proved more difficult than I imagined.. I'm trying to get a variable from themename_preprocess_html to my html.tpl.php. The code I have in my template.php file: <?php ...
1
vote
1answer
462 views

Form is not being rendered in template file

I have tried drupal_render,drupal_get_form etc for rendering the form,but the form is not being rendered. Is there any error in code or else what else should i add to the code so that it works. ...
0
votes
2answers
407 views

custom js in bootstrap sub-theme is loaded, works in console, but doesn't actually work in browser

I have a bootstrap subtheme with scripts[] = script.js in the .info file. When I go to the site and view html source of the page I can see that drupal is including the file <script src="http://...
0
votes
1answer
565 views

Update theme table using callback function in Ajax

I have two elements in my form: a select and a table element. Everytime onchange event is triggered on select element, I want to update the values in my table. I want to do query and change the values ...
1
vote
2answers
430 views

How do I split a contact form into multiple pages?

I have a huge form that's way too large for a single page. I would like to split this form up into a few separate pages. What are my options? Edit: Still haven't figured out how to do this with ...
2
votes
1answer
559 views

ajax button doesnt fire callback function

I need to put some ajax buttons on each row of table. My theme looks like this: /** * Implements hook_theme(). */ function application_wizard_theme($existing, $type, $theme, $path) { return ...
1
vote
1answer
723 views

How do I add icons to taxonomy terms?

I have a sample site running Drupal 8.1.x, I want to add icons to the taxonomy term. Example. I have a term called Animals with the following list in it Cats Dogs Fish i want to assign an icon ...

1
2 3 4 5
208