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
-2 votes
1 answer
46 views

Front page redirect [closed]

We inherited a site where the previous developer used a redirect.php file to go to a specific page in the site based on the current date: date_default_timezone_set('America/New_York'); $day = date('j'...
SCSL SCSL's user avatar
0 votes
1 answer
59 views

How to force the browser to refresh the CSS/JS files

I've made a small change on a view (added a new class) and some related changes in the CSS files of the theme. Since the config change (HTML output) is immediately in effect, I need the browser to be ...
s427's user avatar
  • 755
0 votes
0 answers
27 views

Hide Node Title if Paragraph Type Exists?

How do I hide node titles on pages only when a specific paragraph type is being used? For example, the paragraph field is "field_cta" and it has 3 choices of paragraphs "paragraph_a&...
Sam's user avatar
  • 583
0 votes
0 answers
39 views

How to use hasField but for paragraph fields?

Within a page template, how could I check if a paragraph field if present? I'm using this and it works: $node->hasField($field_paragraphfield) But how can I modify this to look for a field within ...
Sam's user avatar
  • 583
0 votes
0 answers
24 views

Overriden Book Navigation template is not showing for anonymous user

On Drupal 10, I have copied and modified the book-navigation.html.twig file to my custom subtheme "templates" folder (/themes/custom/my_subtheme/templates/book-navigation.html.twig). This ...
Clément BK's user avatar
0 votes
2 answers
92 views

How do I get the image URL with the same style setting in Manage Display?

I'm creating a paragraph template. It renders images and other fields to create a layout design. While I can successfully render all fields, the challenge is to render the style applied in the Manage ...
CocoSkin's user avatar
  • 893
0 votes
1 answer
67 views

HTML style attributes have a prefix in their values after changing directory and settings

I am a sysadmin with some experience in PHP and databases, but a complete Newbie to Drupal. I have a Drupal site I am hosting but it needed to be moved away from the web root to host a new website ...
mr_november's user avatar
0 votes
1 answer
70 views

How to disable ampersand encoding in {{ attributes }}

Is it possible to disable the ampersand encoding when rendering <div {{ attributes }}> in a hook (preferred) or Twig? Background: Drupal by default escapes ampersands & into &amp;. This ...
Hudri's user avatar
  • 5,484
-2 votes
1 answer
91 views

Is there a Drupal way to make a menu horizontal and responsive and leveled (similar in style and behavior to a main navigation menu)? [closed]

I have added a menu to a block in a full width region but my problem is that this menu appears vertical and I didn't find a way in Drupal to make it horizontal, similar in style and behavior to a main ...
drupaler's user avatar
1 vote
0 answers
44 views

Is it possible, with Twig Tweak or any other means, to place a menu block in a specific language?

I want to place a menu block in a template, but ensure it is always displayed in a specific language regardless of whether the content node where it appears is in that language. I do not ever want ...
arnoldbird's user avatar
  • 1,173
0 votes
1 answer
28 views

How to switch template for search results without using views and display modes?

I want to show my Drupal 10 Solr search results in either grid view or list view. I set this up using Views and Display Modes, and I have icons on the page which simply link to the URLs of the ...
Lemmy's user avatar
  • 201
-1 votes
1 answer
79 views

Sidebars don't appear

I am trying to add two sidebar regions, sidebar_first and sidebar_second, one region on top the other region. Both regions should share the CSS styling from sidebar region but my problem is that both ...
alesios's user avatar
0 votes
1 answer
53 views

How can I get a printable version of a node?

I have a node with a simple article in it (an <H1>, a bit of <H2>s and some <p>s). If I print this page from the web browser as-is, I will get it with grandiose spacings, Drupal ...
alesios's user avatar
2 votes
1 answer
88 views

What is the purpose of the Stark theme?

Claro is for administration, Olivero is general, but what is Stark for? An intentionally plain theme with no styling to demonstrate default Drupal’s HTML and CSS. Learn how to build a custom theme ...
alesios's user avatar
0 votes
1 answer
35 views

Subtheme update

An update has become available for a given theme (Bootstrap Barrio). I had configured the previous release into a subtheme. How can I update the subtheme, or at least make a new subtheme of the ...
user42221's user avatar
2 votes
1 answer
261 views

How to correctly create and edit left to right pages in a right to left website?

I have a website in Hebrew, a language written from right to left (RTL). Hebrew is used for the administration interface and for the general interface; generally pages are in Hebrew for all users. I ...
jorno's user avatar
  • 1
1 vote
1 answer
36 views

How can I use material symbols in the search bar submit input?

Background I have a Drupal 10 site with a search bar that appears on the front page. Using this search bar redirects the user to a search page with a similar search bar, underneath which are the ...
GeorgeCiesinski's user avatar
0 votes
1 answer
45 views

Chosen dropdown in Claro subtheme

I created a subtheme for Claro theme in drupal 10. Before adding any custom code, I expected it to not be different from the parent theme, but the chosen dropdowns are off. (first pic - claro, second -...
user7167081's user avatar
1 vote
0 answers
58 views

Modifying a field value in theme_preprocess_node()

I have a content type (exercises) which contains a text field (field_path). In this text field I have a path to a video file. I would like to retrieve the value of this field in theme_preprocess_node ...
HEIA Drupal's user avatar
0 votes
1 answer
40 views

Add custom field template for front page only?

Is it possible to use twig template naming conventions to target a field on the front page only? For example, if I want a different version of the header field on my front page I could use field--...
Sam's user avatar
  • 583
-5 votes
1 answer
114 views

How to make CSS changes without the need to flush all caches after each CSS change?

Core version 10.1.6 with an Olivero based sub-theme with a style.css file. My problem is that CSS changes I make in style.css won't take effect until I flush all caches and this causes me to lose much ...
ali's user avatar
  • 3
-2 votes
1 answer
47 views

Is it possible to make a theme hook suggestion for blocks according to content type?

I was hoping it was possible to do something similar to this for menus: * Implementation of hook_theme_suggestions_HOOK_alter() for menus. * * Make menus themeable: * e.g. => menu--main--node-...
huijing's user avatar
  • 199
0 votes
1 answer
59 views

Event listener for button intermittently fails to be added on home page

Background I have a filtered view for the content type "Change Requests" that I built as a page, and as a block. The block is added to the user's home page and only shows that user's change ...
GeorgeCiesinski's user avatar
-2 votes
1 answer
58 views

How can I hide a specific region according to its url?

I need to hide the footer region on all pages with whose URL contains /people/, similarly to what is possible to do with blocks.
Yohan's user avatar
  • 1
0 votes
2 answers
70 views

How do I change the input type created by views daterange filter?

I am using a view created with the views module. The view displays all change requests, and I wanted to expose a filter to users to be able to filter the change requests by date. The change requests ...
GeorgeCiesinski's user avatar
1 vote
0 answers
64 views

How to prevent HTML entity encoding in Drupal attribute objects?

Is there an easy way to disable the HTML entity encoding of CSS class names? When I create CSS classes with ampersands or the "larger than" symbol (which might look strange but is ...
Hudri's user avatar
  • 5,484
0 votes
0 answers
54 views

How do I style the tooltip that displays element title on hover?

Background I am building a custom Drupal theme for my site. For the most part, the styling is pretty straight forward, but I am struggling to find what js or css controls what appears to be a tooltip ...
GeorgeCiesinski's user avatar
1 vote
1 answer
261 views

Upgrade to Drupal 10.1.6, Theme Doesn't Load Outside Maintenance Mode

I'm working to upgrade a site from 9.5.11 to 10.1.6. I followed the instructions provided here: https://www.drupal.org/docs/upgrading-drupal/upgrading-from-drupal-8-or-later/upgrading-a-composer-based-...
Scott Hollenbeck's user avatar
0 votes
1 answer
85 views

How can I render only a region in a controller?

I'm looking to have a page on /templates/header which only renders what there is in the header region of the theme. I am using the following code for a custom controller. namespace Drupal\...
Victor Pudeyev's user avatar
0 votes
0 answers
70 views

I can't manage to render empty fields

I have a custom template file for List (text) fields. I need to display these fields using the Layout builder module. Everything works perfectly, until no value in those fields is selected. (The ...
Etzesty's user avatar
1 vote
1 answer
113 views

Stylesheets not loading

Has anyone successfully dealt with this kind of error? [Error] Did not parse stylesheet at 'https://*****.***/core/assets/vendor/jquery.ui/themes/base/core.css?s2pf9q' because non CSS MIME types are ...
Cary Gordon's user avatar
0 votes
1 answer
50 views

How to hide a region in a node (most preferably without a module)?

I want to hide the sidebar region only in my homepage. CSS display:none for the sidebar region is not enough because main content won't expand to cover the actual region so I think about using a ...
fuzzy_designer's user avatar
0 votes
0 answers
56 views

View breaks the page output

Has anyone encountered this problem or can at least help me debug it? The views is displayed as standard if the parameters are specified. Format:Unformatted list | Settings Show:Field If I change it ...
drupnub's user avatar
0 votes
1 answer
62 views

Image field and links not showing in view block template

I have a CT team_members with the following fields. field_team_member_image field_team_member_name field_member_designation field_social_media_links(Multiple values with links to twitter, instagram,...
KTM's user avatar
  • 2,362
-4 votes
1 answer
62 views

building a subtheme using stark as the base theme but getting this error in the info.yml

i keep getting this error. The error goes away when i remove the info.yml file from the subtheme. I upload the subtheme in the root theme directory. I've added the error message along with the info....
beauthis6's user avatar
1 vote
1 answer
39 views

How can I get the numeric ID for a block from within the block template or hook_preprocess_block?

How can I get the numeric ID for a block from within the block template or hook_preprocess_block(). By numeric ID, I mean the ID that we see in the edit link for a block. For example, mysite.com/...
arnoldbird's user avatar
  • 1,173
0 votes
1 answer
65 views

file_url() produces no output [duplicate]

I have a custom block, and a block--inline-block--hero-video.html.twig template file. The block has a field_video field. If I put {{content.field_video[0]}} in my theme, the output is the following (...
alberto56's user avatar
  • 214
1 vote
2 answers
312 views

Why can't I disable CSS caching?

Background I am developing a custom theme for my Drupal 10 site. I found myself constantly flushing the cache, so I have been looking up ways to disable the cache on my local dev site. My end goal is ...
GeorgeCiesinski's user avatar
-2 votes
1 answer
44 views

View not showing result based on taxonomy term contextual filter

I have a view and same in D7 and same I created in Drupal 10 but the output is not as expected. I found in Drupal 10 we don't have Filter Value type in Drupal 10 Below is the Drupal 7 view query: ...
Drupal's user avatar
  • 1
0 votes
0 answers
42 views

Does disabling the Drupal cache also disable the CSS Cache? [duplicate]

I am having trouble disabling caching in Drupal 10. To be more specific, I am trying to disable the cache using the Admin interface so that I don't have to manually edit any files in case I ...
GeorgeCiesinski's user avatar
0 votes
0 answers
25 views

How can I theme a file link in a specific file field? [duplicate]

I have a file field (pdf_via_email). I need to do some heavy theming to the link of this field, so I would like to know how I can create a custom file link template specific to this field. I tried the ...
Il Felice Android's user avatar
0 votes
1 answer
56 views

How to send variables to a custom theme from a custom module

I'm trying to pass a variable from a custom module to a custom theme. I have a Controller class in a custom module <?php namespace Drupal\course_catalog\Controller; use Drupal\Core\Controller\...
Dynamdilshan's user avatar
1 vote
0 answers
29 views

empty variables when i use a region template for a specific node

My goal is to serve the drupal header region on a specific URL so another application can get my drupal header and consume it. my menu is well working, and is called in region--header.html.twig like ...
SupFrig's user avatar
  • 113
0 votes
1 answer
113 views

Override Default Theme's 'page' TWIG template, but not the original page template pre-process hook

I'm using the default theme, Bootstrap Barrio, but for certain pages I'm overriding the page.html.twig template to re-arrange the layout, however I still want the pre-processing done by my theme in ...
micbay's user avatar
  • 13
2 votes
1 answer
460 views

Struggling to enable twig debugging

Update: I've realized that neither my settings nor settings.local files are doing anything. I placed die() and print statements throughout both files, rebuilt cache, and see nothing. I'm stumped. ...
Evan's user avatar
  • 23
0 votes
1 answer
21 views

['#attributes']['class'] variable is not being rendered on the page

I'm working on an old Drupal 7 site. In the template file paragraphs-item--user-block-paragraph.tpl.php the content is being rendered, but the class is not added to the element. Here is the code: $...
Ben Alan's user avatar
  • 111
0 votes
0 answers
27 views

How to access Block Layout data and add to render array for rendering in a Twig template?

I'm a relatively new Drupal developer, and this ticket for my job has been proving extremely difficult for me to figure out through research. I want to access the block layout data (/admin/structure/...
user111115's user avatar
0 votes
0 answers
154 views

How to simply inherit all Olivero regions into my sub-theme?

I am trying to create a subtheme for the Olivero default theme. My problem is that not all Olivero regions are inherited into the sub-theme. For example, some of the regions that are missing are "...
alhemist's user avatar
1 vote
2 answers
132 views

Adding a class to a URL object

function mytheme_preprocess_menu_local_tasks(&$variables) { if (!empty($variables["primary"]["entity.node.edit_form"]["#link"]["url"])) { $url = $...
̷c̷h̷x̷'s user avatar
0 votes
1 answer
230 views

How to set a webform default value for anonymous user?

I have been using hook form alter for a webform, to set a default value for a webform added as a block to a page. Below is the code, the code only works for users who have logged, but for anonymous or ...
Jake13's user avatar
  • 49

1
2 3 4 5
216