Skip to main content

Using the drupal_get_path() function to get the path of a theme

The drupal_get_path() function will look up a string (second argument) in Drupal's system table and find a path in the same row.

PHP Drupal Paths Themes Rows Strings Functions Database Lookup drupal_get_path()

Getting the path to the current theme in Drupal 7

The current theme can be retrieved using the path_to_theme() function. It will return everything after the base url to the current theme.

PHP Base URL Drupal Paths Retrieve Return Themes Functions path_to_theme() print

Using the setTimeout() method

The setTimeout() method executes a function or an expression after a number of milliseconds have passed.

Javascript Methods Functions Milliseconds Alerts setTimeout() alert()

How to call actions directly using actions_do() in Drupal 7

The trigger module is not the only way to call actions. Separate modules can be written to call actions and prepare parameters. This is typically done using a function called actions_do().

Drupal Actions Functions

How Actions are stored in Drupal 7

When an action is created, the information that is set in the configuration form is serialized and saved into the parameters field of the actions table. Immediately before the advanced action is executed, the contents of the parameters field are unserialized and included in the $context parameter.

Actions Databases Drupal Functions Advanced Action Serialized Saved Paremeters Actions Table Execute Contents Unserialized

Using the t() function in Drupal 7

Translates a string to appropriate language. First argument should always be in english. It takes in $string, $args, and $options as parameters. $string is the english string to translate. $args is an associative array containing substitutions. $options is an associative array of additional options.

Drupal Functions
Powered by Drupal 7. Made by Cody Bonney.