Theming is about the development, adaption and configuration of "themes". A "theme" in Drupal is a set of files containing PHP, templates, Javascript and CSS that in concert provides a certain appearance of a site, and that clearly separates layout and styling of a Drupal site from content and ...

learn more… | top users | synonyms (7)

0
votes
1answer
12 views

Drupal 8: How to override admin theme in my own theme?

I created my own Drupal 8 theme: mytheme.info.yml: name: My Theme description: 'Drupal 8 Theme' type: theme base theme: bartik core: '8.x' mytheme.libraries.yml global-styling: version: 1.x ...
0
votes
0answers
13 views

Omega 3 theming pager

I'm using Omega 3, but can not find a way to customize the pager. I need to use font-awesome icons and I could not add them. The structure is as follows: Is possible?
0
votes
0answers
16 views

change font size for displayed code [on hold]

How to change the font size for a piece of code that is displayed as part of a web page? Specifically, my web page contains a Python script, displayed using SyntaxHighlighter. The default font size ...
0
votes
1answer
22 views

How to get content node link url in twig template

I am struggling on getting the node url link on my template. {{ content.node_link }} returns the full link but I only need the url. Any idea on retrieving only the url?
0
votes
1answer
17 views

Adding two contextual filters (Content : nid)

I want to display two type of contents : News and Events. So I added them in the filters criteria. This works great. Now I want them to be further filtered on the basis of the category the News and ...
0
votes
0answers
16 views

How do I create sub-directory-based multisite sites?

I have a www.abcd.com website in Drupal 8.0.5. I want to create www.abcd.com/subsite1 using the same theme and a different database. I looked at ...
0
votes
2answers
21 views

Search box label

I am using the code found on https://www.drupal.org/node/154137, and I added this code to my template.php file. function sample_theme_form_search_block_form_alter(&$form, &$form_state, ...
0
votes
0answers
20 views

Which button id triggered the form submission

