Pre-Process Functions in
Template.php
June 22, 2012
Harris Rashid
Themer & Developer
@harriszrashid
harris@chapterthree.com
Theme Structure
What is it & when does it happen?
Pre-Process
Processingweb request
Processingweb request
Raw Data (from DB)
Return Data (modules)
Processingweb request
Raw Data (from DB)
Return Data (modules)
Formatted Data (themes)
HTML
$content in node.tpl.php & page.tpl.php
Tools
- Devel module
- Admin menu module
- Firebug firefox plugin
Floated Right
Floated Left
Tools
yourtheme_preprocess_node
($variables)
Variables
Drupal 7: $variables
Drupal 6: $vars
How do I use preprocess with Fields?
- Image (file)
- Image Caption (image description)
- Image Alignment (text - radio bu...
Create a template.php file, turn on the Devel Module,
and use the DSM function.
Refresh your node page twice, and you
should see the Kufon display of the node.
We're going to need the following values for
field_image, field_image_position
More Resources
http://drupal.org/node/223430
http://api.drupal.org
Pre-Process can be used on
Nodes, Pages, Search Results...
Upcoming SlideShare
Loading in …5
×

Pre process functions in template.php

308 views

Published on

Published in: Software, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
308
On SlideShare
0
From Embeds
0
Number of Embeds
27
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Pre process functions in template.php

  1. 1. Pre-Process Functions in Template.php June 22, 2012
  2. 2. Harris Rashid Themer & Developer @harriszrashid harris@chapterthree.com
  3. 3. Theme Structure
  4. 4. What is it & when does it happen? Pre-Process
  5. 5. Processingweb request
  6. 6. Processingweb request Raw Data (from DB) Return Data (modules)
  7. 7. Processingweb request Raw Data (from DB) Return Data (modules) Formatted Data (themes) HTML
  8. 8. $content in node.tpl.php & page.tpl.php
  9. 9. Tools - Devel module - Admin menu module - Firebug firefox plugin
  10. 10. Floated Right
  11. 11. Floated Left
  12. 12. Tools yourtheme_preprocess_node ($variables)
  13. 13. Variables Drupal 7: $variables Drupal 6: $vars
  14. 14. How do I use preprocess with Fields? - Image (file) - Image Caption (image description) - Image Alignment (text - radio buttons)
  15. 15. Create a template.php file, turn on the Devel Module, and use the DSM function.
  16. 16. Refresh your node page twice, and you should see the Kufon display of the node.
  17. 17. We're going to need the following values for field_image, field_image_position
  18. 18. More Resources http://drupal.org/node/223430 http://api.drupal.org Pre-Process can be used on Nodes, Pages, Search Results, Views, User Pictures, and a host of other places in Drupal.

×