"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 (9)

1
vote
1answer
12 views

Internal path in twig template

I'm trying to link to a Drupal path like "Contact Us" in my Twig template. I've tried this code in my Twig template but I can't get any result. <a href="{{ contact }}">{{ 'Contact'|t }}</a&...
2
votes
0answers
11 views

Adding custom variable to twig's html.html.twig which is not cachable

In the html.html.twig file of the theme I'm using, I want to add a custom variable called {{ amount }} like: <div>Amount of items in cart: {{ amount }}</div> And I want it to be (in php):...
0
votes
0answers
17 views

How do I group nodes by term? [on hold]

In my site I need a page which is grouping by term. I create a view and group by term which, but I need an output like the following. <div id="term_id"> <div class="group-header"&...
0
votes
2answers
15 views

Notice Undefined variables [on hold]

I have many notices in my site. Notice: Undefined variable: item in include() (line 79 of templates/page.tpl.php). Notice: Trying to get property of non-object in include() (line 79 of templates/...
0
votes
1answer
22 views

Cannot create a Drupal sub-theme with drush

I get the following error when I try to run the "drush fst foundation-subtheme" command. sh-3.2# drush fst foundation-subtheme The drush command 'fst foundation-subtheme' could not be found. Run ...
0
votes
0answers
8 views

Create a subtype of Panel & style it with a template

So I'm trying to build a independent Landing Page for an event on our drupal 7 site. I would like to have the page contain a different main navigation menu then our site and also has the functionality ...
1
vote
2answers
41 views

How to wrap a fields or other elements in div block?

I want to wrap these elements in one div (this div should be before div class = row) but I don't know where to add this div Example: <div class="col col-lg-4 col-md-4 col-sm-4 col-xs-6 "> ...
0
votes
2answers
33 views

How to get tid on behalf of node id (nid) in Drupal 8?

I am new in Drupal 8. I have created a node with category (taxonomy). Now I don't understand how to get tid by using nid. I am using $node->body->value to get the body field value and use {{ ...
1
vote
1answer
19 views

How to remove id=“node-[nid]” with Display Suite?

How I can remove the node id when I override a node layout with Display Suite? In some (old) how-to I noticed that the id node is not present when a node layout is overridden with DS. i.e.: from ...
0
votes
2answers
26 views

Custom module administration page template not working

I've been trying to load a custom template for a custom module page in the administration section, but the template isn't being loaded. This is the code so far: custom_theme.module /** * Implements ...
2
votes
1answer
25 views

Change part of theme according to time of day

In Drupal 8, I'm trying to change part of a twig template according to time of day. For instance, if in one of my twig templates I have: <img src="img_during_the_day.jpg"/> Where and what do ...
2
votes
2answers
26 views

count multivalue field values in twig

I want to count the number of values of unlimited field in twig tempalate I tried {{ node.field_mytext.count }} => faced with error and in another try {{ content.field_mytext.count }} => nothing ...
-3
votes
1answer
33 views

Does anyone know how to add this in twig template, or in .theme?

I want this to be converted as a twig functions where can I pass a node id to the functions and display the node information such as link, content body, and image itself. $nid = 1; $node = node_load($...
1
vote
1answer
28 views

Where does views's template files get saved?

I have created a view for content type = "Article" and have chosen "FORMAT" = GRID FORMAT Format:Grid | Settings Show:Fields | Settings My question is where does this view related template get ...
5
votes
3answers
82 views

Is there a more performant alternative than overriding template files?

I've got to get rid of a lot of unnecessary markup in a view. In general, I accomplish that by overriding the template files in my theme, but this time the view is really huge and performance is going ...
0
votes
1answer
16 views

Content Type based template not working for Medical Zymphonies Theme

I downloaded the Medical Zymphonies Theme and has been modifying that to create my own theme. In the past, I have successfully used content type-specific template files with themes that I created. ...
3
votes
1answer
36 views

How do I render an entity view mode like 'teaser' in a twig template?

I have an entity reference field in one content referencing an other content. What I'm trying to achieve is to display that reference in a teaser format programmatically. I was hoping that I could ...
0
votes
2answers
26 views

Form in custom template does not submit data

I have a custom form which I render in a custom template. I render the elements separately but the submit button does not fire the data to the validation/submit function. When I render the whole form ...
0
votes
1answer
27 views

How do I define a custom html.html.twig file?

I need to define custom html.html.twig file for particular url. What I did is given below: /** * Implements hook_theme(). */ function mymodule_theme() { return array( 'html__ajax' => array(...
0
votes
1answer
24 views

hook_theme_suggestions_page() provide default template file inside module folder

I am using hook_theme_suggestions_HOOK() to implement a custom template file in my drupal 8 website like below. /** * Implements hook_theme_suggestions_HOOK(). */ function ...
0
votes
3answers
28 views

Unable to generate html using theme_table in block view

I have created a block_view, In that block I want to show dynamic table. I have written following code. $table_headers = array(t('User'), t('Relation'),t('Period') ); foreach ($result as $row) { ...
3
votes
2answers
180 views

Best way to create mobile menu?

I have a template that I am trying to convert into a custom theme and it contains a mobile menu that is a duplicate of the main menu. What is the best way to tackle this with the least amount of ...
2
votes
2answers
36 views

How to add an additional wrapper div within a views row

I have a views page with a format of ‘unformatted list’. For a views row I’d like to add an additional div to act as an additional wrapper. The resulting mark-up would then look like <div class=“...
0
votes
1answer
23 views

How to load page content by url programmatically in custom region

How to load page content /node/add/page programmatically in custom region? Example of custom region (https://jsfiddle.net/makbuk/1vetkgL2/). I have found this How to get a node by its url alias? but ...
3
votes
3answers
81 views

How do I remove page title/header?

In Drupal 8, is there an easy way to configure a page so that its page header/title is not displayed on the page? I have created a Basic Page, with /home as path alias, and Home as title. I set it as ...
1
vote
0answers
35 views

Why the template_preprocess_field hook is not called for a custom template?

I'm working in a site that have implemented the template_preprocess_field() hook. I want to change the content of a field but the code works for all the nodes except for the nodes of a content type ...
1
vote
1answer
21 views

Wrap link around an element in twig

I have a twig template for a custom block, I want the entire block to be wrapped in a link. I'm using the link field, but I'm not sure how to get the url from the field within the twig template. This ...
1
vote
1answer
36 views

How can I get other content type data in current content type?

I want to put one condition in my template file of contenttype1. The condition is if contentype2 contains a field value X then I want to print one block in contentype1. So how can I get contenttype2 ...
0
votes
1answer
21 views

create book navigation menu tree

I have a book with few children article nodes. I would like to create a navigation block tree, that can be placed anywhere on page. Problem: Normally if I place book navigation block using context (...
0
votes
1answer
20 views

Ajax request return field without name attribute

Instead of getting multiselect on making ajax request while I select content type, I got single select and this select hasn't any name, so here's problem and I don't know how to fix it. can anybody ...
0
votes
1answer
9 views

Using taxonomy to give option of page layout - working but showing error (Notice: Undefined variable: node in include())

I have been building a site in Drupal 7. I have the content type "Basic Page" but added taxonomy terms for the user to be able to select "Standard" or "Full Width" page. If the user selects "Full ...
-1
votes
1answer
44 views

How to add prefix and suffix to certain vocabulary term names

I have vocabulary Height, with terms 50, 100, 150, etc. On the Taxonomy page, I want the title "Height 50 mm", "Height 100 mm", "Height 150 mm" etc. I know it must be something like this, but the code ...
1
vote
1answer
24 views

Custom theme covering up admin toolbar.

I am trying to convert a template to a custom drupal 8 theme and am having trouble with it covering the admin toolbar when logged in. I tried to inspect bootstrap when installed to see what was added ...
3
votes
2answers
95 views

How to add class to teaser P?

In Drupal 8, how can I add a class to teaser p html tag. I want to style the paragraph in teaser only, not when whole content is shown.
0
votes
0answers
26 views

Custom dashboard template [closed]

Hi all i want add Custom Html to admin Dashboard is it possible in drupal 7 For example i want my Dashboard like So there is any option to make .tpl file for admin Thanks
0
votes
1answer
23 views

Customize Search Result Snippet to use Teaser

I would like to customize the output of each search result item printed on the search result page. Right now it automatically prints a portion of the content of each item, but I'd like more control. I ...
0
votes
1answer
24 views

Create container.html.twig template for specific page

I'm attempting to edit the search page. I've edited container.html.twig to contain {% set classes = [ has_parent ? 'js-form-wrapper', has_parent ? 'form-wrapper', ] %} <h2>Search ...
1
vote
0answers
56 views

Why do I have so many CSS files?

Hi i am running from issue in drupal 7 site -problem There is lots of css files come in sites/defaults/files/css -uyqtwuetuwet.css -uyqtwuetuwet.zip -khkjhkhk.css -khkjhkhk.zip ...
0
votes
0answers
19 views

Why isn't my page--front.tpl.php for my sub-theme used?

I created a sub theme under Omega, and I created the page--front.tpl.php template in mytheme/templates for the front page, but It's not working. Can anyone tell me how to create a front page template ...
0
votes
2answers
46 views

Rendering blocks inside node

I am building a Drupal 8 site. The site will have basic pages (nodes) that have three fields: a title, a body and a list of embedded blocks. The idea is to allow the editors to create content blocks ...
0
votes
0answers
5 views

How to configure addThis module seperately for facebook,twitter,google+?

I am using addThis module for social sharing purposes, I have a question that is how can I configure the sharing of content for facebook,linkedIn,google+ seperately. In detail I can say some content ...
1
vote
1answer
20 views

Theming a webform file upload widget

I'm trying to replace the upload and remove buttons in a webform file upload widget with visual icons. I'm having trouble for a number of reasons but the most confusing is this: I don't see ...
0
votes
0answers
25 views

How do I create a PHP page?

I need to create a web page in Drupal 6. The site has multiple PHP pages under different themes. For example, inside opt/mycompanyWeb/web/sites/all/themes/custom/MyCompanyInterior there are a bunch of ...
0
votes
0answers
20 views

Custom variable does not exist in the included template fie

I tried to pass a custom variable to a template in mytheme.theme with the following code. function mytheme_preprocess_page(&$vars) { $vars['is_login'] = !\Drupal::currentUser()->...
3
votes
2answers
62 views

Check if the user is logged-in in a theme

In Drupal 7 we can simply check if the current user is logged-in in a theme by checking $GLOBAL['user']->uid or using user_is_logged_in(). How can I check if a user is logged-in in a page ...
1
vote
1answer
25 views

Sweaver not showing changes when logged out

In Sweaver module i am able to change css from front end when logged in. I save and publish the changes done in my site, but when i am not logged in user the changes done by me are not there.The site ...
0
votes
1answer
34 views

Twig template for search results page

I'm attempting to create a custom template for the search page located at 127.0.0.1/search/node I've created a template called search-result.html.twig in my theme/templates folder which allows me ...
0
votes
2answers
23 views

Custom User Login Template Error

I am using Drupal 7 and I have added some code to my template.php file in my theme (which I found on a Drupal tutorial) so I can use a custom template for the user login form. The form works and it is ...
1
vote
3answers
63 views

How do call the template for a module block

My goal is create a custom block that uses a twig template that you can pass info to via the theme function like so. public function build() { return array( '#type' => 'markup', '...
0
votes
1answer
48 views

How do I change the site name in the .theme file?

I'm looking for a solution to change the site name in a .theme file in Drupal 8. I'm using group module and want to display a different site name when the current user navigate inside each group. How ...