You are here

drupal

Summary of OxDUG, 1 May 2013

Drupal commerce, Drush site-upgrade and lovely internationalization extensions

Yesterday was a great OxDUG meeting as usual. Mike Harris took us on a tour round the Drupal Commerce suite of modules, and even though I've had some slight experience of it when helping out with donations work on the CLIC Sargent build that Johan led, I still found it really useful to see an alternative (and arguably more shop-like and fully featured) installation of it. I followed this with a quick presentation of drush site-upgrade, including a sort-of live demo: I merely had the upgrade command running in the background while I talked about my recent site upgrade exploits.

But the punchiest presentation was organizer Finn from Agile Collective giving a quick runthrough the internationalization additions they've made to the build of the REScoop website. Again, we've used Drupal's core i18n options (largely in D6), but really only in a two-language context; regardless, it was inspiring to see these being augmented, with the localization client, menu translations and entity translation. i18n and l10n can often be pain points in a site build, so it's really nice to find out ways of making them less problematic in future.

Forthcoming events: OxDUG, Oxford Geek Night 31 and OpenTech 2013

It's all going social in May, just like Twitter only with having to actually talk to people

May is suddenly a busy month for geek socialising, with at least three events in my calendar. The monthly Oxford Drupal Users Group (OxDUG) meetup is this Wednesday: I very sneakily volunteered Garrett Coakley to talk about the recent soft launch of the new WDC website. I can't wait to hear about that; also, if time permits then I'm happy to share my recent drush sup exploits with the group.

The Wednesday after (May 8) is Oxford Geek Night #31. Digital artist Seb Lee-Delisle and frontend expert Jake Smith have very kindly agreed to come and speak about their respective projects; they're accompanied as usual by a host of local volunteer "microslot" talks on all manner of subjects. As usual, there'll be time in between the talks to socialise, drink and chat upstairs in the Jericho. And also as usual, I'm organizing it, so I'll definitely be there!

Finally, May 18 sees the return this year of OpenTech, the practically free-to-attend London-based conference on novel approaches to enabling technology, user experience and transparency in democracy. The Government Digital Service and Raspberry Pi project are out in force in this year's schedule, and hearing about those alone is worth the £5 (five pounds!) entry fee. Anyway, when I've gone along in previous years, I've found that pretty much every project discussed has been worth hearing about, with a fascinating depth of social importance and relevance coupled with complex and interesting technologies. And I'm not just saying that because apparently they quoted me on their blog.

Lots on this month, then, but hopefully I'll be able to fit it all in: you should try to as well! And if you do spot me at any of them, please do come and say hi; or tweet me first if you'd rather.

Blog category: 

Upgraded to Drupal 7

"Did you notice that?" "Notice what?"

This site was quietly upgraded to Drupal 7, in stages over the course of the past few days. Well, I say quietly: it was pretty noticeable from my perspective. But hopefully nobody else realised that it was happening, or had suddenly switched; that was the point!

Partly in order to work out whether or not it could be done, I very purposefully did an upgrade of the old D6 site, and not a migration of the content into a new D7 site. It turns out that it could indeed be done, although I'm sure the simplicity of my site has a lot to do with that.

I'll do another blogpost in a few days, about how I accomplished it, but I'm waiting for the dust to settle, the bugs to shake out etc. Speaking of which, I'm off to check that this post appears in my RSS reader of choice!

You wouldn't build a spreadsheet authoring tool. So why would you build a content authoring tool?

There are lots of answers to that, of course; but most of them seem to assume infinite time or money.

http://petermoulding.com/drupal_versus_write_your_own_code

There are two questions that I think are easy to conflate here:

1. This is a content-based site; should I use an off-the-shelf CMS like Drupal or write my own?

2. This is not a content-based site; what should I do?

 

To me the answer to the first question is a no-brainer: the advent of free CMSes like Drupal and Joomla have made the concept of a CMS into commodity software. Although the ease of customization of Drupal has sometimes been overstated, I find it hard to believe people who claim that, even with customization, they couldn't get at least one off-the-shelf CMS to do what they wanted for their (often quite straightforward) site; it's worse when that's followed by the second claim that their experience meant it was a good business decision to build an entirely custom offering. In short: custom CMSes make me want to weep!

 

Even if you don't choose Drupal, there's very rarely a use case for writing your own CMS for a CMS-driven website: after all, what fraction of organizations would propose to write their own word-processing software to put together a spreadsheet, rather than e.g. bodging the requirements with macros?

Answering the second question is much trickier. Drupal, especially if you embed it in a well-tuned LAMP stack in preparation for high traffic, is optimized (very broadly) for delivering managed content. User interaction is best kept at a minimum for performance, as otherwise you start to find yourself jumping through quite narrow hoops (Varnish edge-side includes, anyone?) to get the site to be both performant and interactive for each and every site visitor.

