theme

How Drupal 5's Administration Theme functionality works

Description & Info: 

Drupal's administration theme functionality works very simply: if the first argument of the internal path is admin, the custom theme is set to the admin theme.

This suggests that the $custom_theme variable can be set by modules to change to any arbitrary theme, and it will override the default theme.

Load a node for a template file- in exactly the same way a node object is presented to a theme

Key words and phrases: 
useful function module Drupal drupal render node
Description & Info: 

Motivation for this function: sure, we could use a plain node_load($nid) and wrap every $node->field['0']['value'] in a check_plain or the function for rendering with the proper input format (check_plain). The proper format is available to be grabbed from the data provided by a regular node_load.

by Benjamin Melançon
Posted on Fri, 2008-03-14 08:12
in

Path to theme

Looking for the drupal path to your current theme? It can be helpful if you're making a theme and, for a change, you want to link directly to

print theme('stylesheet_import', base_path() . path_to_theme() ."/modules.css");

For our purposes, something like:

<img src="<?php echo base_path() . path_to_theme() . "/sample.png"; ?>" />

Now I'm not sure that "." in echo will work. Feel free to test it out for us!

UPDATE: To get print an image that is in your theme by getting its path, Agaric thinks the recommended approach is

<?php

by Benjamin Melançon
Posted on Mon, 2007-02-12 23:31
in