My module hade a form and the form have 5 buttons: create, edit, save, etc.. also my module form use ajax to send the requests, and the function look like this: $form['dialogCreateButton'] = array( ...
2
votes
2answers
24 views

How to display custom data array via Twig

I've created service which gets the raw data from custom content type. It looks like this : Array ( [front_page_slider] => Array ( [1] => Array ( ...
1
vote
1answer
29 views

Bind click event to ajaxify form button

how the title says I would like to trigger javascript (jQuery) event from generated Drupal form button. I already add an id to the button and added the javascript in theme file like so: ...
0
votes
1answer
18 views

Libraries Not Loaded After Cache Clear / Reload [on hold]

I'm experiencing a problem with drupal 8 whenever I clear the cache, my custom theme's libraries(ex: the css and js) will not be loaded and I must reinstall the whole drupal to make it works again ...
3
votes
3answers
66 views

How do I theme a link with twig for a specific content type?

I'm trying to create a custom file-link.html.twig for a particular content type. I've looked at https://www.drupal.org/node/2354645 which doesn't link plugin theme twigs like file-link but tried ...
0
votes
0answers
15 views

How do I render an image with display options?

I would like to render an image, with responsive styles at the top of a view. The approach I have been using is to try to access to the full array that you get when calling ...
2
votes
2answers
59 views

How to set a default theme programmatically

I am trying to build an install profile and I want to have my custom theme enabled and set by default after the installation. Adding in MYPROFILE.info.yml... theme: - my_theme ...is not enough. ...
0
votes
0answers
13 views

theme_radios working but theme_radio is not

Hello I am trying to figure it out what's causing theme_radio not to work. It is Drupal 7 and this is my code: // Hook Theme in my module function MY_MODULE_theme(){ return array( ...
0
votes
1answer
16 views

How can I pass a variable to javascript from a preprocess function? [duplicate]

How do I pass $variables['is_front'] from template_preprocess_page() to a jquery script in Drupal8?
2
votes
1answer
29 views

Avoiding Views PHP if possible

I have a number of values that I need to run a bit of logic on to get a value for a views math expression further down the chain. Im going to provide a much simpler example of what I am actually ...
0
votes
1answer
15 views

How to include desktop css file only on desktop & mobile css file only on mobile?

I have two different css files in my theme, one for Desktop and other for Mobile version. I want to render Desktop css file only for desktop mode and Mobile css file only for mobile mode. Do I need to ...
0
votes
0answers
9 views

How to custom theme Inline Entity Form (IEF) - using a .tpl.php file

Is there a way to theme the Inline Entity Form (IEF) for example creating a .tpl.php file for that form and just declaring it on the theme's template.php? I wanted to create a .tpl.php specifically ...
0
votes
0answers
10 views

How to use templates of existing sub theme into new theme?

I have Adaptive Theme in my Drupal Site, also some custom template. How can I use Existing template into my new theme (i.e. Bootstrap Theme)?
0
votes
1answer
39 views

Logo is not displaying [duplicate]

This is the code I used in Drupal 7. <a href="<?php print $base_path ?>" title="<?php print t('Home') ?>"> <img src="<?php print $logo ?>" ...
0
votes
1answer
17 views

Multiple Values in Custom Template Field

I have a custom template for a node, and a field which has the possibility of having multiple pieces of data. In this case: There is an Author node There are Publication nodes Publications are being ...
0
votes
1answer
10 views

Parent theme hook is still being called when overwritten

I have a theme called hasta, and created a sub theme to customize certain aspects of it. One of the things I wanted to do is change the behavior of one of the hooks, hook_element_info_alter. The ...
0
votes
1answer
36 views

How can I display seveal menus with different classes

I have the "joy" to upgrade a Drupal 6 site to Durpal 8. In my Drupal 8 site I have three different menus, which each display different types of nodes. I want to display them in the region of the ...
0
votes
1answer
29 views

How should I link (public) files to nodes?

I have many resources (mainly PDFs) that need to be imported to my site. Previously the files would manually be placed in sites/default/files/mydir and linked to the node like this: <a ...
0
votes
0answers
21 views

What Twig variable can i use to view Page Title or Taxonomy Name for a Taxonomy Type page

In Drupal 8 I need a way to get the Current pages title or Taxonomy name/ID. In the template taxonomy-term.html.twig the variable works: {{ term.id }} I need the variable to work in page.html.twig ...
0
votes
1answer
36 views

Problem with HOOK_preprocess_breadcrump (Caching?)

I run in a strange issue with breadcrumb modifying. In my template, I created a hook to show the current page in the breadcrumbs (for testing): function ...
0
votes
1answer
18 views

Show menu item to all users, prompt for credentials for anonymous

I have an item in the navbar that links to a page view which can only be accessed by authenticated users. I want the menu item visible for anonymous users, and also to have them redirected to login ...
1
vote
1answer
23 views

Set weight for JavaScript files loaded via theme.libraries.yml?

Im loading a JavaScript file via my theme's libraries.yml file. How can I change the weight of this file? I need the file to load before the core and module's JavaScript files. If I set header: true ...
0
votes
0answers
25 views

Custom JS not loaded when JS aggregation is enabled

I have a couple of custom JS files in my theme that works as they should. Except that when I enable the JS aggregation (in Config -> Performance) to speed things up these JS functions stop working, ...
0
votes
1answer
9 views

Use different comment template for replies-to-top-comment

I tried to make StackExchange-like comment section with different template for the comment replies. I create two template for both top-level comment and its replies. This is the result of the two ...
0
votes
0answers
20 views

How do I add menu list programmatically?

I want to add a menu list automatically after my theme is being installed. I added a new region called "Second Navigation" to my theme and I want to assign a new menu list to the "Second Navigation" ...
0
votes
0answers
11 views

What is the best way to create a User Account management area?

So I'm working on a feature set where there is the Administrative area, supported with the main and primary admin sections, nothing special there really. But I have to build a User Content Management ...
1
vote
1answer
16 views

if term reference is value X in tpl.php file

I want it so that in my page.tpl.php file if the user has selected "Standard" as the "Page Type" term reference it prints an extra bit of html. I tried something along the lines of the code below but ...
0
votes
0answers
11 views

Custom Block with form does not submit

In D8, I made a custom form. After submitting you redirected to a custom page and get a message there. So far nop. Then I made a custom block that render this form into a block region. Everything ...
0
votes
0answers
16 views

How can I show just price field in page--node--add--[content type].html.twig

How can I show just the price field (field_price) in page--node--add--[content type].html.twig, something like {{ node.field_price }}?
1
vote
0answers
18 views

Set up a subtheme that is used by mulitple sites, but has different JavaScript for each site

I have a Drupal 8 base theme and a subtheme. There are 3 sites with different DB's that will share this single subtheme. Each site will use different JS scripts (eg: Google Tag Manager, Parse.ly) ...
3
votes
1answer
36 views

How to modify HTML layout inside a View template

I am very new to Drupal and this is my first post in this community. What I am trying to achieve I know may be very simple but just don't know how! So I am looking forward for expert help. First ...
0
votes
0answers
26 views

How do I know if a link has the “active” class?

I've added a custom twig template for links--language-block.html.twig. Inside of it, I want to render additional HTML when the current item is active. But I can't figure out how to check when the ...
0
votes
0answers
17 views

Setup theme for my subsite

I have a Drupal 8 multisite setup. In sites/default/themes/theme1 I have my default theme for site1. Here I placed and changed all Foundation 6 files etc which makes my theme work like I want. Now I ...
0
votes
0answers
18 views

Little customization to gratis theme

I am using the Gratis theme, but there is a little problem. Here is the screen shot of the block region demonstration: Yellow are the regions. I want to make the 1,2,3 marked area into one top nav ...
5
votes
2answers
70 views

How do I theme a link?

In Drupal 7 this was possible. $link = array( '#type' => 'link', '#title' => t('My Title'), '#href' => 'node/1', ); drupal_render($link); But I've tried this with Drupal 8, and it ...
0
votes
0answers
12 views

Add style variables to body when field in not empty

I have a small problem with bootstrap templating. My goal is to pass style attributes to the body element when the content field is not empty for custom content type (custom content type page). I ...
3
votes
1answer
35 views

Place a block inside a twig template

I've got a custom content type 'professor', and a 'node--professor.html.twig' in my theme (derived from 'classy') to override the standard markup. The designer wants me to put a list (a view?) of the ...
0
votes
0answers
25 views

Twig field collection theme get field id

I am trying to get the field ID of of a field collection item being rendered in a field collection theme twig file: field-collection-item--field-name.html.twig. I am able to render content using ...
0
votes
1answer
35 views

Move template function to custom module

I have a function in my template.php file but I've now created a module that manages these particular tasks so I want to move the function over. This is what I have in my template.php file: function ...
0
votes
1answer
22 views

How do I keep content's styles?

I have created a new custom content type: tw-how-to-guide. This is a simple content type that only has one field: a paragraph module. And this paragraph module contains: some nested paragraph ...
0
votes
0answers
11 views

Some templates are not properly compiled to Twig

I have a few templates that are failing when compiling them in twig. What is happening is that the \Drupal\Component\PhpStorage\MTimeProtectedFastFileStorage::save method will create a temporary file ...
1
vote
1answer
26 views

Sub theming Seven theme

Is it possible to create a subtheme for the core Drupal Seven theme? If so, how do I do this? I had already tried to do it a few months ago to override the templates for Simplenews but it wasn't ...
0
votes
0answers
11 views

Render Registration Form

I'm trying to get a renderable object for the Registration form. This answer looked promising, but it appears that the registration form is an entity form. I looked into this answer which seems like ...