18.10.2016 Views

Drupal 7 Module Development

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Drupal</strong>’s Theme Layer<br />

Two powerful use cases for hook_page_alter() would be to allow the insertion of<br />

a block inside the page's main content, or doing the reverse, moving a "Field" into<br />

a certain spot in a page region. Of course, you'll have to read the Field API chapter<br />

(Chapter 7, Creating New Fields) first!<br />

The power of theme()<br />

It turns out that the theme() function has to do quite a bit of work once it's<br />

called. The following diagram should make its responsibilities and its order<br />

of operations clearer:<br />

[ 82 ]

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

Saved successfully!

Ooh no, something went wrong!