User login

theme

How Drupal 5's Administration Theme functionality works

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.

The setting of custom_theme to admin_theme is done in system module's implementation of hook_menu:

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

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. But that's a lot of work and not the way we're used to theming things in .tpl.php

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!

Syndicate content