Loading presentation...

Present Remotely

Send the link below via email or IM


Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.


Using the Power of Modules for Theming

Drupal 7 theming: the bastard child of modules and themes

Benjamin Melançon

on 25 June 2011

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Using the Power of Modules for Theming

Drupal 7 Front-end Development modules and themes have taught each other some tricks New in Drupal 7 Themes Modules that Do Theming Every hook that used to be restricted to modules and can now be done in themes can also still be used in modules. Disadvantages You just got sucked deeper into the Drupal vortex. Advantages Some hooks only work (reliably) from modules.
You can more easily share your modification between projects and people. How NOT to Do It Presentation in a Module? The End Welcome to the Weird Community Karma needed to Punishment for Various Crimes Heretic. From Module to Theme to Module Hooks work by naming convention.

To implement a hook, take the 'hook' part off the hook name and replace it with your module's (machine) name. Thus, hook_help() implemented in the Xray module is the function xray_help(). Tip: grep grep -nHR module_implements_alter .

./includes/module.inc:646: if ($hook != 'module_implements_alter') {

./modules/system/system.api.php:1775:function hook_module_implements_alter(&$implementations, $hook) { Tip: Looking up hooks We can look up hook definitions and their function signatures the same way we look up any Drupal function, at api.drupal.org:

api.drupal.org/hook_help Tip: Examples Project drupal.org/update/themes/6/7#theme_alter hook_form_alter() agaric.com dgd7.org Miscellaneous
Drupal 7 Theming
Awesomeness Theme override suggestions Modules in Themes Themes in Modules dgd7.org Regions have templates hook_html_head_alter() <plug class="shameless"> </plug> hook_css_alter() hook_page_alter Theme functions must begin with the theme name. benjamin melançon ben@agaric.com
dgd7.org • agaric.com <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> What Goes Where Presentation and display go in a theme or dedicated theming modules. Functionality and logic go in ordinary modules. api.drupal.org
Full transcript