Tips

How to create a subtheme in Drupal 6

Creating a subtheme is a powerful and flexible way of theming in Drupal. Drupal 6 made implementing subthemes relatively easy to do. There are a few basic concepts to understand before starting, but once underway, creating a subtheme is a simple straightforward process. In this post, I'll outline the process for creating a subtheme. This is meant to be a quick primer, not an exhaustive tutorial on the elements and features of subthemes. Read More »

Drupal Colonoscopy: Or, How I learned to theme a CCK field in Drupal 6

Q: How many Drupal themers does it take to perform a custom field label colonectomy?
A:  You don't want to know.

Our journey began with what seemed to be a simple request:  How do you remove the colons from the end of field labels on a Drupal 6 site?  Read More »

"Can Drupal do complex data oriented sites?"

A user on the Twin Cities PHP User Group asked this question recently, with the context being the configuration of a complex site with many users and data relationships between those users and other content. 

In these communities Drupal sometimes gets a bad reputation.  People don’t fully understsand what they’re dealing with when they download Drupal.  They un-tar it, install it, and end up with a “now what” moment.  

As a community, how do we respond to this?   Here’s one example. Read More »

Theming how attachments are displayed on a node

When you first enable the Upload module and start attaching files like PDFs to your nodes, you'll notice that those attachments are displayed in a table at the bottom of the node showing the file name and size of each file attached to the node.   This works for most situations, but sometimes you want to make things look just a little bit different.

In today's example we'll re-theme the attachments display to remove this table.   In our use case the user will only be attaching one file, a PDF, to each node.   Rather than have the PDF's name display in table - they want a simple link with the text "Download the PDF".    So how do we make this change?

The answer is a theme override.   The default attachments display is provided by theme_upload_attachments().  By overriding this theme function in our site's theme, we can change the behavior however we want.  In this tip we'll be learning how to override a theme function using some basic PHP knowledge and a bit of help from the Drupal API site.

Tip: Using separate stylesheets to theme around IE

Questions about how to deal with Internet Explorer's quirky ways of displaying our lovingly styled Drupal sites have been dominating our Lab Hours sessions and Labtime email list. Since IE display issues seem to be on everyone's mind of late (always), I've drafted detailed explanation of using separate stylesheets to handle displaying Drupal sites differently in IE. I welcome your thoughts, and especially encourage you to comment on this tip by providing links to sites with info about styling for IE.

Disappearing Teaser Text

If you are have teaser text on your website, and sometimes the teaser text is completely missing, though teaser text is visible for other occurrences of the same type of information, this is what is Read More »

Tip from the Archive: Free and Open Code Editing Software

At Lab Hours this past Wednesday, several people asked about text editing tools that would make working on Drupal theme files (page.tpl.php, template.php, style.css) easier.  I recommended the too Read More »

Adding a scrolling box in Drupal

The other day on our lab list, there was a question about adding a scrolling "latest news" box.  One suggestion was to add HTML into a node's body, with full HTML turned on. Read More »

Should I Use the Blog Module - Or Create My Own Blog CCK and Views?

The blog module is part of Drupal core, and existed before CCK and Views.  Drupal core doesn't technically know about - or use - CCK and Views.  It just sits there happily in its CCK/Views oblivion, making content types and listings available.
Rather than Views support, it contains a hard-coded link to a list of say, "tara's blog".  And it adds various links throughout the site to blog posts, etc. Read More »

Email Newsletter Formatting

Almost everyone has expressed interest in sending HTML formatted email newsletters.  Almost everyone is skittish about how such emails will look in various email clients-- for good reason.  At past Lab Hours sessions I've alluded to an online guide to CSS compatibility within various email clients, both desktop and online.  The good news is I'm finally posting this guide.  The better news is that it has been updated recently (June 11, 2008).  The not so good news is that there is little change from a year ago in terms of what is compatible and what is not.  Read More »

Add to calendar