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
1 answer
507 views

theme_preprocess_menu is not seeing main menu

Background: I have an event website where I want to hide the event registration menu item when registration for the event is closed. theme_preprocess_menu is not triggering on anything except '...
0 votes
0 answers
11 views

Theme Drupal comment reply page exactly like comment submitted page

I have created a custom content type 'article' where a custom comment field has been added along with other fields like images, taxonomy terms, etc. In the theme file (page.html.twig) for this content ...
0 votes
2 answers
560 views

Geting values for multipart form elements using Twig

Whereever you are, I hope you're fairing well under the circumstances. To some of the hardest hit areas, we are thinking of you constantly. Webform Advanced Elements I am having difficulty ...
3 votes
1 answer
560 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, ...
1 vote
2 answers
621 views

How do I create and render a custom region?

How do I create and render a custom region in Drupal 7, when the Display Suite module is used? I am not able to show/display a block into a custom region and confused with the files structure. Please ...
1 vote
2 answers
781 views

How do I change position of a "fixed" element/header to go below Admin toolbar when in Admin view?

New to JS / CSS How do I change / control the position of a sticky navigation bar to go below Admin toolbar when in Admin mode? Site uses: Subtheme of Omega / Commerce Kickstart Through subtheming,...
1 vote
1 answer
1k views

Regions do not display in "Demonstrate block regions"

I wonder why some regions of my theme don't display in section 'Demonstrate block rerions'. This happens with some themes which I downloaded from Drupal.org, for example with the Software theme. Here ...
5 votes
3 answers
4k views

Custom module for adding CSS file in admin section

How do I include admin.css in my theme so that it's loaded in the admin section (and preferably only the admin section)? Right now when I add admin.css via the x.libraries.yml file, it's only loaded ...
0 votes
1 answer
489 views

Commerce Product Collection View Block: What Determines CSS For Each Header Link?

In Kickstart 2 there is a view called collection_products which displays a list of products in a given collection, grouped by category. There is a header which uses a Block display to give anchor ...
0 votes
1 answer
3k views

Add prefix / suffix to field by using template_preprocess_field

I remember in Drupal 7, this was possible. I need to add some HTML before a field and I don't want to edit it in the Twig file. Is it somehow possible to add prefixes / suffixes by using the ...
1 vote
1 answer
972 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 ...
-2 votes
1 answer
47 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'...
1 vote
1 answer
5k views

Drupal 8 - how do I extract the URL path from node title

I can print title of my content-type using {{ fields.title.content }}. and it renders like <a href='...'>Title of the content</a>. I have created a View (view mode: field) and showing a ...
0 votes
1 answer
924 views

Problem rendering paragraphs field - advanced but still not working

I am working on a site with one special page layout (lets call it originally "two columns"), which has basically two columns: The left one showing page contents and the right one an unlimited number ...
0 votes
1 answer
478 views

How can I check, if node has a new (unpublished) revision in node-template?

