I recently had a site where I needed to split the result of a WP_Query into two loops, depending on the value in a custom field. Continue reading
Redesign of moanandorf.com
I was growing increasingly frustrated with my old layout, so I put this new one together. It’s very much a work in progress, but I decided to put it up anyway. What better way to motivate me to work on it than looking at my broken-looking site every day?
I did have a moment of doubt as whether I should stick with WordPress or switch to Drupal, but I came to the conclusion that I still agree with what I wrote earlier, and that I want to keep up with what’s going on with WordPress as well. No better way than keeping my blog running on WP.
Removing page titles in Panels
Something that’s been driving me crazy with the otherwise excellent Panels module – there is no GUI way of removing the double page titles that show up sometimes! I solved it in the following way, which may or may not be a good way, but it works so I’m using it until someone convinces me it’s a lousy idea.
function THEMENAME_preprocess_panels_pane(&$vars) {
// remove page titles from the page, but leave them in <title>
if ($vars['pane']->type == "MACHINE_NAME_OF_PANE" ) {
unset($vars['title']);
}
}
This code in the theme’s template.php, and in the panels-pane.tpl.php file, a few isset()s to check if the title is set before printing it, so as to avoid PHP notices. Come to think of it, if you set $vars['title'] to FALSE instead of unsetting it, it should probably work without changing the tpl file. Haven’t tested it, though.
Mobile first – for real
During the last couple of weeks I’ve taken it upon myself to redesign a site I did for a friend in June 2009. I’ve been annoyed with a few aspects of the site for a while now, and when a WordPress security update broke the image uploader the site’s using, I decided to move it to Drupal and do a redesign while I’m at it.
The look and feel of the site will mostly stay the same, but I’m almost completely changing the structure of the site. The front page is getting a more clear “call to action” and the administrative workflow will be more intuitive. And, the site will, of course, be fully responsive. It’s the third responsive site I’m building that will actually go live, but what’s different about this one is that it’s built with a mobile first approach. Continue reading
Even more typography
More typography
Typography
How to Succeed in Open Source (or Things I Learned from Writing My First Rules Condition)
My colleague Mattias keeps giving me one piece of great advice that I just keep forgetting.
When you want to accomplish something, look at a piece of code that already does sort of what you want to do, copy and paste it, and modify it to work like you want it to. Continue reading
Befunnit mig på gymmet
I går promenerade jag till gymmet och sprang på löpbandet i 20 minuter. Hann tyvärr inte mer då jag var så seg med att komma iväg att de höll på att stänga.
Nu ska jag “bara” se till att detta blir starten på regelbunden träning! Två gånger i veckan fram till jul, det borde väl inte vara omöjligt?
Filefield Zip – a Drupal module for zipping filefield files.
Micke and I are building a module! I have built modules before, but mostly custom modules for specific sites and only one that was ever intended to be released (but it never was).
We’re calling it Filefield Zip, and it takes files from one or more selected file fields and zips them into one single zip-file. Right now, that’s all it does, but we’re planning to add Views support for a link to download the zip file and a whole bunch of other features. This module started as a project for a NodeOne client whose site is on Drupal 6, so for now the module is for D6 with plans to port it to Drupal 7 when we have time.