Questions tagged [drupal-theming]

In Drupal terminology, "theming" is rendering or modifying the HTML markup produced by a module or a theme.

Drupal theming system allows a theme to have nearly complete control over the appearance of the site, which includes both the markup and the CSS used to style the markup. For this system to work, modules, instead of writing HTML markup directly, need to return render arrays, which are structured hierarchical arrays that include the data to be rendered into HTML (or XML or another output format), and options that affect the markup. Render arrays are ultimately rendered into HTML or other output formats by recursive calls to drupal_render(), traversing the depth of the render array hierarchy. At each level, the theme system is invoked to do the actual rendering. See the documentation of drupal_render() and the Theme system and Render API topic for more information about render arrays and rendering.

Reference

822 questions
3
votes
2 answers

How do I enable the Theme developer module in Drupal 7?

I am working with drupal 7.4, and have installed the Devel module; however, I am missing the "Enable theme developer" link in its menu. Is there anything I have overlooked here?
Peter
  • 47,963
  • 46
  • 132
  • 181
3
votes
2 answers

Drupal 7, trying to "theme" the node links i.e. "Add new Comment" "Read More" etc

I'm spending more and more time here, and constantly wishing Drupal was easier to understand then I'm finding it, oh well :) so todays question is, I'm trying to remove the "2 comment" and "1 new comment" links from a node in Teaser view. I do…
Purplemonkey
  • 1,927
  • 3
  • 27
  • 39
3
votes
4 answers

Drupal 7: Hiding labels with empty fields when viewing a node

How do I hide labels that have empty fields when viewing the actual node of a certain content type? I'd really appreciate anyone's help, thanks for your time.
WebMW
  • 514
  • 2
  • 13
  • 26
3
votes
2 answers

Accessing field value in Drupal 7 on load_node in template

In a template for a content type I am loading a node from a node reference. It loads and if I do a print_r I get this: stdClass Object ( [vid] => 40 [uid] => 14 [title] => Cover [log] => [status] => 1 [comment] => 0 [promote] =>…
3
votes
3 answers

Accessing the referencing / parent element in twig (paragraphs)

I have an entity reference field inside a (parent-)paragraph, which references multiple child-paragraphs. Is it possible to access field values of the referencing paragraph in the children's (referenced paragraph's) twig templates? Actually I'm just…
3
votes
1 answer

Drupal 8 how to create a template for a custom block type

I want to create a template for a custom block type I've created by going to structure/block layout/ types/ add custom block type. The type I've created is called menu. How do i create a template for this custom block type from here? I'm not as…
3
votes
4 answers

How to print the node taxonomy in a block?

I'd like to print taxonomy terms (from field field_tags) in a block on a node view page (in a Zen subtheme). So what I did was. template.php function michal_preprocess_block(&$vars, $hook) { if ( arg(0) == 'node' && is_numeric(arg(1)) ) { $node…
Michał Pękała
  • 2,359
  • 5
  • 22
  • 32
3
votes
2 answers

Changing Drupal's theme and keeping Garland as the admin theme?

How to apply a contrib theme to a Drupal-6 site without changing the administration theme -the contrib theme for the site and Garland for the administration interface- ? Thanks.
wassimans
  • 8,382
  • 10
  • 47
  • 58
3
votes
3 answers

Drupal Views 2: Output using custom markup

I have a simple view that grabs 4 fields, basically it grabs the fields of a specific content type. The fields are as follows: CSS class (plain text) Image (image) Title Body Pretty simple stuff. I've got the view created, but I need to output…
creativetim
  • 1,138
  • 2
  • 13
  • 26
3
votes
1 answer

Drupal 8 getting a referenced entity's field value in its parent in twig

This is my setup. I have a custom block type that has a reference entity field. It references a content type of "Products". The Products content type has a reference entity field to a taxonomy vocabulary of "Series". The Series taxonomy contains a…
SkankHunt42
  • 33
  • 1
  • 5
3
votes
1 answer

Drupal print breaks when rendering a region

I've come across a bit of a stumbling block with the code in a Drupal site. The issue only started when moving from 7.33 to 7.36. What happens is, rather than display the content of the page,…
tamegeek
  • 33
  • 4
3
votes
3 answers

Is it possible to add custom fields to a Drupal taxonomy term?

I'd like to add a date field to a drupal taxonomy term, alongside the default "title" and "description" Is there some technique/php/module that lets me do this? Is it possible to do with CCK?? I need to be able to display the new field in the same…
David Meister
  • 3,941
  • 1
  • 26
  • 27
3
votes
2 answers

Drupal and Comment Form

I need to insert the comment form directly to the node template (I use node-type.tpl.php to theme the node-type). In related issue, if I go to /comment/reply/NID I get the comment form, but it's got only "preview" button, and no submit button. the…
Eli
  • 2,666
  • 7
  • 33
  • 37
3
votes
3 answers

Customise Drupal View Output

Quite new to Drupal theming and need some help editing the markup a view outputs. I know I have page templates, node templates, block templates; but what about views?! I choose the fields that are displayed in the results using views UI but that…
SlightlyClever
  • 401
  • 3
  • 7
  • 20
3
votes
2 answers

Drupal - Devel Themer not showing

At first, it was showing me Class 'simple_html_dom' not found in ... but I found the solution. Now even though Theme Developer module is activated, it doesn't show the radio box to check on the bottom left corner and Drupal doesn't show any error…
Mehdiway
  • 10,337
  • 8
  • 36
  • 68