I have user created content. I use the content-moderation plugin, so user can update their nodes but the updates will only be published after moderation. I like to display a little batch (has new ...
1 vote
1 answer
451 views

How do I set a specific image header for each page?

I am trying to have a header with a different image for each page of my site. I believe I should be creating a block. I don't want to create x blocks for x pages, and I prefer to do it ...
1 vote
1 answer
1k views

Is the front page considered in_active_trail?

I'm learning Drupal 8, so still very new to it. I'm working on customizing the main menu. I've been able to add Twitter Bootstrap to my custom theme. I've made a custom menu--main.html.twig file. I'...
1 vote
2 answers
2k views

Display HTML field

I am using Views Database Connector to display safe data from external database in Drupal 8 within views. Some of the fields include simple html like a list which views encodes in html entities. I am ...
0 votes
3 answers
602 views

blocked due to MIME type (“application/octet-stream”) mismatch

I've been troubleshooting a memcache issue on our Drupal 7 site and in the process the front end CSS broke, meaning all content was unstyled. The Chrome console has a message: The resource from “/...
0 votes
1 answer
253 views

GET /sites/default/files/js/js_xxxxxx.js - No such file or directory

This is my first post, I just started to learn and use Drupal, and I wish to install a fresh new site on my local Windows machine using composer. The issue is that it has a file not found error from ...
1 vote
1 answer
851 views

Passing variables to JS from theme folder .tpl files

I use many template files in my modules via hook theme. In order to pass variable to JS files I use the method described here: https://www.drupal.org/node/304258 in the .tpl.php files: $my_settings = ...
2 votes
1 answer
744 views

How do I separate the "Product" select list & "Add to cart" submit form in a node product display?

I have a node product display which references 2 different products. When I use the code below, it prints out both the "product select" form + the "add to cart" submit form. How do I print them out ...
0 votes
1 answer
62 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 ...
0 votes
1 answer
460 views

Get the url for an images in a Field Collection for the Node Template

This is a bit messy so bear with me. I've built a node with a field collection 'field_meet_videos'. That field collection contains another field collection 'field_about_video'. The inner field ...
0 votes
1 answer
983 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.
0 votes
1 answer
400 views

Moving elements to other page regions

I want to move the page breadcrumb to the content region in Bartik (D7.) I assume it is theming but I can't find anywhere (style.css, layout.css) where the breadcrumb is assigned in the first place. ...
0 votes
2 answers
705 views

Views: Multiple Rows & Mutliple Columns

I've been twisting and turning the View module but can't get simple tasks done. Well it should be simple but yet Drupal don't have a good solution ...yet. How to create 2 columns where column A have ...
0 votes
1 answer
567 views

Print password confirm field in user register template file

I'm trying to theme the user registration form in Drupal 8. I have defined a custom template for user registration form and printing the fields with the following code. {{ form.field_profile_title }} ...
1 vote
1 answer
564 views

Render key and value of a field

I have a field (list integer) and I would like to render its keys and values. I found field.html.twig but within I only have access to item.content which is the value. I would also like to access the ...
2 votes
1 answer
640 views

Add class in sub menu

I am trying to convert html to Drupal 7 theme. function theme_menu_tree($variables){ return '<ul class="my-class-1">' . $variables['tree'] . '</ul>'; } simply returns the entire menu ...
0 votes
1 answer
702 views

Print image URL with image style

I would like to print an image URL with an image-style. This doesn't work, since I don't have a ".value"-value for the image: How to find image style URL from within twig template? Is there anything ...
0 votes
1 answer
672 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 ...
1 vote
1 answer
607 views

Why is my theme table row array not being displayed?

I have the below code and I know both the $headers and the $html have values stored in them as i can echo them out. I can also set the 'header' => in the theme function to be either $header or $html ...
1 vote
1 answer
2k views

How do I get navigation menu on top with narrow viewport?

I'm running Drupal 7.28 with Zen 7.x-5.5. In the default setup, there is a region on the right side named "First sidebar" which contains a block named "Navigation". I have put my navigation links ...
10 votes
1 answer
1k views

How do I theme a modal popup?

How can I style Drupal 8 modal window to achieve Instagram style and behaviour? I'm creating modal through extending ControllerBase class, thus have full control of content. However I can't figure it ...
0 votes
1 answer
603 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 ...
2 votes
1 answer
1k views

Why is libraries-override not removing assets?

My attempt to remove CSS and JS assets is not working. I have placed the following declarations in my module's *.info.yml file. But after clearing the cache, I still see the assets in the head of ...
0 votes
3 answers
592 views

Passing global variables to alter hooks

The problem I have is that it seems that I can use global variable created inside another module, only if I use it inside callback function. I successfully tested it by inserting code inside existing ...
1 vote
1 answer
808 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
3 answers
2k views

How to access weight of a paragraph in twig?

I use paragraphs with my content type. I need to show weight (order) value of each paragraph in my twig template. I can change weight with select box when I edit the node, but I can't figure out how ...
1 vote
1 answer
645 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 ...
0 votes
1 answer
974 views

How do I get link the files in libraries.yml with absolute url path

In my libraries.yml files the css files are linked with the relative url paths. Eg : /css/mycss.html So when in the page source the linked url shows as relative. How do I link those files with ...
2 votes
2 answers
756 views

Wich template to override for user account form

I am building a theme for my Drupal 8 site and I want to create a custom profile page with user information like this: http://bootsnipp.com/snippets/featured/profile-card but I can't find the correct ...
0 votes
1 answer
609 views

How do I print individuals fields in block.html.twig when is a node in a block?

How do I print individuals fields in block.html.twig when is a node in a block? The template is working fine. I can hard code some random text and it is displayed. I just can't display the field ...
2 votes
4 answers
515 views

Can "Demonstrate block regions" use a specific template?

The theme .info file look like this. name = xxx description = xxxxx core = 7.x engine = phptemplate stylesheets[all][] = css/css.css regions[banner] = Banner regions[header] = Header regions[...
2 votes
1 answer
3k views

How can I specify inner elements template in custom login page?

I am new in Drupal 8. I want to create a new theme to according to my HTML. What is the best practice to integrating a custom build theme to drupal engine. I have covered all sections in Drupal 8 ...
0 votes
2 answers
771 views

Content Region Not Displaying

I'm relatively new to Drupal and am just squashing bugs on my first site. I have a region that I declared in my theme.info file: regions[alert] = 'Sitewide Alert' and I have a block that has a ...
1 vote
2 answers
504 views

HTML Form that Passes Information to Hidden Fields Through URL

I am trying to build an html form that is stretched across several pages. My intention is to use the GET method to send all of the fields data in the query string (URL parameters) and then store this ...
2 votes
1 answer
490 views

Override formatting for paragraph edit view

I have a paragraph type defined as two fields, which are Person and Role. I can customize the structure of the paragraph fine to view. However, I am stuck in editing how the form elements sit in the ...
0 votes
1 answer
622 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
2 3 4 5
216