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

Remove the red outline on form elements that fail validation in drupal

When a drupal form fails validation, it is redrawn with the elements that failed validation surrounded in a red border. Drupal does this by adding the error class to the input elements, and specifing a 2px red border on input.error elements in…
Rob Crowell
  • 1,447
  • 3
  • 15
  • 25
4
votes
3 answers

Drupal 8 include part template

I'm trying to use Drupal 8, with an own theme, due big structure differences for my requirements I have a page--front.twig.html and a page.twig.html, I would like to create template parts as used in phrozn oder in a normal Symfony2 project, for…
felipep
  • 2,442
  • 1
  • 28
  • 35
4
votes
2 answers

Trying to get div's to display side by side in a grid using singularity gs

I'm just beginning to get into responsive design techniques using Drupal, Omega 4 theme, and would like to use the singularity grid system. I don't know CSS very well (the basic principles yes, the subtleties no), and SASS seemed a good way to go as…
4
votes
1 answer

Install superfish menu in drupal 7

I need to use superfish in my site built upon Drupal 7, I installed libraries and superfish modules and enabled them. Also I installed superfish library and everything went OK. Also, I have added a new region named "superfish_menu" into…
Ayman Hussein
  • 3,817
  • 7
  • 28
  • 48
4
votes
4 answers

Remove stylesheet selectively in Drupal for page

I am trying to make different layout for the front page. In that process I declared new stylesheet called "front-page.css" and page--front.tpl.php. I am using a Zen subtheme which loads responsive-sidebar.css. I want to remove…
rockvilla
  • 641
  • 8
  • 15
4
votes
3 answers

Drupal 7 - add the same class to all tags in the content area

I have an online Portfolio site that I transferred from a static HTML into Drupal 7 - trying to learn Drupal. I have 3 separate pages that have image galleries. I have a javascript (.js) file that adds reflections onto any image that carries a…
Biggest
  • 681
  • 2
  • 9
  • 16
4
votes
2 answers

Drupal: How to render a span inside a link?

I want this result: This is a link! with a span inside! This renders a link: $render = array( 'link' => array( '#type' => 'link', '#title' => t("This is a link!"), '#href' =>…
tolborg
  • 612
  • 4
  • 21
4
votes
3 answers

Include two versions of jQuery on a page without affecting old plugins

Our drupal site runs with jQuery version 1.2.1 which we have not upgraded. The problem is this: We need to add a new plugin named jQuery Tokeninput, but it's working only in latest jQuery versions. We tried adding the latest jQuery version with old…
gvm
  • 1,153
  • 3
  • 12
  • 19
3
votes
4 answers

How to theme views fields in Drupal 7 correctly

I need to theme views in Drupal 7. There is a content type 'Book' and I need to list 5 books and theme them in special manner(preview image, title and author). When I override views-view-field.tpl.php and print raw SQL result, I see that all fields…
mechmsk
  • 129
  • 2
  • 3
  • 8
3
votes
2 answers

How to get the absolute path to the sites/all folder in drupal?

I want to display two different logos on my drupal site: one for the front page and one for the inner pages. if (drupal_is_front_page()) { $variables['logo']=drupal_get_path('theme', 'hanna') . '/images/logo.png'; } else { …
3
votes
1 answer

Is it possible to use a template file to return HTML for an AJAX call?

A site I'm working on uses AJAX extensively to lazy load page data and to do Twitter style paging. I'd really like to be able to render the HTML via a template file as it will be easier to code and maintain than building an HTML string in a PHP…
SomethingOn
  • 9,813
  • 17
  • 68
  • 107
3
votes
3 answers

Drupal 7 hook_theme() not loading template file

I'm trying to get a very simple module to load a template file using drupal's hook_theme(). It's pretty much as simple as you can possibly imagine. function sectionheader_theme ( $existing, $type, $theme, $path ) { return array( …
Jape
  • 31
  • 1
  • 2
3
votes
2 answers

How to apply template (tpl) file for email message body

I've this mail function in my custom module function mymodule_mail($key, &$message, $params) { switch ($key) { case 'notification': $message['headers']['Content-Type'] = 'text/html; charset=UTF-8; format=flowed'; …
Vikas Naranje
  • 2,350
  • 5
  • 30
  • 40
3
votes
3 answers

How do I remove a colon from a label?

I've Googled for an answer, but most posts seem to be talking about labels within forms. I have custom fields set up in content block in Drupal 7. When I show the titles (labels) of those custom fields, it adds a colon after after the title. Is…
Brett F
  • 414
  • 6
  • 11
3
votes
2 answers

Drupal 7, Not sure how to theme my output correctly from query data

I’ve been using Views to selectively returned nodes, but right now I want to return my nodes and use the Taxonomy term as a group header. I can't see anyway to get Views to do this for me, other then create multiple views on one page. So I thought…
Purplemonkey
  • 1,927
  • 3
  • 27
  • 39