Drupal tip: Print out a list of modules implementing a hook

When building or debugging a module sometimes it's helpful to know which modules are implementing a particular hook. 

Drupal 7:

// The name of the hook.
$hook = 'node_access';

// Print out all modules implementing this hook.

Use dpr() if you have the Devel module enabled; otherwise use the PHP function print_r()

Example output:

    [0] => node
    [1] => features

Drupal tip: Find all field values for a node entity

This simple snippet programmatically locates all field values for a node entity using field_info_instances() from the Drupal API.

An example usage would be if you wanted to modify field values in template_preprocess_node() for output in node.tpl.php.

Installing Jekyll on Windows 8 (64-bit)

This is my working formula for getting the Jekyll ruby gem up and running on Windows 8 (64-bit).

Every installation is different, and I make no claim that this will work for you exactly as-is, but hopefully I can save you having to go against some of the tricky bits.

Subscribe to Othermachines Blog