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)

1
vote
0answers
18 views

Drupal 8: {{ front_page }} not working in partial

I have a partial located at partials/header.html.twig that I am calling on one of my sub pages with this code: {% include directory ~ '/partials/header.html.twig' %} Whenever I use {{ front_page }} ...
0
votes
0answers
13 views

Drupal 8 : Render a field collection item in a Twig template

In Drupal 8, I have a content type which use Field Collection Module like that : field_body (FieldCollection, repeatable) field_image_alignment(Boolean) field_picture (Image) field_free_text (Long ...
0
votes
0answers
24 views

Absolute path to an image [duplicate]

This is a really basic question, but I haven't been able to find a clear answer on how to do this: I am designing a TWIG template and am inserting an image into it. I would like the image to have ...
0
votes
1answer
17 views

How do I display mysql fetch results in a table? [on hold]

I am querying the mysql result and try to display that in a table format what i tried : function mysql_result2html_2($result) { $server_name = $_SERVER['SERVER_NAME']; $url = ...
0
votes
2answers
21 views

How align the image and content in same in this views slidehow

This is a slide show generated by Views Slide module in Drupal 8. Can any one tell me how to put the image and content in same line? Below is the markup generated by the view config. <div ...
0
votes
1answer
32 views

Formatting email sent with Contact form

I created a custom form (adding some additional fields) using the Contact module from the core of Drupal 8. When I submit the form is sent an email containing all values, but it is really bad ...
0
votes
1answer
13 views

How do I theme a blog listing page for a specific taxonomy term?

I have a site, where a blog listing of a particular category, say Resources, has to have the "Read More" button say "Download Resource" instead. I saw that this is controlled by a template file ...
0
votes
0answers
30 views

Overriding custom templates in a theme

I am having trouble creating/registering custom templates in a module and overriding them in a theme. For example, I have this in my_module_theme(): $theme['contact-page'] = array( 'render ...
1
vote
0answers
23 views

Theming forms. Form-element

Please, help. Is it possible implement different templates for form-element.html.twig? For form 'user-form' one template, and for other forms second template.
0
votes
2answers
33 views

what is the hook name in order to alter theme function of specific element

imagine that we have a list if items in $items array that it's theme function is list_item in specific page. code is theme('item_list', array('items' => $items)); but in my module, I want to ...
1
vote
1answer
35 views

Display field collection items by using twig

I'm using the field collection module in Drupal 8 to encapsulate event informations so I've got a field collection with six sub fields (place, starting time, etc.). In my twig template ...
3
votes
2answers
25 views

How to get link path in custom block for a view?

I created a view (unformatted) associated with a content type with two simple fields for a block. The view is called "phrases" have generated two .tpl: a) ...
0
votes
0answers
17 views

How to programmatically render a field collection in Drupal 8?

For "normal" fields, this works: $node = \Drupal::routeMatch()->getParameter('node'); $field = $node->field_foobar->value; print render($field); But if the field is a field collection, it ...
1
vote
1answer
20 views

Drupal8 - Templating a all form in detail on same page template

I need to display a form with complex HTML structure in my custom module. And not a single field had the same wrapper structure. So I need more flexibility in my template custom.html.twig than just ...
0
votes
1answer
21 views

Change quote to &laquo; &raquo;

I'm using Drupal 7. A lot of text are using quotes like "text" or «text». I want that for all older text on the site as well as for new text there will be one type of quotes used: «text». Can you ...
-1
votes
0answers
15 views

PHP Interitance how to access parent class function [on hold]

I'm new to PHP oops concept. I have tried sample code for PHP inheritence but I didn't get expected output. I didn't found any issue. Output will be " Message from: Google" <?php class ...
1
vote
1answer
34 views

Can we remove template.php from active theme folder?

If we remove template.php file from active theme folder will it work ? Will it follow default theme's template.php ? Please help with this question.
0
votes
0answers
5 views

Drupal view preview links to origial content, but not full content

My view presents a preview of truncated articles. When the "title" field is clicked, you are brought to a "full content" page of that preview. But the "full content only shows the title and body. I ...
0
votes
1answer
13 views

Content types - custom view

I know there is option to preview content type after save. But i want to customise that preview by my css..i want to use image i upload to content type as background and put text on it from content as ...
1
vote
1answer
19 views

What is the alternative of hook_custom_theme in Drupal 8?

I need to change the theme based in custom criteria. Some nodes should be displayed with one particular theme and others with the admin theme. In D7 I could simply use the pathauto module and set ...
0
votes
1answer
14 views

IP-numbers not found in database table ip2country

I am trying to hide a certain field in the product nodes for all visitors from other countries. I have installed the ip2country module and I am using this code snippet to fetch the language code in my ...
0
votes
0answers
17 views

Curly pages in Drupal 8 [closed]

How can I add curly pages in drupal 8 ?
1
vote
1answer
14 views

Theme CSS won't load in a D8 theme

I'm creating a new D8 theme and am having trouble making Drupal load the CSS that is a part of my theme. I have disabled cache and am sure I'm getting the up-to-date output. Here's my ...
0
votes
0answers
6 views

Is it possible to display Entityform Types using Page Manager and Panels in D7?

Currently, I have a D7 site and my main Content region is displayed using Page Manager and Panels variants. I've created an Entityform Type that allows users to request an appointment, and I'd like ...
0
votes
2answers
33 views

What is the name of the template to theme a reset password mail?

I want to theme the mail which is used to sent a link to user when the user forgot the password. I want to know what I need to name the template file so that Drupal will take my email template file. ...
0
votes
1answer
24 views

How do you print View fields on Twig?

I have a view and added the title as a field. For example: How do I print the title? In Drupal 7 it was as simple as views-view-fields--[viewname].tpl.php <?php print ...
2
votes
1answer
28 views

How to add custom page.html.twig for views page?

I have a view page with url and machine id search I need to add a custom page.html.twig for that specific view page so that it does not affect the rest pages. How can I implement it? I tried adding ...
1
vote
1answer
57 views
+50

How to get the valid URL of a Link field from within a Twig template?

I have a Link field named field_my_link (machine name). Within a Twig template I can get the link's URL value with this: {{ node.field_my_link.uri }} If inside the Link's URL there is an external ...
0
votes
1answer
31 views

Counterup JS to work

According to Counter JsInclude <script src="http://cdnjs.cloudflare.com/ajax/libs/waypoints/2.0.3/waypoints.min.js"></script> <script src="jquery.counterup.min.js"></script> ...
1
vote
0answers
16 views

My themes breakpoint file isn't being loaded

For some unknown reason my theme is not loading it's breakpoint yml file, is there anything that could block this from being loaded? Edit: Filenames correct if I copy it to another folder it works. ...
0
votes
0answers
11 views

Show main menu in Foundation 6 Off canvas by loading a different twig template

How do I load my Primary menu in my Foundation Off canvas region off-canvas position-left? In menu--main.html.twig I have below structure for my desktop menu: <div class="top-bar nav-desktop ...
1
vote
0answers
32 views

What is the best way to access css and js from drupal 8 theme

I am integrating angular 2 in a drupal 8 theme. Angular 2 needs to access multiple CSS and js files for the components. If I include it using the libraries it gets concatenated and gets exported into ...
0
votes
0answers
15 views

Printing Fields in Views Style Template

Could someone please point me in the right direction of the correct way to print fields in a views style template? I'm building a carousel that contains testimonials, and the carousel indicators are ...
0
votes
2answers
142 views

How to print Taxonomy Terms in Templates?

How can I display Node Taxonomy Terms in drupal 8 Templates. We do this in Drupal 7 by add this code to node.tpl.php file: print render($content['field_tags']); I tried adding the below code in ...
3
votes
1answer
51 views

Customize the HTML of a link field from a custom theme

I've a Link field named field_home_link, attached to a Content Type named Home, and I'm trying to customize how it is rendered as HTML from inside a custom theme. Instead of the default generated ...
0
votes
0answers
12 views

How to: Replace UberCart Order Module Default Icon (gifs) with Bootstrap Related Icons

I would like to replace the default icons (as in code path below) in the UC Order module, with Bootstrap theme related ones as they are not suitable visually (too old in style) and I would like a ...
0
votes
0answers
14 views

Print a specific Views Block in twig template [duplicate]

So, I created a block using Views and I´m trying to call it from a template. mytheme.theme file has: function mytheme_preprocess_node(&$variables) { $variables['block1'] = entity_load('block', ...
0
votes
1answer
35 views

Non visible fields

I'm extending a Drupal 7 theme with a new template file to be called by a view. Here my simple my template file, called views-view--agendas.tpl.php <?php // ...
0
votes
0answers
9 views

How do I access content of title item in views-view-list.html.twig (Drupal 8)

In my view-list template file how do I access content for the group (title) content. For example I have a view that shows taxonomy items under a parent items. Group 1 item 1 item 2 item 3 item 4 ...
0
votes
1answer
22 views

Remove the image style from node--type.tpl.php [duplicate]

Is there a way from a node--'type'.tpl.php template to remove the image style of an image field?
0
votes
1answer
19 views

Seemingly random <h3> being added into views node header for content type

I've got what seem to be random empty <h3>s appearing whilst displaying a custom content type as a teaser in a pretty standard blocks display through Views. Now this is only a problem because ...
0
votes
1answer
18 views

Unique Classes on lists items

I'm very new to Drupal 8 theming and I'm trying to replicate a random website to practice. I have a problem recreating this part though: I have a block with the latest news articles and a block ...
0
votes
2answers
22 views

Panels are wrapping the content into weird <strong> tags

I am new to panels, using panels module to set the page that contains 3 views on it (nothing wrong with these views), when I add the content, the output displays weird tags those are wrapping the ...
1
vote
1answer
64 views

How can you render fields from an entity reference in node templates? [Drupal 8]

For context, I'm dealing with two content types: article and team_profile. In article nodes, we have an entity reference field pulling a team_profile node in to serve as the author information. I ...
0
votes
1answer
12 views

Passing computed data from Theme preprocess functions to Twig templates

I'm using Drupal 8. My general problem is this: I need to compute some data from PHP code, usually using Drupal APIs, then pass computed values to a Twig template in order to showing it. For ...
-1
votes
1answer
18 views

Any easy way of implementing a mega menu?

Im wondering if there is a easy way to implement the following dropdown menu(ive added a before hovering on a list item, and after): If i had to do it right now, i would use a bootstrap dropdown, ...
0
votes
1answer
20 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: {{ ...
0
votes
0answers
26 views

Theming menu--main.html.twig to Foundation 6 Top Bar responsive menu

How do I have to change menu--main.html.twig to get Foundation Top Bar working? This is what I have so far in menu--main.html.twig: <div class="top-bar"> <div ...
2
votes
2answers
49 views

Check if field is not empty in Twig templating

What is the best method to check if a field is empty in a node template. In node--example.html.twig we can use "content" variable. I can't use check like checking a block {% if ...
2
votes
1answer
33 views

How do I use twig templates with views?

I'm trying to figure out how to use twig templates with views. at the moment I'm just using twig in the view itself but I'm sure I can use twig files to overwrite the styling of the view. e.g. ...