making drupal dance: techniques for non-obvious theme manipulations

7
DESIGN 4DRUPAL BOSTON PRESENTOR JUNE 14, 2009 JOHN ALBIN WILKINS ( Johnalbin ) Making drupal dance Techniques for Non-obvious Theme Manipulations

Upload: john-albin-wilkins

Post on 24-Jan-2015

2.264 views

Category:

Technology


0 download

DESCRIPTION

These are the slides from my Design for Drupal: Boston 2009 presentation.

TRANSCRIPT

Page 1: Making Drupal Dance: Techniques for Non-obvious Theme Manipulations

DESIGN4DRUPAL

BOSTON PRESENTORJUNE 14, 2009 JOHN ALBIN WILKINS ( Johnalbin )

Making drupal danceTechniques for Non-obvious Theme Manipulations

Page 2: Making Drupal Dance: Techniques for Non-obvious Theme Manipulations

Secondary Links stink

A Theme’s Primary and Secondary links

or

Block containing Menu tree

Page 3: Making Drupal Dance: Techniques for Non-obvious Theme Manipulations

Menu Block module, ftw

http://drupal.org/project/menu_block

Multiple blocks for placement

Highly configurable: slice & dice your menu tree

Page 4: Making Drupal Dance: Techniques for Non-obvious Theme Manipulations

The Drupal 6 Two Step

MODIFY YOUR VARIABLES:

THEME_preprocess_HOOK(&$vars)

SLIGHTLY REARRANGE YOUR VARIABLES:

HOOK.tpl.php

Page 5: Making Drupal Dance: Techniques for Non-obvious Theme Manipulations

Breaking up $content

CCK can do it!

“Display fields” tabadmin/content/node-type/[TYPE]/display

“Exclude” checkbox: removes field from $content,but still renders the field

Page 6: Making Drupal Dance: Techniques for Non-obvious Theme Manipulations

Understanding the hidden order of tpls

Which template gets rendered first?

How do we exploit the order of rendering to move variables around?

PHP’s static variables.

Page 7: Making Drupal Dance: Techniques for Non-obvious Theme Manipulations