Skip to main content

Drupal themes

Twitter style Login box for Drupal

In this tutorial I’ll show just how easy it is to do a Twitter style drop-down login form in Drupal 6 (probably just as easy if not identical in Drupal 5 and 7). If you don’t know what this looks like these days you better get over to http://twitter.com/ and scope it out so you know that I’m on about - see the link in the top right corner…

Requirements

Login Toboggan

  • Download and install the module

How to theme the User Login page in Maintenance Mode

A recent client wanted to remove everything from the user login page when the site was in maintenance (or Site off-line as its referred to in most system messages and documentation). Just showing the user login form when the site is off-line actually makes a lot of sense because whats the point of showing things like primary links, search block or whatever else might show on your normal user login page.

Using CSS clip as an Accessible Method of Hiding Content

Its relatively easy to hide content in Drupal using CSS, however its a whole different ball game to hide content and keep it accessible to all site visitors. Disabled web users may be using a screen reader or other Assistive Technology. For Drupal 7 we wanted a way to hide content that worked in all browsers and avoided many of the issues associated with current techniques.

The idea was to develop a new CSS class that could be applied to any element we needed to hide. We called this class .element-invisible and set about testing properties and values to make this work, in all browsers and all AT devices. First lets look at some of the current techniques we looked into and tested for Drupal 7, then I’ll introduce a new technique I came up using the little known clip property and see how it stacks up - I think you’ll be intrigued.

100 Percent width Header and Footer Backgrounds in Adaptivetheme

I’ve been asked a few times by Drupal themers and designers how to do 100% header and footer backgrounds in Adaptivetheme—and retain the theme settings so end users can still adjust the overall page width. Actually this is pretty easy - its just a matter of adding a couple of wrapper DIV’s in the right places and overriding the layout variables that Adaptivetheme uses to set the width.

Border Radius Reference

Full reference for khtml, moz and webkit + CSS3 rounded corners.

Bartik for Core!

As many of you may know Bartik is one of the candidate themes for Drupal 7 - we only have until the 17th of May to bring it up to core worthiness so if you’re a front end developer your help is needed, and its needed now.

Page Template Suggestions per Node Type

Sometimes its useful to have a page.tpl.php template per node type. While you can have a node-[type].tpl.php be default in Drupal 6, the same does not apply to page level templates.

To add these template suggestions to your theme simply add the following code to template.php, replacing themeName with the name of your theme.

Field Type Suggestions in Drupal 7

NOTE: I have submitted a feature request to Drupal 7 to have this included in core - if you have some opinion on that please see Field Type Template Suggestions

Today I finally got around to testing out the new field suggestions in Drupal 7. If you’re not familiar with the standard suggestions in short you can either use field templates or override theme_field using a naming convention not unlike we do with preprocess functions. What struck me as kind of odd was the lack suggestions for field types—maybe there’s a very good reason for this such as performance, I don’t know, but I thought it might be interesting to see if I could use them, if I wanted to.

Export Adaptivethemes Advanced Theme Settings

In the latest bleeding edge DEV version of Adaptivetheme we’ve introduced a new feature—the ability to export your theme settings. This is useful if you need to move your Drupal theme and you can’t just export and move the database as well.

Styling Google Calendar

A recent project used the Google Calendar widget - this is embedded in a iframe (in a standard Drupal block) and thus can’t be styled with CSS as per normal - but we wanted to style it to match the overall design.

After a bit of hunting around for a solution I found this: MyGoogleCal. The download link is a bit hidden - grab it directly here…