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
2
votes
3 answers

How to pass arguments between views in Drupal-7

I consistently find myself up against the following use case, and have yet to grok the proper workflow / solution: I would like to display two views. In the first view, each row displays one node of type-x. The second view shows nodes of type-y,…
starsinmypockets
  • 2,264
  • 4
  • 34
  • 45
2
votes
4 answers

How to programatically disable regions on a drupal 7 page?

I am working on a module where i have a page that must have no regions or extra content. A kind of "please wait" page. How do i diable all extra content (regions menus...etc) ? i think Panels has this ability but i can't find the snippet it uses. On…
redben
  • 5,578
  • 5
  • 47
  • 63
2
votes
3 answers

Theming node body in Drupal 6

I'm trying to make Drupal output the body of a particular content type in div tag with certain class name. First, I tried to override node.tpl.php, but I discovered $content variable here already contains body along with additional custom cck…
Dmitry Vyal
  • 2,347
  • 2
  • 24
  • 24
2
votes
4 answers

Drupal 7 - Place field descriptions above the field

By default in Drupal 7, field descriptions appear below the field. Is there anyway to move them above the field? In Drupal 6, you could paste the following code in template.php to move the descriptions. However, the code does not work in Drupal…
big_smile
  • 1,487
  • 4
  • 26
  • 59
2
votes
1 answer

How to override already added meta tags in Drupal 7?

In the theme vendor file I have: $element = array( '#tag' => 'meta', '#attributes' => array( 'name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0', ), ); drupal_add_html_head($element, 'bootstrap_responsive'); I…
igorpavlov
  • 3,576
  • 6
  • 29
  • 56
2
votes
2 answers

drupal menu customizacion via css?

I've been fiddling around with drupal theming quite succesfully (or at least, that's what i think), but when I tried to inject css coding to the primary links menu to customize it as i generally do via html+css, i hit a wall. I have been able to…
MauF
  • 461
  • 4
  • 17
2
votes
1 answer

Drupal Theming: Best to build a theme from scratch or use Genesis (or similar) as a foundation?

I'm developing a web site for a further education college in the UK, using Drupal (6.19). The site won't contain a huge volume of content and the structure is fairly simple. I understand HTML and I have an reasonable understanding of PHP, SQL and…
unpossible
  • 303
  • 1
  • 8
  • 20
2
votes
2 answers

Twig: how to check the inner html content of a field

i have a single field and that field can have one or two lines of html:

One line

or:

first line

Second line

Using twig how can i check if the field has one or two tags. Example of what i want to do: {% if item|length('

')…

wolfhowling
  • 83
  • 1
  • 7
2
votes
1 answer

Drupal 8 - how to customise search result template

I have a custom content type with several fields like Price, Product Summary, Product image etc. Is there any way I can access these fields separately on search result page? I printed the rendered array on mytheme/item-list.html.twig using…
Subrata Sarkar
  • 2,975
  • 6
  • 45
  • 85
2
votes
1 answer

View: Exclude nodes that have the same taxonomy term id(s) as current node

Drupal 8 I have a content type with a field that holds a Taxonomy Term Reference. I want a View that shows other nodes of the same content type that do not have that field with the same Taxonomy Term ID as the currently viewed node. Example: URL:…
2
votes
1 answer

Drupal 8 Customize template content type form page

I am trying to customize a simple add form page. My content type, created via admin interface, is very simple, it's got 4 fields I want to display. But I want, in the future, to show more fields. And the maximum to be managed by the system. I need…
Cifren
  • 364
  • 1
  • 4
  • 15
2
votes
2 answers

Drupal page content

I'm new to drupal and reading through docs, but hoping to get an explanation for something. I have a page called page--type-home-page.tpl.php. Part of this page prints render($page['content'])). I want to remove something that is rendered as part of…
LemonMan
  • 2,963
  • 8
  • 24
  • 34
2
votes
5 answers

HTML Template to Drupal Theme

I have an HTML template. What are the steps to convert it into a Drupal 6 theme?
Bharanikumar
  • 25,457
  • 50
  • 131
  • 201
2
votes
1 answer

Loop through fields in Drupal 8

I'm kind of new to Twig templating and Drupal 8 and I'm having a bit of trouble looping through some fields in a node template file. Basically, I have a Date field limited to a maximum of 2 fields, and if 2 fields are entered, I would like to…
m918273
  • 110
  • 2
  • 11
2
votes
2 answers

Drupal 8 language switcher theme file

Where I can find drupal 8 language switcher block and/or theme file ? I have been looking quite many blogs and forums for this but I either have not the files or not such code in file(s) they suggest. Thought there is modules like switcher dropdown…