theming

The Oxford Comma

Here's a little function I wrote today because I needed to be able to turn a list of between one and three items into a string like 'apples, oranges, and pears', 'apples and pears', or just 'stairs'.

I figured I might as well handle everything in one place, and throw in the option to have an 'or' instead of an 'and'. There may be occasions you don't want the Oxford comma, but I can't think of any.


/**

Panels 3 And The 960 Grid System

This post was going to be longer, but I just lost the entire completed document because the worst (and probably most expensive at $15/day, yes DAY) mobile Internet provider in the world, EVER, just dropped my connection mid-submission and for the zillionth time today. So you'll have to make do with an angry and hurried synopsis of what I would've written.

Theming Ubercart, Some Tips And Tricks

First, a note on "compatibility" (for want of a better word). This piece is written after some extensive theming work in Ubercart 5.x-1.7. Much of this is still useful information for the Drupal 6.x version of Ubercart, but it may not be wholly accurate.

I should also note that this is not really a hand-holding step-by-step piece. It's more for people who are already pretty familiar with theming Drupal and just want to know where to look.

This Author Sees A Long Drupal Slope

I'm prompted to write a post that is a bit less technical and more of a muse on the state of the Drupal project. Anyone who follows the community will know much is made of a developer/designer divide. To be honest, I still don't quite get why this is. I don't personally feel it.

Theming In Drupal 6

Free tagging: 

Don't get me wrong, the documentation relating to theming for module developers in Drupal 6.x is all there and complete. The trouble is, it's spread over several different places. The purpose of this blog entry is to do a step-by-step guide to theming something in a module for Drupal 6. It is inspired by my colleague, Brendan, who created a really neat little demo module this morning which shows how the various bits of the theming API work. I felt, having compiled all the information in one place, it deserved a write-up.

Path To Theme In A Module

Free tagging: 

I'm currently working on a multi-site Drupal installation. There is one theming module shared by all instances which exposes some key blocks and views they all require. During development, this was built on the initial site, so occasionally you will find something like this in the module:

<?php
function load_my_image() {
 
$path = base_path().
         
drupal_get_path('theme', 'my_theme').
         
'/images/my-image.gif';
  return
$path;
}
?>

That works fine for as long as 'my_theme' exists, but what if it doesn't on another instance using this module?

The Joys Of Preprocessing

I've been having a lot of fun with preprocess functions in Drupal 6.x, particularly when theming Views. It's a great system, but my colleague came across a nice "gotcha" this morning.

We have been adding JavaScript in Views preprocess functions if we want to provide tidy jQuery interfaces for Views output. This works great, so we thought nothing of doing the same for pages, which is where we came unstuck.

To understand why, you need to understand the process order of preprocess functions, as defined here:
http://drupal.org/node/223430

Subscribe to RSS - theming
© 2010 Greg Harvey. Drupal theme by Kiwi Themes.