A Summary of Overriding template files in Drupal 7

Drupal's theme system allows you to provide alternate template files by way of theme hook suggestions. In other words, you can override the output of nodes, pages, blocks, and more by providing your own template file and using the correct naming scheme. For more information on that naming scheme I suggest reading this article on Drupal 7 Theme Hook Suggestions.

Print Variables to Screen in Drupal

One of the most useful things I discovered in Drupal was how to print variables to the screen. I use it in almost every project I work on, so I thought I'd share this little snippet. All you have to do is print your variable using Drupal's the drupal_set_message function to send it to the screen. And by wrapping it in a sprint_f, print_r, and pre tag we can safely output it in a nice format.

Subscribe to RSS - php