Even then... as you move away from Drupal, you find yourself either having to adopt a lightweight web framework, or having to spend time rewriting even simple things like drupal_not_found(), drupal_add_js() or user_access(). Who really wants to have to wrangle HTTP headers themeslves? And yet, the more a site looks like a blended content/application offering, the harder it is to make the call. Splitting the site build up into smaller features, and building it in a way that lets you make that call on a feature-by-feature basis, is one way to forever postpone that decision; maybe having a framework like Symfony in core to call upon is another way.

Blog category: 

Frontend United this weekend

Frontenders! United! Can never be defeated! Except possibly by the Same Origin Policy.

This weekend, Drupal's Frontend United conference is being held in London. The idea is to bring together everyone involved with the visual display of the site - concept designers, UX professionals, web designers, CSS/HTML experts and other theme implementers - to discuss how best to implement frontend development in Drupal.

A prior arrangement means I can't go, but you should do so if you're involved in any aspect of Drupal themeing. Tickets are still available, so get one now!

Private upload and private download almost work fine together

And where they do, it's because of a bug.

One of our clients' Drupal sites is already using Webform Protected Downloads to restrict access to file attachments. This module depends on Private Upload, although there is - confusingly - another module called Private Download that does something very similar: runs files stored in certain directories through PHP, so that Drupal can check whether or not the visitor and their context permits them access.

Because the client is moving to a slightly different setup, including taxonomy- and role-based access control using TAC Lite, then they need both of these "Prviate *load" modules in place at the same time. Rather neatly, we've found that they don't conflict at all: except for one bug, which you might even manage to avoid. 

Each module has a configured subfolder, which it maintains, and for any file in its subfolder, the module makes the decision. But Private Upload is over-generous in its decision about what counts as its files: if its subfolder is e.g. "private", but Private Download is using "private_download", then Private Upload spots that the latter begins with the text of the former, and assumes that they're its files too! That is, Private Upload checks for files beginning "private...", not "private/...."

Quick to fix, if you spot it before you have installed and are running both modules: just make sure that the folders have wildly different names. Or apply the patch I submitted.

Blog category: 

Stanley the dog, 1998-2012

Stanley window Stanley Stanley and Frisbie Stanley shakes hands Stanley Stanley tummy rub Stanley, dark and handsome Stanley, sweety pie Stanley Stanley in the sun Stanley Stanley under Helen's desk

You’ve been a very good boy. We’ll miss you.

Blog category: 

I'll be at Drupalcamp London this weekend

... Will you?

Drupalcamp London is this weekend! And I'm going. Sadly, tickets sold out ages ago, but I managed to get some for myself and other two lucky Torchboxers. So if you see me, Helen or Justine, then do say hello. Justine is volunteering so make sure you've got a job for her to do.

Even if you haven't managed to get a ticket, then I might well bump into you on Saturday evening. Follow me on Twitter to work out where I'm likely to be. And keep tuned to the #dclondon hashtag anyway, for more info. 

Blog category: 

Twitter pull loses time_ago

Drupal’s Twitter Pull module is a useful one: not just for its own UI elements, but also for getting tweets to format yourself. However, in a recent version change, it lost its $tweet->time_ago property on the tweet objects.

You can recreate this straightforwardly using the following PHP:

<?php 
$tweet->time_ago = format_interval(time() - $t->timestamp);

It’s a minor pain but if you’ve exposed your own theme implementations to preprocess hooks - and why wouldn’t you? - then it should be easy to put in e.g. your template.php.

Blog category: 

RobotsTxt, robots.txt and /robots.txt

The RobotsTxt module effectively requires a hack to Drupal core in order to function. This is because core Drupal contains a static robots.txt file, and webservers like Apache are configured by Drupal’s .htaccess file to serve static files preferentially to asking Drupal for the content. Every time Drupal is upgraded (or you deploy the site to a new staging or development instance), that hack has to be repeated.

One solution which Johan hit upon a while ago was to patch Drupal’s core .htaccess file, to send any request beginning /robots.txt to Drupal rather than serving any file on disk. It still constitutes a hack to core, but as a patch file accessible at a URL it can be incorporated into e.g. drush make files, and applied automatically when Drupal core is upgraded.

The patchfile-based hack is a big improvement, but it still leaves the RobotsTxt module complaining that there’s a problem. This is because it checks for the robots.txt file on disk, not for the /robots.txt URL, which is the real acid test for whether the module is working properly. So now we’ve also added this patch for robotstxt_requirements(), which checks the URL instead.

Blog category: 

Pages

Subscribe to RSS - drupal