Session 2 C: For Developers: Theming

Events happening in the community are now at Drupal community events on www.drupal.org.
Petrina's picture
Start: 
2006-06-28 13:30 - 15:30 Etc/GMT

What the hell is a theme? dissecting php template themes: This starts with a tour of a few themes, dissecting as we go. Then you will learn to create a theme, come with your theme comp, if you have valid css/xhtml that will expedite things, you could find one online.

Comments

Regions in PHPTemplate

Theme development forum

Theme snippets

some more phptemplate

dalin's picture

some more phptemplate tricks:

http://www.lullabot.com/articles/hacking_phptemplate

dave hansen-lange

--


Dave Hansen-Lange
Director of Technical Strategy, Advomatic.com
Pronouns: he/him/his

also..

chud's picture

this one is killer: https://addons.mozilla.org/firefox/179/

edit your css and see it modify your page as you type!

Other useful stuff while theming

cathycracks's picture

<pre><?php print_r ($node); ?></pre>

Which will generate something like

tdClass Object
(
    [nid] => 1
    [vid] => 1
    [type] => page
    [status] => 1
    [created] => 1149299792
    [changed] => 1149299792
    [comment] => 2
    [promote] => 1
    [moderate] => 0
    [sticky] => 0
    [revision_timestamp] => 1149299792
    [title] => This is my first page.
    [body] => This is a page in drupal. Yay drupal!
    [log] => Created a first page! Deal with it !
    [format] => 1
    [uid] => 1
    [name] => admin
    [picture] =>
    [data] => a:2:{s:6:"submit";s:18:"Create new account";s:7:"form_id";s:13:"user_register";}
    [last_comment_timestamp] => 1149299792
    [last_comment_name] =>
    [comment_count] => 0
    [taxonomy] => Array
        (
        )
    [readmore] =>
    [links] => Array
        (
            [0] => add new comment
        )
)

a few links from DrupalCamp

chud's picture

Here's my delicious feed for DrupalCamp Seattle (links)

http://del.icio.us/cchudyk/drupalcampseattle

jquery

Some handy things to add to

Mark Yuasa's picture

Some handy things to add to your page.tpl.php:

To allow page-specific theming by node type -

<?php print $node->type; ?>

You may want to use this in your node.tpl.php file to allow you to style different node types separately, like so:

<div class="node<?php print ($sticky) ? " sticky" : ""; ?> node-<?php print $node->type; ?>">

To allow page-specific theming by page title -

<?php print $title; ?>

You may wish to apply this to the body tag in your page.tpl.php so you can use css overrides:

<body class="node-is-<?php print $node->type; ?> title-is-<?php print $title; ?>" <?php print theme("onload_attribute"); ?>>

Drupal Camp Seattle

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: