Jump to Navigation

Blog

Drupalcon London

Well the dust has just about settled after Drupalcon London so I thought I'd take a moment to post my thoughts on the event.

It all kicked off with a Drupal Christmas Carol, in August (?!), which very much set the tone - fun! The one thing you will notice at Drupalcon is that it's all about the people, and the people want to have a good time. This is probably a result of it being an open-source community project and also a result of how people who make cool things have a good chance of being cool people too.

Drupalcon London 2011

It's official: the Ecobee team will be attending Drupalcon London 2011!

In case you don't already know, Drupalcon is *the* event for those involved with Drupal. There are seminars, lectures, training sessions informal discussions, social events and a whole lot more. It's designed to spread the word about Drupal, to help grow and enhance the community and to improve everyone's knowledge and ever-increasing excitement about Drupal!

What is Drupal?

Drupal is a Content Management Framework. This means it can be used to build complex websites that focus on user-generated content. User generated content is content that the site owners can add themselves, without the help of a website developer.

It can be tempting to think of a website as a hierarchy (a tree) of pages. Many website-building tools emphasise this way of thinking about a website. Drupal is different.

Using the Geany text editor for Drupal programming

I prefer using a light-weight editor most of the time as IDEs tend to feel irritatingly sluggish to me. (Komodo may change my mind about this.) I use Geany to edit code. It has enough configurability to appease me (keyboard shorcuts, block commenting behaviour, syntax highlighting) without drowning me in options.

I decided, on a whim, to adopt the drupal.org php syntax highlighting scheme, so I modified the appropriate configuration file. Feel free to download it.

Attachment: 

What is XPath and why do I care?

[Edit: Thanks to @oceanician for pointing out that I didn't actually say what XPath is: XPath is a notation for locating an element (or a set of elements that share one or more properties) in an xml or html document.]

I first came across XPath while trying to automate testing of the jsTree plugin using Selenium IDE. I was trying to record a test. Normally I would just click the on the Record button and then do whatever (clicking and typing) on the web page. When I was testing jsTree, lots of events were not registering in Selenium so they were not being recorded. The solution to this problem was to hand code the test behaviour in Selenium. At this point, I found that the rules required to specify the elements I wanted to manipulate were complex, and that's where XPath came in.

An example:

I wanted to right-mouse-click on an empty folder in the jsTree. An empty folder could be distinguished by a particular set of traits:

  1. Like all items in a jsTree, this would be a <li> element.
  2. We were including a 'gid' (group id) attribute in all jsTree items. This was an easy way of distinguishing such items from everything else on the page.
  3. A folder is (predictably) not a file, therefore it would not have the download attribute that we were giving the files items.
  4. An empty folder has no file or folder children.

The XPath that identifies the empty folders, and that can be used directly in Selenium, is this:

//li[@gid and not(@download) and not(ul)]