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
1 answer

Drupal: Add id to error list

Is there a solution to add an id to the default drupal error list items? Currently i got this:
  • Name is required.
  • Email is required.
  • Message is…
gearsdigital
  • 13,915
  • 6
  • 44
  • 73
2
votes
2 answers

Does Drupal have print button like print link

Drupal has a print link function that I'm using in my .tpl.php l makes it become a link. Does drupal have an equivalent API function to make buttons? If not, what's your best suggestion for this?
Berming
  • 1,302
  • 4
  • 18
  • 34
2
votes
5 answers

How to get current page URL in Drupal?

I'm trying to output the current page URL on a Drupal site (Drupal 7), I've tried the following... Which outputs the page name but not the URL, any ideas on how to output the full URL too?
steffcarrington
  • 404
  • 3
  • 13
2
votes
2 answers

Best Drupal layout techniques

How do You define the layout of Your Drupal sites? Which techniques do You find most useful? I'm quite old-school and stick to templating. It's true that I haven't practices the others too much. Yet, I'm also afraid that HTML output from Panels,…
Michał Pękała
  • 2,359
  • 5
  • 22
  • 32
2
votes
3 answers

Select a template through the admin area?

Up to now, I've always hard coded what page template a certain page should use, either based on the URL, or what type of node it is. What would be really useful is if there was a way to select which tpl file to use, right there in the node edit…
jsims281
  • 2,206
  • 2
  • 30
  • 57
2
votes
2 answers

On new Drupal 8 site, sub menu link does not appear?

On new Drupal 8 site, sub menu link does not appear when Basic Page is linked under upper level menu item. Parent link is set to Show as expanded.
RAJAMOHAMED
  • 35
  • 2
  • 9
2
votes
1 answer

How programmatically assign selected menu to superfish menu…?

In my custom theme there is an option to choose navigation menu and type of navigation menu (TB Megamenu and Superfish Menu) from a select list in theme settings page. In my tpl file am able to pass selected menu into TB Megamenu using the following…
Abin
  • 171
  • 7
2
votes
2 answers

Drupal, CCK -- remove draggable reorder for non-admins

Is there a clean way to remove the draggable option on multiple-value CCK fields? I assume I could style it out with CSS but that doesn't seem like the "right" way to do it. Ideally, the draggable option wouldn't be available for any users except…
Ian McIntyre Silber
  • 5,553
  • 13
  • 53
  • 76
2
votes
2 answers

'Smart' way to include the same HTML in multiple TPL files?

Im using the same HTML (below) in multiple views TPL files. Its used to make my own custom pager work with JavaScript. At the moment im creating a TPL file for each view and then adding the full markup every time. This isnt great from a maintenance…
Evanss
  • 23,390
  • 94
  • 282
  • 505
2
votes
2 answers

Drupal 6: getting particular fields from Node Reference types

I'm a drupal newbie... field_date[0]['view']; ?> I can get the custom created CCK fields' value and display in tpl.php files as above... that's fine. my question is how can I get the Node reference fields' in-fields? for example,…
designer-trying-coding
  • 5,994
  • 17
  • 70
  • 99
2
votes
2 answers

Drupal 6: Drupal Themer gives same candidate name for different type of content types

I'm a drupal newbie... I have different type of contents like News, Events, etc. and their content is different. News detail page has title-content text-date. but Events detail page has title-date-content text-location-speaker-etc. So I need…
designer-trying-coding
  • 5,994
  • 17
  • 70
  • 99
2
votes
2 answers

Count rows in Drupal views plugin

I've written myself a Drupal Views row plugin and I want to count the rows so I can do something with the output every Nth row. I can do this in the plugin's preprocessor function but if it gets used more than once (in panels for example) I can't…
Rimian
  • 36,864
  • 16
  • 117
  • 117
2
votes
3 answers

How does one inject variables into page templates from a custom Drupal module?

We've created a custom module for organizing and publishing our newsletter content. The issue I'm running into now -- and I'm new to theming and Drupal module development, so it could just be a knowledge issue as opposed to a Drupal issue -- is how…
Michael T. Smith
  • 568
  • 3
  • 22
2
votes
1 answer

Drupal: display views page instead of default node/%

Case is that im using views for displaying each of content-types. eg. q=?news/12 for news by nid q=?product/13 for products by nid Problem is when im creating (or editing) new content, it automatically displays (or refer) ?node/14 instead of…
Gregor
  • 385
  • 3
  • 15
2
votes
2 answers

How do I theme Form API buttons in Drupal?

The default output from Drupal's Form API is: How do I theme that so I get:
larssg
  • 5,385
  • 3
  • 21
  • 23