Drupal’s Elephant in the room

The elephant in the room with respect to storage and repurposing of related content is the body field. 

Until we (Drupal community) find a way to represent content that currently resides in this dumping ground in a more granular, structured way, we will not resolve the challenges of multiple devices and the re-purposing of content.

Surely the contents of the body tag data/markup mashup resulting from wysiwyg needs to be split into data and meta data stored as such within drupal? 

Generate SSL cert and install with Apache virtual host

  1. Generate Key

    >cd /etc/apache2/ssl 
    >openssl genrsa -des3 -out www.mydomain.com.key 2048
  2. Use Key to generate csr key & complete registration details as below. Most important ones to get right are country code, for UK this is GB and common name which is the websites sub dmoain e.g. www.mydomain.com NOT mydomain.com

    > openssl req -new -key www.mydomain.com.key -out www.mydomain.com.csr   

    Country Name: Use the two-letter code without punctuation for country, for example: US or CA.
    State or Province: Spell out the state completely; do not abbreviate the state or province name, for example: California
    Locality or City: The Locality field is the city or town name, for example: Berkeley. Do not abbreviate. For example: Saint Louis, not St. Louis
    Company: If your company or department has an &, @, or any other symbol using the shift key in its name, you must spell out the symbol or omit it to enroll. Example: XY & Z Corporation would be XYZ Corporation or XY and Z Corporation.
    Organizational Unit: This field is optional; but can be used to help identify certificates registered to an organization. The Organizational Unit (OU) field is the name of the department or organization unit making the request. To skip the OU field, press Enter on your keyboard.
    Common Name: The Common Name is the Host + Domain Name. It looks like “www.company.com" or "company.com". For wildcard certificate the syntax should look like *.company.com
    Geotrust certificates can only be used on Web servers using the Common Name specified during enrollment. For example, a certificate for the domain “domain.com” will receive a warning if accessing a site named “secure.domain.com”, because “secure.domain.com” is different from “domain.com”.
    Please do not enter your email address, challenge password or an optional company name when generating the CSR.
    A public/private key pair has now been created.   
  3. Paste csr key into domain vendors website. 

  4. Select administration email address to send authorisation request from those listed. You (or an admin) need access to this address to authorise request via the link sent.

  5. Authorise request via email

  6.  Copy ca-bundle from email sent to ssl certificate purchaser to ssl directory ( /etc/apache2/ssl/www.mydomain.co.uk/ca-bundle) 

  7. Add virtual host, replacing virtual host with your ip address. You can actually use a * for virtual host to bind all ip’s but this is more secure plus this does not work on older browsers.


   ServerName www.mydomain.com

   ServerAlias mydomain.com

   DocumentRoot /var/www/www.mydomain.com

   SSLEngine on

   SSLProtocol all

   SSLCertificateFile /etc/apache2/ssl/www.mydomain.crt

   SSLCertificateKeyFile /etc/apache2/ssl/www.mydomain.key

  SSLCertificateChainFile /etc/apache2/ssl/ www.mydomain.ca-bundle

  ErrorLog /etc/apache2/ssl/ssllog.txt

  LogLevel warn

<Directory /var/www/www.mydomain.com>

        Options Indexes FollowSymLinks MultiViews

        AllowOverride All

        Order allow,deny

        allow from all



REST Sever Notes

Settings for node operations

Ubuntu Server Build & Admin Notes

Generate Client Key Pair 

mkdir ~/.ssh chmod 700 ~/.ssh ssh-keygen -t rsa

Transfer to Sever

ssh-copy-id <username>@<host>

Install ssh-copy-id Server

sudo curl "http://phildawson.co.uk/ssh-copy-id" -o /usr/bin/ssh-copy-id  sudo chmod +x /usr/bin/ssh-copy-id 

Test Login

ssh <username>@<host>

Acquia Dev Cloud Gotchas

The Acuia Dev Cloud is a great service for hosting Drupal sites, giving you Drupal specific management stuff via the GUI and turning many of the standard workflow tasks from CLI to GUI. Unfortunately, the docs and support are a little scant as they are still being developed and can leave you feeling pretty isolated if you get a problem. Being propitiatory, the systems and techniques are not widely known and not much community stuff is out there. Here are a few of the main gotchas that I found moving from a standard Drupal infrastructure (e.g. Dedicated server, VPS or shared server) to the Dev Cloud. They may be obvious to some but maybe will help others.

  1. The Acquia file directory structure is a little different and what would normal be your Dupalroot is now docroot, this all within the sites root along with a couple of other Acquia specific folders.
  2. Your files directory is stored in a different location automagically on Acquias network when you import your site. It is then symlinked to you standard drupal_root/sites/[site]/files directory. To upload new files you must scp or sftp them - uri’s can be found under sites & logs. So if you use git like me, you will find an entry excluding files within .gitignore stopping them being added to your repo.
  3. Only tags & branches show in the code drop down list on the workflow page NOT commits when pushing code to the dev cloud from your local environment. This means that if you want to commit a change to the Dev Cloud and want to see that change by checking out code to your Workflow dev site for example, you need to use ’git tag mytweak’ followed by ‘git push —tags’ to get the tag to show in the code drop down.

As I find more things worth noting I’ll post ‘em.


One into two (excel columns!)

Simple but I have NOT done this so many times it’s worth sharing.

OK, so you have a spreadsheet that needs a ‘straightener’ pre-import: de-duping, converting the SHOUTINGEMAILADDRESS@YELL.COM to lower case, names to sentence case etc.

In this case I’m importing into a Mailchimp mailing list and I need to have first name and surname in two columns. Of course my file has both in one column. :-)

Been here lots of times and always used a lashed up formula to copy everything before first space to one column and everything after to another - UNTIL TODAY!

Just select the painful column in question then hit the text to columns button on the data tab and your half way there already. Enter space as delimeter, marvel at the preview, couple more clicks and your done. A new column with second part of the text split at space.

Maybe everyone on the digital planet does this already but this simple piece of excel functionality really made me smile after saving 43 seconds. 

Bulk Image importing into Drupal and Image Manipulation Using Photoshop Actions

The Drupal imagecache system is a great way to ensure that images are sized correctly on the fly for our sites.

When bulk importing images into Drupal using the excellent node_import module (unfortunately D6 only at time of writing) it’s not great to be bulk importing a gazillion images in either the wrong format or size using node_import. Much better to get the images closer to the size and correct format to be used before importing. 

This heavily summarised version of how we do it assumes that you all know how to use the components mentioned. If you don’t get it ask and I’ll try and help.

For this example I am importing records into just three fields into an Album content type. Artist, Album and cover_art. The artist and album are text fields and coverart is a CCK imagefield.

  1. Put all hires images into photoshop import folder.
  2. Create a photoshop action to carry out the following tasks on each image
    a. open each file from import folder
    b. resize image to appropriate size
    c. add unsharpen mask filter to fix blur caused by resizing image as photoshop does aq better job of unsharpen mask than imagecache as you can play with amounts depending on you use case. 
    d. save file to output folder. 
  3. Run the action (under file->automate) setting up source and destinatin 
  4. Create a spreadsheet with three columns corresponding to title (artist) artist, album and cover_art. cover art is the name of filename to import. 
  5. Now, when you import the spreadhseet with filenames into drupal using node import, images will import faster and generated thumbnails will not be as blurry.



Hide ‘Home’ menu item in Drupal when on homepage

Here’s a little snippet of css that will get rid of the home menu item when users are currently on the homepage.

.front .active {



that's it!

Hello World post

Hello World

(Source: claritis.co.uk)