Submitted by Dale on June 1, 2007 - 4:57pm
Submitted by Dale on May 31, 2007 - 12:29pm
Submitted by Dale on May 16, 2007 - 3:24pm
I come to you as one reformed. I will no longer use foreach loops to build tables. At first, I did not know about theme_table. Then I couldn't be bothered to learn about it. Then, after feedback from people whose opinion I respect, I felt compelled to bite the bullet. I wish I hadn't waited so long.
Overview
As the name suggests, theme_table is a Drupal theming function for creating tables. It takes arrays holding the table data and generates the HTML for displaying the table. At their simplest, the input arrays hold text elements. At their most complex, the arrays hold arrays which hold arrays. The various arrays all hold data appropriate to their location, so this isn't as bad as it sounds.
As with all Drupal functions, there's documentation at api.drupal.org. For the Drupal 5 theme_table function specifically: api.drupal.org/api/5/function/theme_table. There's enough there to get you started, but you still have to think a bit. (Which is to say, I had to. Think a bit, that is.) Thinking should be reserved for the problem at hand, not figuring out Drupal, so here's my "overflowing with examples so you can cut and paste" explanation of theme_table.
Submitted by Dale on May 15, 2007 - 1:59am
April 26, 2007 saw a close encounter of the Drupal kind at the Bryght offices in Vancouver's Gastown. Attendance wasn't counted but people were scrambling for chairs. Meeting topics included:
- OSCMS Roundup
- Drupal 6 Update
- Scott Hadfield's Summer of Code Project on Drupal Scalability
- Install Profiles
- Pro Drupal Development Book
- General Q&A
What follows are my notes from the meeting, including audio excerpts (Recording credits go to Roland Tanglao and myself).
Submitted by Dale on May 6, 2007 - 2:12pm
Submitted by Dale on May 4, 2007 - 1:26am
Submitted by Dale on April 26, 2007 - 12:28am
Need to know absolutely, positively, and without-a-doubt what theming variables are available to your template? Here's a trick for total visibility.
In my previous post, Take Control of Your PHPTemplate Variables, I described the _phptemplate_variables function in template.php. It's passed a parameter named $vars which is an associative array of all the variables that will be created in the template . . . which is exactly what we're looking for!
Since _phptemplate_variables allows us to create theme variables, we have a simple way to get the $vars data into the template where we can look at it. Just put the following code in your template.php file:
function _phptemplate_variables($hook, $vars) {
return array('vars_data' => $vars);
}
And the following code in your template file:
Submitted by Dale on April 23, 2007 - 8:21am
For your templating pleasure Drupal's PHPTemplate engine makes available a cast of variables, including such favourites as $title, $content, and $node. Modules also contribute: CCK adds CCK specific template variables as well as fields to the node object, and the comments module adds an entry to the $links variable. But what happens when something isn't formatted the way you or your customer wants, or you have a project specific variable you want to add?
Introducing the _phptemplate_variables function!
The _phptemplate_variables function lives in your theme's template.php file and is called by the PHPTemplate engine after the various modules have done their thing, and before PHPTemplate actually renders your node into HTML. _phptemplate_variables provides a single, common location to all .tpl.php files for adding or changing variables.
Submitted by Dale on March 17, 2007 - 10:36am
Drupal/CiviCRM gets a prominent mention in this ONLamp.com blog post: Top Drupal & CiviCRM Gotchas
Seven of his ten points are good to know for any LAMP based system, and some are aimed squarely at the new (e.g., do backups). Great information for someone starting out, but given the general nature of the information the post is a little misnamed.
Submitted by Dale on March 15, 2007 - 12:54pm
I've been hearing a lot about OpenID the last six months, probably because Sxip and Bryght have a local presence. It's a cool technology solving a problem I certainly deal with day-to-day. But will it rise from the primordial idea soup into mainstream acceptance? According to Simon Willison, yes:
When Bill Gates stands up at a security conference in America and spends seven minutes on stage talking about a technology, it's not really a niche proposition anymore.
Wilson recently gave a talk that was converted into a "slidecast": http://simonwillison.net/2007/Mar/12/slidecast/. It does an excellent job, the best I've seen to date, of explaining OpenID and the problems it's meant to solve. I appreciated his inclusion of a "What's wrong with it?" section. And it's not without humour, we're introduced to the evil alter egos of Ben and Mena Trott!
Pages