18.10.2016 Views

Drupal 7 Module Development

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 9<br />

On node listing pages, this hook will often be called multiple times.<br />

You may be able to optimize your code by using drupal_static() to<br />

remove repeated queries to the database. Using the Devel module can<br />

help you find redundant queries that would benefit from static caching:<br />

http://drupal.org/project/devel<br />

Now our module is 23 lines of optimized code:<br />

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!