diff --git a/app/config/sculpin_kernel.yml b/app/config/sculpin_kernel.yml index 97c77da3..facbf674 100644 --- a/app/config/sculpin_kernel.yml +++ b/app/config/sculpin_kernel.yml @@ -1,17 +1,17 @@ sculpin: - permalink: pretty - ignore: - - '**/*.scss' - - '**/config.rb' - - '**/Gemfile*' + permalink: pretty + ignore: + - '**/*.scss' + - '**/config.rb' + - '**/Gemfile*' sculpin_content_types: - posts: - permalink: blog/:slug_title/ - taxonomies: - - tags - talks: - permalink: talks/:year/:month/:day/:slug_title/ - taxonomies: - - tags + posts: + permalink: blog/:slug_title/ + taxonomies: + - tags + talks: + permalink: talks/:year/:month/:day/:slug_title/ + taxonomies: + - tags sculpin_theme: - theme: opdavies/opdavies + theme: opdavies/opdavies diff --git a/app/config/sculpin_site.yml b/app/config/sculpin_site.yml index 50b9fec5..6f05efd9 100644 --- a/app/config/sculpin_site.yml +++ b/app/config/sculpin_site.yml @@ -18,26 +18,26 @@ lanyrd: http://lanyrd.com/profile/opdavies joindin: https://joind.in/user/view/27119 bio: > -

Oliver Davies is a Drupal Developer and System Administrator based in the UK. He works for the Drupal Association and also provides freelance consultancy services for Drupal websites and Linux servers.

+

Oliver Davies is a Drupal Developer and System Administrator based in the UK. He works for the Drupal Association and also provides freelance consultancy services for Drupal websites and Linux servers.

toolkit: - - title: Drupal - url: https://www.drupal.org - - title: Sculpin - url: http://sculpin.io - - title: Git - url: http://git-scm.com - - title: SASS - url: http://sass-lang.com - - title: Compass - url: http://compass-style.org - - title: Susy - url: http://susy.oddbird.net - - title: Grunt - url: http://gruntjs.com - - title: Vagrant - url: http://vagrantup.com - - title: Puppet - url: http://en.wikipedia.org/wiki/Puppet_%28software%29 - - title: Jenkins - url: http://jenkins-ci.org + - title: Drupal + url: https://www.drupal.org + - title: Sculpin + url: http://sculpin.io + - title: Git + url: http://git-scm.com + - title: SASS + url: http://sass-lang.com + - title: Compass + url: http://compass-style.org + - title: Susy + url: http://susy.oddbird.net + - title: Grunt + url: http://gruntjs.com + - title: Vagrant + url: http://vagrantup.com + - title: Puppet + url: http://en.wikipedia.org/wiki/Puppet_%28software%29 + - title: Jenkins + url: http://jenkins-ci.org diff --git a/source/_posts/2010-04-05-style-drupal-6-lists.md b/source/_posts/2010-04-05-style-drupal-6-lists.md index 1c3a40e4..970e115c 100644 --- a/source/_posts/2010-04-05-style-drupal-6-lists.md +++ b/source/_posts/2010-04-05-style-drupal-6-lists.md @@ -3,10 +3,10 @@ title: Style Drupal 6's Taxonomy Lists with PHP, CSS and jQuery nav: blog slug: style-drupal-6s-taxonomy-lists-php-css-and-jquery tags: - - drupal-6 - - drupal-planet - - drupal-theming - - taxonomy + - drupal-6 + - drupal-planet + - drupal-theming + - taxonomy --- Whilst developing this, and other Drupal websites for clients, I decided that I wanted to categorise content using the taxonomy system. However, I wasn't happy with the way that Drupal displayed the terms lists by default, and I started comparing this to other websites that I look at. @@ -16,9 +16,9 @@ I scrolled down until I found the piece of code that displayed the terms list: ~~~php -
- -
+
+ +
~~~ @@ -28,16 +28,16 @@ I then added some CSS to re-size the spacing between the items, and then add the ~~~css .terms ul.links li { - margin-right: 1px; - padding: 0; + margin-right: 1px; + padding: 0; } .terms ul.links li:after { - content: ","; + content: ","; } .terms ul.links li.last:after { - content: "."; + content: "."; } ~~~ @@ -45,9 +45,9 @@ I created a file named **script.js** in my theme folder with the following code ~~~js if (Drupal.jsEnabled) { - $(document).ready(function() { - $('.terms ul.links li.last').prev().addClass('test'); - }) + $(document).ready(function() { + $('.terms ul.links li.last').prev().addClass('test'); + }) } ~~~ @@ -55,6 +55,6 @@ This code finds the last item in the list, uses **.prev** to select the one befo ~~~css .terms ul.links li.test:after { - content: " and"; + content: " and"; } ~~~ \ No newline at end of file diff --git a/source/_posts/2010-04-28-imagecrop.md b/source/_posts/2010-04-28-imagecrop.md index a65812f3..1dac7809 100644 --- a/source/_posts/2010-04-28-imagecrop.md +++ b/source/_posts/2010-04-28-imagecrop.md @@ -3,12 +3,12 @@ title: Using ImageCache and ImageCrop for my Portfolio nav: blog slug: using-imagecache-and-imagecrop-my-portfolio tags: - - drupal - - drupal-6 - - cck - - imagecache - - imagecrop - - imagefield + - drupal + - drupal-6 + - cck + - imagecache + - imagecrop + - imagefield --- Whilst working on my own portfolio/testimonial website, I decided to have a portfolio page displaying the name of each site and a thumbnail image. For this Blog post, I'll be using a site called [Popcorn Strips](http://popcornstrips.com) which I built for a friend earlier this year as an example. diff --git a/source/_posts/2010-05-06-conditional-email-address-webform.md b/source/_posts/2010-05-06-conditional-email-address-webform.md index 6989698c..e61d4d77 100644 --- a/source/_posts/2010-05-06-conditional-email-address-webform.md +++ b/source/_posts/2010-05-06-conditional-email-address-webform.md @@ -3,14 +3,14 @@ title: Conditional Email Addresses in a Webform nav: blog slug: conditional-email-addresses-webform tags: - - drupal-planet - - drupal-6 - - conditional-email - - webform + - drupal-planet + - drupal-6 + - conditional-email + - webform --- I created a new Webform to serve as a simple Contact form, but left the main configuration until after I created the form components. I added 'Name', 'Email', 'Subject' and 'Message' fields, as well as a 'Category' select list. Below 'Options', I entered each of my desired options in the following format: - Email address|Visible name + Email address|Visible name I went back to the form configuration page and expanded 'Conditional Email Recipients', and selected my Category. Note that the standard 'Email To' field above it needs to be empty. Originally, I made the mistake of leaving addresses in that field which resulted in people being sent emails regardles of which category was selected. I then configured the rest of the form. diff --git a/source/_posts/2010-05-10-zenophile.md b/source/_posts/2010-05-10-zenophile.md index f2a2b360..9936d631 100644 --- a/source/_posts/2010-05-10-zenophile.md +++ b/source/_posts/2010-05-10-zenophile.md @@ -2,12 +2,12 @@ title: Quickly Create Zen Subthemes Using Zenophile nav: blog tags: - - drupal-planet - - drupal-6 - - drupal-modules - - drupal-theming - - zen - - zenophile + - drupal-planet + - drupal-6 + - drupal-modules + - drupal-theming + - zen + - zenophile --- If you use the [Zen](http://drupal.org/project/zen) theme, then you should also be using the [Zenophile](http://drupal.org/project/zenophile) module! diff --git a/source/_posts/2010-05-25-fancy-slide.md b/source/_posts/2010-05-25-fancy-slide.md index b0580aae..f5117a86 100644 --- a/source/_posts/2010-05-25-fancy-slide.md +++ b/source/_posts/2010-05-25-fancy-slide.md @@ -3,11 +3,11 @@ title: Create a Slideshow of Multiple Images Using Fancy Slide nav: blog slug: create-slideshow-multiple-images-using-fancy-slide tags: - - drupal-planet - - drupal - - drupal-6 - - fancy-slide - - slideshow + - drupal-planet + - drupal + - drupal-6 + - fancy-slide + - slideshow --- Whilst updating my About page, I thought about creating a slideshow of several images instead of just the one static image. When I looking on Drupal.org, the only slideshow modules were to create slideshows of images that were attached to different nodes - not multiple images attached to one node. Then, I found the [Fancy Slide](http://drupal.org/project/fancy_slide) module. It's a jQuery Slideshow module with features that include integration with the [CCK](http://drupal.org/project/cck), [ImageCache](http://drupal.org/project/imagecache) and [Nodequeue](http://drupal.org/project/nodequeue) modules. diff --git a/source/_posts/2010-05-29-imagefield-import-module.md b/source/_posts/2010-05-29-imagefield-import-module.md index 9a37daaa..abb4215c 100644 --- a/source/_posts/2010-05-29-imagefield-import-module.md +++ b/source/_posts/2010-05-29-imagefield-import-module.md @@ -3,13 +3,13 @@ title: Quickly Import Multiples Images Using the Imagefield_Import Module nav: blog slug: quickly-import-multiples-images-using-imagefieldimport-module tags: - - drupal-planet - - imagefield-import - - drupal - - drupal-6 - - photo-gallery - - cck - - imagefield + - drupal-planet + - imagefield-import + - drupal + - drupal-6 + - photo-gallery + - cck + - imagefield --- **Thanks to Bob at [Mustardseed Media](http://mustardseedmedia.com) for [tweeting](http://twitter.com/mustardseedinc/status/14713096905) about this module. It's undoubtedly saved me hours of work today alone!** diff --git a/source/_posts/2010-06-02-improve-jpg-quality.md b/source/_posts/2010-06-02-improve-jpg-quality.md index 25f25ad7..e593390a 100644 --- a/source/_posts/2010-06-02-improve-jpg-quality.md +++ b/source/_posts/2010-06-02-improve-jpg-quality.md @@ -3,9 +3,9 @@ title: Improve JPG Quality in Imagecache and ImageAPI nav: blog slug: improve-jpg-quality-imagecache-and-imageapi tags: - - drupal-planet - - drupal-6 - - imagecache + - drupal-planet + - drupal-6 + - imagecache --- Whilst uploading images for my Projects and Testimonials sections, I noticed that the Imagecache-scaled images weren't as high a quality the originals on my Mac. I did some searching online and found out that, by default, Drupal resamples uploaded jpgs to 75% of their original quality. diff --git a/source/_posts/2010-06-23-social-icons-block.md b/source/_posts/2010-06-23-social-icons-block.md index 5c653176..20da178e 100644 --- a/source/_posts/2010-06-23-social-icons-block.md +++ b/source/_posts/2010-06-23-social-icons-block.md @@ -3,12 +3,12 @@ title: Create a Block of Social Media Icons using CCK, Views and Nodequeue nav: blog slug: create-block-social-media-icons-using-cck-views-and-nodequeue tags: - - drupal-planet - - drupal-6 - - drupal - - views - - nodequeue - - oliverdavies.co.uk + - drupal-planet + - drupal-6 + - drupal + - views + - nodequeue + - oliverdavies.co.uk --- I recently decided that I wanted to have a block displayed in a sidebar on my site containing icons and links to my social media profiles - [Twitter](http://twitter.com/opdavies), [Facebook](http://facebook.com/opdavies) etc. I tried the [Follow](http://drupal.org/project/follow) module, but it lacked the option to add extra networks such my [Drupal.org](http://drupal.org/user/381388) account, and my [RSS feed](http://oliverdavies.co.uk/rss.xml). I started to create my own version, and then found [this Blog post](http://www.hankpalan.com/blog/drupal-themes/add-your-social-connections-drupal-icons) by Hank Palan. diff --git a/source/_posts/2010-06-25-useful-drupal-6-modules.md b/source/_posts/2010-06-25-useful-drupal-6-modules.md index d0ef2783..63fae048 100644 --- a/source/_posts/2010-06-25-useful-drupal-6-modules.md +++ b/source/_posts/2010-06-25-useful-drupal-6-modules.md @@ -2,10 +2,10 @@ title: 10 Useful Drupal 6 Modules nav: blog tags: - - drupal-planet - - drupal-6 - - drupal - - drupal-modules + - drupal-planet + - drupal-6 + - drupal + - drupal-modules --- Aside from the obvious candidates such as Views, CCK etc, here are a list of 10 contributed modules that I currently use on each Drupal project. @@ -20,4 +20,4 @@ So, in no particular order: * **[Node Picker](http://drupal.org/project/nodepicker):**
A rewrite of the module [TinyMCE Node Picker](http://drupal.org/project/tinymce_node_picker). Allows you to easily create links to internal nodes. * **[Module Filter](http://drupal.org/project/module_filter):**
What this module aims to accomplish is the ability to quickly find the module you are looking for without having to rely on the browsers search feature which more times than not shows you the module name in the 'Required by' or 'Depends on' sections of the various modules or even some other location on the page like a menu item. * **[Zenophile](http://drupal.org/project/zenophile):**
Quickly create Zen subthemes. -* **[Add Another](http://drupal.org/project/addanother):**
Add another displays a message after a user creates a node, and/or displays an "Add another" tab on nodes allowing them to make another node of the same type. You can control what roles and node types see this feature. \ No newline at end of file +* **[Add Another](http://drupal.org/project/addanother):**
Add another displays a message after a user creates a node, and/or displays an "Add another" tab on nodes allowing them to make another node of the same type. You can control what roles and node types see this feature. \ No newline at end of file diff --git a/source/_posts/2010-06-28-flickr-photo-gallery.md b/source/_posts/2010-06-28-flickr-photo-gallery.md index a958e751..2ffd85f0 100644 --- a/source/_posts/2010-06-28-flickr-photo-gallery.md +++ b/source/_posts/2010-06-28-flickr-photo-gallery.md @@ -3,16 +3,16 @@ title: Create a Flickr Photo Gallery Using Feeds, CCK and Views nav: blog slug: create-flickr-photo-gallery-using-feeds-cck-and-views tags: - - drupal-planet - - drupal-6 - - photo-gallery - - views - - cck - - imagecache - - feeds - - filefield - - flickr - - imagefield + - drupal-planet + - drupal-6 + - photo-gallery + - views + - cck + - imagecache + - feeds + - filefield + - flickr + - imagefield --- In this tutorial, I'll show you how to create a photo gallery which uses photos imported from [Flickr](http://www.flickr.com). @@ -35,7 +35,7 @@ Next, I installed and configured the Feeds and Image Grabber module. I used an o * **Processor settings:** I changed the content type to 'Photo', and the author's name from 'anonymous'. * **Processor mapping:** I added a new mapping from 'Item URL (link)' to 'Photo (FIG)'. The Photo FIG target is added by the Image Grabber module. -Next, I needed to create the actual Feed, which I did by clicking 'Import' within the Navigation menu, and clicking 'Feed'. I gave it a title, entered the URL to my RSS feed from Flickr, and enabled the Image Grabber for this feed. +Next, I needed to create the actual Feed, which I did by clicking 'Import' within the Navigation menu, and clicking 'Feed'. I gave it a title, entered the URL to my RSS feed from Flickr, and enabled the Image Grabber for this feed. Once the Feed is created, the latest 20 images from the RSS feed are imported and 20 new Photos nodes are created. In the example below, the image with the 'Photo' label is the Image field mapped by the Image Grabber module. It is this image that I'll be displaying within my Gallery. diff --git a/source/_posts/2010-07-01-change-content-type-sql.md b/source/_posts/2010-07-01-change-content-type-sql.md index b9d557da..b5fe7395 100644 --- a/source/_posts/2010-07-01-change-content-type-sql.md +++ b/source/_posts/2010-07-01-change-content-type-sql.md @@ -3,13 +3,13 @@ title: Change the Content Type of Multiple Nodes Using SQL nav: blog slug: change-content-type-multiple-nodes-using-sql tags: - - drupal-planet - - drupal-6 - - drupal - - sql - - sequel-pro - - database - - content-types + - drupal-planet + - drupal-6 + - drupal + - sql + - sequel-pro + - database + - content-types --- In this post, I will be changing values within my Drupal 6 site's database to quickly change the content type of multiple nodes. I will be using a test development site with the core Blog module installed, and converting Blog posts to a custom content type called 'News article'. diff --git a/source/_posts/2010-07-02-virtual-hosts-virtualhostx.md b/source/_posts/2010-07-02-virtual-hosts-virtualhostx.md index 5e79334b..7c49f223 100644 --- a/source/_posts/2010-07-02-virtual-hosts-virtualhostx.md +++ b/source/_posts/2010-07-02-virtual-hosts-virtualhostx.md @@ -3,11 +3,11 @@ title: Create Virtual Hosts on Mac OS X Using VirtualHostX nav: blog slug: create-virtual-hosts-mac-os-x-using-virtualhostx tags: - - drupal-planet - - drupal-6 - - mamp - - virtual-hosts - - virtualhostx + - drupal-planet + - drupal-6 + - mamp + - virtual-hosts + - virtualhostx --- This isn't a Drupal related topic per se, but it is a walk-through of one of the applications that I use whilst doing Drupal development work. I assume, like most Mac OS X users, I use [MAMP](http://www.mamp.info/en/index.html) to run Apache, MySQL and PHP locally whilst developing. I also use virtual hosts in Apache to create local .dev domains which are as close as possible to the actual live domains. For example, if I was developing a site called mysite.com, my local development version would be mysite.dev. diff --git a/source/_posts/2010-07-07-add-taxonomy-term-multiple-nodes-using-sql.md b/source/_posts/2010-07-07-add-taxonomy-term-multiple-nodes-using-sql.md index bfeda95c..919a30d7 100644 --- a/source/_posts/2010-07-07-add-taxonomy-term-multiple-nodes-using-sql.md +++ b/source/_posts/2010-07-07-add-taxonomy-term-multiple-nodes-using-sql.md @@ -3,12 +3,12 @@ title: Add a Taxonomy Term to Multiple Nodes Using SQL nav: blog slug: add-taxonomy-term-multiple-nodes-using-sql tags: - - taxonomy - - drupal-planet - - drupal-6 - - sql - - sequal-pro - - database + - taxonomy + - drupal-planet + - drupal-6 + - sql + - sequal-pro + - database --- **Update:** This can also be done using the [Views Bulk Operations](http://drupal.org/project/views_bulk_operations) module. diff --git a/source/_posts/2010-07-12-teleport-module.md b/source/_posts/2010-07-12-teleport-module.md index b4580e0f..8dc42406 100644 --- a/source/_posts/2010-07-12-teleport-module.md +++ b/source/_posts/2010-07-12-teleport-module.md @@ -3,10 +3,10 @@ title: Review of the Teleport Module nav: blog slug: review-teleport-module tags: - - drupal-planet - - drupal-6 - - drupal-modules - - teleport + - drupal-planet + - drupal-6 + - drupal-modules + - teleport --- As a heavily-reliant [Quicksilver](http://en.wikipedia.org/wiki/Quicksilver_%28software%29) user on my MacBook Pro, I was glad when I found the [Teleport](http://drupal.org/project/teleport) module for [Drupal](http://drupal.org) *(due to Elliott Rothman's [tweet](http://twitter.com/elliotttt/status/18044234238))*. diff --git a/source/_posts/2010-08-10-adminhover-module.md b/source/_posts/2010-08-10-adminhover-module.md index 5b071eb2..61373801 100644 --- a/source/_posts/2010-08-10-adminhover-module.md +++ b/source/_posts/2010-08-10-adminhover-module.md @@ -3,11 +3,11 @@ title: Review of the Admin:hover Module nav: blog slug: review-adminhover-module tags: - - drupal-planet - - drupal-6 - - drupal-modules - - admin:hover - - administration + - drupal-planet + - drupal-6 + - drupal-modules + - admin:hover + - administration --- Sorry for the lack of Blog posts lately, but [my new job](http://horseandcountry.tv) that I started a few weeks ago has certainly been keeping me busy! I've got a few more posts that I'm preparing content for, and I'll hopefully be back into my weekly-post routine before too long! diff --git a/source/_posts/2010-08-11-better-photo-gallery-1.md b/source/_posts/2010-08-11-better-photo-gallery-1.md index 23b8cc16..46c640f8 100644 --- a/source/_posts/2010-08-11-better-photo-gallery-1.md +++ b/source/_posts/2010-08-11-better-photo-gallery-1.md @@ -3,25 +3,25 @@ title: Create a Better Photo Gallery in Drupal - Part 1 nav: blog slug: create-better-photo-gallery-drupal-part-1 tags: - - drupal-planet - - drupal-6 - - photo-gallery - - sql - - views - - sequel-pro - - cck - - views-attach - - drupal + - drupal-planet + - drupal-6 + - photo-gallery + - sql + - views + - sequel-pro + - cck + - views-attach + - drupal --- Recently, I converted a client's static HTML website, along with their Coppermine Photo Gallery, into a Drupal-powered website. Over the next few posts, I'll be replicating the process that I used during the conversion, and how I added some additional features to my Drupal gallery. -To begin with, I created my photo gallery as described by [Jeff Eaton](http://www.lullabot.com/about/team/jeff-eaton) in [this screencast](http://www.lullabot.com/articles/photo-galleries-views-attach), downloaded all my client's previous photos via FTP, and quickly added them into the new gallery using the [Imagefield Import](http://drupal.org/project/imagefield_import) module (which I mentioned [previously](/blog/quickly-import-multiples-images-using-imagefieldimport-module/)). +To begin with, I created my photo gallery as described by [Jeff Eaton](http://www.lullabot.com/about/team/jeff-eaton) in [this screencast](http://www.lullabot.com/articles/photo-galleries-views-attach), downloaded all my client's previous photos via FTP, and quickly added them into the new gallery using the [Imagefield Import](http://drupal.org/project/imagefield_import) module (which I mentioned [previously](/blog/quickly-import-multiples-images-using-imagefieldimport-module/)). -When I compare this to the previous gallery, I can see several differences which I'd like to include. The first of which is the number of photos in each gallery, and the date that the most recent photo was added. +When I compare this to the previous gallery, I can see several differences which I'd like to include. The first of which is the number of photos in each gallery, and the date that the most recent photo was added. -To do this, I'd need to query my website's database. To begin with, I wanted to have a list of all the galleries on my site which are published, and what they're unique node ID values are. To do this, I opened Sequel Pro and entered the following code: +To do this, I'd need to query my website's database. To begin with, I wanted to have a list of all the galleries on my site which are published, and what they're unique node ID values are. To do this, I opened Sequel Pro and entered the following code: ~~~sql SELECT title @@ -31,9 +31,9 @@ WHERE type = 'gallery' AND status = 1; ~~~ -As the nid value of each gallery corresponds with the 'field_gallery_nid' field within the content_type_photo field, I can now query the database and retrieve information about each specific gallery. +As the nid value of each gallery corresponds with the 'field_gallery_nid' field within the content_type_photo field, I can now query the database and retrieve information about each specific gallery. -For example, using [aliasing](http://www.w3schools.com/sql/sql_alias.asp) within my SQL statement, I can retrieve a list of all the published photos within the 'British Squad 2008' gallery by using the following code: +For example, using [aliasing](http://www.w3schools.com/sql/sql_alias.asp) within my SQL statement, I can retrieve a list of all the published photos within the 'British Squad 2008' gallery by using the following code: ~~~sql SELECT n.title, n.nid, p.field_gallery_nid @@ -53,7 +53,7 @@ AND n.status = 1 AND n.nid = p.nid; ~~~ -As I've used the [Views Attach](http://drupal.org/project/views_attach) module, and I'm embedding the photos directly into the Gallery nodes, I easily add this to each gallery by creating a custom node-gallery.tpl.php file within my theme. I can then use the following PHP code to retrieve the node ID for that specific gallery: +As I've used the [Views Attach](http://drupal.org/project/views_attach) module, and I'm embedding the photos directly into the Gallery nodes, I easily add this to each gallery by creating a custom node-gallery.tpl.php file within my theme. I can then use the following PHP code to retrieve the node ID for that specific gallery: ~~~php There are currently ' . $selected_gallery_total . ' photos in this gallery.'; - $output .= 'Last one added on ' . $latest_photo . ''; - print $output; + $output = 'There are currently ' . $selected_gallery_total . ' photos in this gallery.'; + $output .= 'Last one added on ' . $latest_photo . ''; + print $output; } ?> ~~~ OK, so let's take a look at the Gallery so far: -You will notice that the returned date value for the latest photo added is displaying the UNIX timestamp instead of in a more readable format. This can be changed by altering the 'print' statement to include a PHP 'date' function: +You will notice that the returned date value for the latest photo added is displaying the UNIX timestamp instead of in a more readable format. This can be changed by altering the 'print' statement to include a PHP 'date' function: ~~~php There are currently ' . $selected_gallery_total . ' photos in this gallery.'; - $output .= 'Last one added on ' . date("l, jS F, Y", $latest_photo) . '.'; - print $output; + $output = 'There are currently ' . $selected_gallery_total . ' photos in this gallery.'; + $output .= 'Last one added on ' . date("l, jS F, Y", $latest_photo) . '.'; + print $output; } ?> ~~~ The values that I've entered are from [this page](http://php.net/manual/en/function.date.php) on PHP.net, and can be changed according on how you want the date to be displayed. -As I've added all of these photos today, then the correct dates are being displayed. However, on the client's original website, the majority of these photos were pubished several months or years ago, and I'd like the new website to still reflect the original created dates. As opposed to modifying each individual photograph, I'll be doing this in bulk in my next post. \ No newline at end of file +As I've added all of these photos today, then the correct dates are being displayed. However, on the client's original website, the majority of these photos were pubished several months or years ago, and I'd like the new website to still reflect the original created dates. As opposed to modifying each individual photograph, I'll be doing this in bulk in my next post. \ No newline at end of file diff --git a/source/_posts/2010-08-17-better-photo-gallery-2.md b/source/_posts/2010-08-17-better-photo-gallery-2.md index 59b1d77e..13a5377a 100644 --- a/source/_posts/2010-08-17-better-photo-gallery-2.md +++ b/source/_posts/2010-08-17-better-photo-gallery-2.md @@ -3,15 +3,15 @@ title: Create a Better Photo Gallery in Drupal - Part 2 nav: blog slug: create-better-photo-gallery-drupal-part-2 tags: - - drupal-planet - - drupal-6 - - photo-gallery - - sql - - sequel-pro + - drupal-planet + - drupal-6 + - photo-gallery + - sql + - sequel-pro --- -At the end of my last post, I'd finished creating the first part of the new photo gallery, but I wanted to change the dates of the published photos to reflect the ones on the client's original website. +At the end of my last post, I'd finished creating the first part of the new photo gallery, but I wanted to change the dates of the published photos to reflect the ones on the client's original website. -Firstly, I'll refer to the previous list of published galleries that I created before, and create something different that also displays the created and modified dates. Picking the node ID of the required gallery, I used the following SQL query to display a list of photos. +Firstly, I'll refer to the previous list of published galleries that I created before, and create something different that also displays the created and modified dates. Picking the node ID of the required gallery, I used the following SQL query to display a list of photos. ~~~sql SELECT n.title, n.nid, n.created, n.changed, p.field_gallery_nid @@ -20,22 +20,22 @@ AND p.field_gallery_nid = 103AND n.nid = p.nid ORDER BY n.nid ASC; ~~~ -When I look back at the old photo gallery, I can see that the previous 'last added' date was June 27, 2008. So, how do I update my new photos to reflect that date? Using , I can enter the required date in its readable format, and it will give me the equivilent UNIX timestamp. To keep things relatively simple, I'll set all photos within this gallery to the same time. +When I look back at the old photo gallery, I can see that the previous 'last added' date was June 27, 2008. So, how do I update my new photos to reflect that date? Using , I can enter the required date in its readable format, and it will give me the equivilent UNIX timestamp. To keep things relatively simple, I'll set all photos within this gallery to the same time. -The result that I'm given is '1217149200'. I can now use an UPDATE statement within another SQL query to update the created and modified dates. +The result that I'm given is '1217149200'. I can now use an UPDATE statement within another SQL query to update the created and modified dates. ~~~sql UPDATE node INNER JOIN content_type_photo ON node.nid = content_type_photo.nid SET - node.created = 1217149200, - node.changed = 1217149200 + node.created = 1217149200, + node.changed = 1217149200 WHERE content_type_photo.field_gallery_nid = 103 ~~~ -Now when I query the database, both the created and modified databases have been updated, and when I return to the new photo gallery, the updated value is being displayed. +Now when I query the database, both the created and modified databases have been updated, and when I return to the new photo gallery, the updated value is being displayed. Once the changes have been applied, it's a case of repeating the above process for each of the required galleries. -In the next post, I'll explain how to add a count of published galleries and photos on the main photo gallery page, as well as how to install and configure the [Shadowbox](http://drupal.org/project/shadowbox) module. \ No newline at end of file +In the next post, I'll explain how to add a count of published galleries and photos on the main photo gallery page, as well as how to install and configure the [Shadowbox](http://drupal.org/project/shadowbox) module. \ No newline at end of file diff --git a/source/_posts/2010-08-20-image-caption-module.md b/source/_posts/2010-08-20-image-caption-module.md index e316e0f0..d201b45e 100644 --- a/source/_posts/2010-08-20-image-caption-module.md +++ b/source/_posts/2010-08-20-image-caption-module.md @@ -3,11 +3,11 @@ title: Review of the Image Caption Module nav: blog slug: review-image-caption-module tags: - - drupal-planet - - drupal - - drupal-6 - - imagefield - - image-caption + - drupal-planet + - drupal + - drupal-6 + - imagefield + - image-caption --- Up until as recent as last week, whenever I added an image into one of my Blog posts, I was manually adding the caption below each image and styling it accordingly. That was until I installed the [Image Caption](http://drupal.org/project/image_caption) module. diff --git a/source/_posts/2010-09-26-south-wales-drupal-user-group.md b/source/_posts/2010-09-26-south-wales-drupal-user-group.md index 96d745ef..856f292b 100644 --- a/source/_posts/2010-09-26-south-wales-drupal-user-group.md +++ b/source/_posts/2010-09-26-south-wales-drupal-user-group.md @@ -3,10 +3,10 @@ title: The Inaugural Meetup for the South Wales Drupal User Group nav: blog slug: south-wales-drupal-user-group tags: - - drupal - - drupal-planet - - swdug - - meetups + - drupal + - drupal-planet + - swdug + - meetups --- If you do Drupal, and you're in the area, come and join us for the first South Wales Drupal User Group Meetup! diff --git a/source/_posts/2010-10-10-create-apply-patches.md b/source/_posts/2010-10-10-create-apply-patches.md index 0db8395b..74663d10 100644 --- a/source/_posts/2010-10-10-create-apply-patches.md +++ b/source/_posts/2010-10-10-create-apply-patches.md @@ -3,26 +3,26 @@ title: How to Create and Apply Patches nav: blog slug: create-and-apply-patches tags: - - drupal-planet - - drupal-6 - - modules - - patches + - drupal-planet + - drupal-6 + - modules + - patches --- Earlier this year, I posted a solution to [an issue](http://drupal.org/node/753898) on the Drupal.org issue queue. Originally, I just posted the code back onto the issue, but have now created a patch that can easily be applied to any Drupal 6 installation. Here is a run-through of the process of creating and applying a patch. In this case, I made changes to the `user_pass_validate()` function that's found within `modules/user/user.pages.inc`. To begin with, a download a fresh copy of Drupal 6.19 and created a copy of the original user.pages.inc file. Within the duplicate file, I made the same changes to the function that I did in earlier code, and saved the changes. Now, within my Terminal, I can navigate to Drupal's root directory and create the patch. - diff -rup modules/user/user.pages.inc modules/user/user.pages2.inc > /Users/oliver/Desktop/different_messages_for_blocked_users.patch + diff -rup modules/user/user.pages.inc modules/user/user.pages2.inc > /Users/oliver/Desktop/different_messages_for_blocked_users.patch This command compares the differences between the two files, and creates the specified patch file. To apply the patch to my Drupal installation, I go back to Terminal and run the following code: - patch -p0 < /Users/oliver/Desktop/different_messages_for_blocked_users.patch + patch -p0 < /Users/oliver/Desktop/different_messages_for_blocked_users.patch If, for some reason, I need to reverse the patch, I can run this code: - patch -p0 -R < /Users/oliver/Desktop/different_messages_for_blocked_users.patch + patch -p0 -R < /Users/oliver/Desktop/different_messages_for_blocked_users.patch And that's it! diff --git a/source/_posts/2010-10-13-better-photo-gallery-2.md b/source/_posts/2010-10-13-better-photo-gallery-2.md index ace8f26d..666c4caa 100644 --- a/source/_posts/2010-10-13-better-photo-gallery-2.md +++ b/source/_posts/2010-10-13-better-photo-gallery-2.md @@ -3,7 +3,7 @@ title: Create a Better Photo Gallery in Drupal - Part 3 nav: blog slug: create-better-photo-gallery-drupal-part-3 tags: - - drupal + - drupal --- The next part of the new gallery that I want to implement is to group the galleries by their respective categories. The first step is to edit my original photo_gallery view and add an additional display. @@ -27,8 +27,8 @@ To reduce the amount of code needed, I can use the following 'while' loop to gen ' . $term['name'] . ''; - print views_embed_view('gallery', 'page_2', $term['name']); + print '

' . $term['name'] . '

'; + print views_embed_view('gallery', 'page_2', $term['name']); } ?> ~~~ \ No newline at end of file diff --git a/source/_posts/2010-10-22-better-photo-gallery-21.md b/source/_posts/2010-10-22-better-photo-gallery-21.md index 26f103bf..08f5f0d5 100644 --- a/source/_posts/2010-10-22-better-photo-gallery-21.md +++ b/source/_posts/2010-10-22-better-photo-gallery-21.md @@ -3,7 +3,7 @@ title: Create a Better Photo Gallery in Drupal - Part 2.1 nav: blog slug: create-better-photo-gallery-drupal-part-21 tags: - - drupal + - drupal --- Today, I realised that I hadn't published the code that I used to create the total figures of galleries and photos at the top of the gallery (I said at the end of [Part 2](/blog/create-better-photo-gallery-drupal-part-2/ "Create a Better Photo Gallery in Drupal - Part 2") that I'd include it in [Part 3](/blog/create-better-photo-gallery-drupal-part-3/ "Create a Better Photo Gallery in Drupal - Part 3"), but I forgot). So, here it is: @@ -16,38 +16,38 @@ $galleries = db_query("SELECT nid FROM {node} WHERE type = 'gallery' AND status $output = 0; // Prints a list of nids of published galleries. while($gallery = db_fetch_array($galleries)) { - $gallery_id = $gallery['nid']; - $photos = $photos + db_result(db_query("SELECT COUNT(*) FROM node n, content_type_photo ctp WHERE n.status = 1 AND n.type = 'photo' AND ctp.field_gallery_nid = $gallery_id AND n.nid = ctp.nid")); + $gallery_id = $gallery['nid']; + $photos = $photos + db_result(db_query("SELECT COUNT(*) FROM node n, content_type_photo ctp WHERE n.status = 1 AND n.type = 'photo' AND ctp.field_gallery_nid = $gallery_id AND n.nid = ctp.nid")); } - + // Prints the output. print 'There '; if($photos == 1) { - print 'is'; + print 'is'; } else { - print 'are'; + print 'are'; } print ' currently '; print $photos . ' '; if($photos == 1) { - print 'photo'; + print 'photo'; } else { - print 'photos'; + print 'photos'; } print ' in '; - + // Counts the number of published galleries on the site. $galleries = db_result(db_query("SELECT COUNT(*) FROM {node} WHERE TYPE = 'gallery' AND STATUS = 1")); - + // Prints the number of published galleries. print $galleries; if ($galleries == 1) { - print ' gallery'; + print ' gallery'; } else { - print ' galleries'; + print ' galleries'; } print '.'; ?> diff --git a/source/_posts/2010-11-04-regular-expressions-search.md b/source/_posts/2010-11-04-regular-expressions-search.md index 4e280c58..6f4b5c2c 100644 --- a/source/_posts/2010-11-04-regular-expressions-search.md +++ b/source/_posts/2010-11-04-regular-expressions-search.md @@ -3,12 +3,12 @@ title: Use Regular Expressions to Search and Replace in Coda or TextMate nav: blog slug: use-regular-expressions-search-and-replace-coda-or-textmate tags: - - taxonomy - - sequel-pro - - database - - coda - - regular-expression - - textmate + - taxonomy + - sequel-pro + - database + - coda + - regular-expression + - textmate --- As in [the original post](/blog/add-taxonomy-term-multiple-nodes-using-sql/ "Quickly adding a taxonomy term to multiple nodes using SQL"), I'd generated a list of node ID values, and needed to add structure the SQL update statment formatted in a certain way. However, I changed my inital query slightly to out put the same nid value twice. diff --git a/source/_posts/2011-02-14-typekit-fonts.md b/source/_posts/2011-02-14-typekit-fonts.md index a2cd5768..0e4ee473 100644 --- a/source/_posts/2011-02-14-typekit-fonts.md +++ b/source/_posts/2011-02-14-typekit-fonts.md @@ -3,9 +3,9 @@ title: Easily Embed TypeKit Fonts into your Drupal Website nav: blog slug: easily-embed-typekit-fonts-your-drupal-website tags: - - drupal-planet - - drupal-6 - - typekit + - drupal-planet + - drupal-6 + - typekit --- To begin with, you will need to [register for a TypeKit account](https://typekit.com/plans) - there is a free version if you just want to try it out. diff --git a/source/_posts/2011-03-15-number-of-facebook-fans.md b/source/_posts/2011-03-15-number-of-facebook-fans.md index fcc6894c..fff3ab73 100644 --- a/source/_posts/2011-03-15-number-of-facebook-fans.md +++ b/source/_posts/2011-03-15-number-of-facebook-fans.md @@ -3,7 +3,7 @@ title: Display the Number of Facebook fans in PHP nav: blog slug: display-number-facebook-fans-php tags: - - php + - php --- Replace the $page_id value with your Page ID number (unless you want to show the number of fans for this site).You can find your Page ID by logging into your Facebook account, going to 'Adverts and Pages', clicking 'Edit page', and looking at the URL. diff --git a/source/_posts/2011-03-31-proctors.md b/source/_posts/2011-03-31-proctors.md index e3d01484..234b7d3b 100644 --- a/source/_posts/2011-03-31-proctors.md +++ b/source/_posts/2011-03-31-proctors.md @@ -3,7 +3,7 @@ title: Proctor & Stevenson nav: blog slug: proctor-stevenson tags: - - personal + - personal --- 2 weeks ago, I handed in my notice of resignation to [Horse & Country TV](http://horseandcountry.tv)because I've been offered a new role at [Proctor & Stevenson](http://proctors.co.uk) - a Marketing Design and Communications agency in Bristol. diff --git a/source/_posts/2011-05-20-proctors-drupal-meetup.md b/source/_posts/2011-05-20-proctors-drupal-meetup.md index 1aede14d..7db3936c 100644 --- a/source/_posts/2011-05-20-proctors-drupal-meetup.md +++ b/source/_posts/2011-05-20-proctors-drupal-meetup.md @@ -3,8 +3,8 @@ title: Proctors Hosting the next Drupal Meetup nav: blog slug: proctors-hosting-next-drupal-meetup tags: - - meetups - - drupal-bristol + - meetups + - drupal-bristol --- My employer, [Proctor & Stevenson](http://www.proctors.co.uk), are going to be hosting the next Bristol & South West Drupal meetup on the 25th May at our offices. diff --git a/source/_posts/2011-05-23-imagefield-import-archive.md b/source/_posts/2011-05-23-imagefield-import-archive.md index 53a9e95d..6d46c72b 100644 --- a/source/_posts/2011-05-23-imagefield-import-archive.md +++ b/source/_posts/2011-05-23-imagefield-import-archive.md @@ -2,8 +2,8 @@ title: Imagefield Import Archive nav: blog tags: - - drupal-planet - - imagefield-import + - drupal-planet + - imagefield-import --- I've finally uploaded my first module onto Drupal.org! diff --git a/source/_posts/2011-08-28-multigroups-field-collections.md b/source/_posts/2011-08-28-multigroups-field-collections.md index 5ecc31d2..23e20485 100644 --- a/source/_posts/2011-08-28-multigroups-field-collections.md +++ b/source/_posts/2011-08-28-multigroups-field-collections.md @@ -3,13 +3,13 @@ title: Create Multigroups in Drupal 7 using Field Collections nav: blog slug: create-multigroups-drupal-7-using-field-collections tags: - - drupal-7 - - drupal-planet - - cck - - fields - - field-collection - - entity-api - - multigroup + - drupal-7 + - drupal-planet + - cck + - fields + - field-collection + - entity-api + - multigroup --- One of my favourite things lately in Drupal 6 has been CCK 3, and more specifically, the Content Multigroups sub-module. Basically this allows you to create a fieldset of various CCK fields, and then repeat that multiple times. For example, I use it on this site whist creating invoices for clients. I have a fieldset called 'Line Item', containing 'Description', 'Quantity' and 'Price' fields. With a standard fieldset, I could only have one instance of each field - however, using a multigroup, I can create multiple groups of line items which I then use within the invoice. diff --git a/source/_posts/2011-10-19-install-and-configure-subversion-svn-server-ubuntu.md b/source/_posts/2011-10-19-install-and-configure-subversion-svn-server-ubuntu.md index 39f5b45d..63e2a54e 100644 --- a/source/_posts/2011-10-19-install-and-configure-subversion-svn-server-ubuntu.md +++ b/source/_posts/2011-10-19-install-and-configure-subversion-svn-server-ubuntu.md @@ -3,9 +3,9 @@ title: How to Install and Configure Subversion (SVN) Server on Ubuntu nav: blog slug: install-and-configure-subversion-svn-server-ubuntu tags: - - svn - - ubuntu - - version-control + - svn + - ubuntu + - version-control --- Recently, I needed to set up a Subversion (SVN) server on a Ubuntu Linux server. This post is going to outline the steps taken, and the commands used, to install and configure the service. @@ -13,11 +13,11 @@ Note: As I was using Ubuntu, I was using the 'apt-get' command to download and i Firstly, I'm going to ensure that all of my installed packages are up to date, and install any available updates. - $ sudo apt-get update + $ sudo apt-get update Now, I need to download the subversion, subversion-tools and libapache2 packages. - $ sudo apt-get install subversion subversion-tools libapache2-svn + $ sudo apt-get install subversion subversion-tools libapache2-svn These are all of the packages that are needed to run a Subversion server. @@ -25,55 +25,55 @@ These are all of the packages that are needed to run a Subversion server. Now, I need to create the directory where my repositories are going to sit. I've chosen this directory as I know that it's one that is accessible to my managed backup service. - $ sudo mkdir /home/svn + $ sudo mkdir /home/svn ## Create a test repository First, I'll create a new folder in which I'll create my test project, and then I'll create a repository for it. - $ sudo mkdir ~/test - $ sudo svnadmin create /home/svn/test -m 'initial project structure' + $ sudo mkdir ~/test + $ sudo svnadmin create /home/svn/test -m 'initial project structure' This will create a new repository containing the base file structure. ## Adding files into the test project - $ cd ~/test
 - $ mkdir trunk tags branches + $ cd ~/test
 + $ mkdir trunk tags branches I can now import these new directories into the test repository. - $ sudo svn import ~/test file:///home/svn/test -m 'Initial project directories' + $ sudo svn import ~/test file:///home/svn/test -m 'Initial project directories' This both adds and commits these new directories into the repository. In order for Apache to access the SVN repositories, the `/home/svn` directory needs to be owned by the same user and group that Apache runs as. In Ubuntu, this is usually www-data. To change the owner of a directory, use the chown command. - $ sudo chown -R www-data:www-data /home/svn + $ sudo chown -R www-data:www-data /home/svn ## Configuring Apache The first thing that I need to do is enable the dav_svn Apache module, using the a2enmod command. - $ sudo a2enmod dav_svn + $ sudo a2enmod dav_svn With this enabled, now I need to modify the Apache configuration file. - $ cd /etc/apache2 - $ sudo nano apache2.conf + $ cd /etc/apache2 + $ sudo nano apache2.conf At the bottom of the file, add the following lines, and then save the file by pressing Ctrl+X. ~~~ - DAV svn - SVNParentPath /home/svn + DAV svn + SVNParentPath /home/svn ~~~ With this saved, restart the Apache service for the changes to be applied. - sudo service apache2 restart + sudo service apache2 restart I can now browse through my test repository by opening Firefox, and navigating to `http://127.0.0.1/svn/test`. Here, I can now see my three directories, although they are currently all empty. @@ -87,18 +87,18 @@ Re-open apache2.conf, and replace the SVN Location information with this: ~~~~ - DAV svn - SVNParentPath /home/svn - AuthType Basic - AuthName "My SVN Repositories" - AuthUserFile /etc/svn-auth - Require valid-user + DAV svn + SVNParentPath /home/svn + AuthType Basic + AuthName "My SVN Repositories" + AuthUserFile /etc/svn-auth + Require valid-user ~~~~ Now I need to create the password file. - $ htpasswd -cm /etc/svn-auth oliver + $ htpasswd -cm /etc/svn-auth oliver I'm prompted to enter and confirm my password, and then my details are saved. The Apache service will need to be restarted again, and then the user will need to authenticate themselves before viewing the repositories. @@ -108,15 +108,15 @@ I'm prompted to enter and confirm my password, and then my details are saved. Th For example, now want to checkout the files within my repository into a new directory called 'test2' within my home directory. Firstly, I need to create the new directory, and then I can issue the checkout command. - $ cd ~ - $ mkdir test2 - $ svn checkout http://127.0.0.1/svn/test/trunk test2 + $ cd ~ + $ mkdir test2 + $ svn checkout http://127.0.0.1/svn/test/trunk test2 I'm passing the command two arguments - the first is the URL of the repository's trunk directory, and the second is the directory where the files are to be placed. As no files have been commited yet into the trunk, it appears to be empty - but if you perform an ls -la command, you'll see that there is a hidden .svn directory. Now you can start adding files into the directory. Once you've created your files, perform a svn add command, passing in individual filenames as further arguments. - $ svn add index.php - $ svn add * + $ svn add index.php + $ svn add * With all the required files added, they can be committed using `svn commit -m 'commit message'` command, and the server can be updated using the svn up command. diff --git a/source/_posts/2012-02-01-authorized-keys-passwordless-ssh.md b/source/_posts/2012-02-01-authorized-keys-passwordless-ssh.md index 793bf45e..7c6e1b97 100644 --- a/source/_posts/2012-02-01-authorized-keys-passwordless-ssh.md +++ b/source/_posts/2012-02-01-authorized-keys-passwordless-ssh.md @@ -3,17 +3,17 @@ title: How to use Authorized Keys to Create a Passwordless SSH Connection nav: blog slug: use-authorized-keys-create-passwordless-ssh-connection tags: - - linux - - ssh + - linux + - ssh --- If you're accessing Linux servers or automating tasks between servers, rather than having to enter your user password every time, you can also use SSH public key authentication. This is a simple process that involves creating a local key and storing it within the *authorized_keys* file on the remote server. 1. Check if you already have a SSH key. - `$ ssh-add -L` + `$ ssh-add -L` 2. If you don't have one, create one. - `$ ssh-keygen` + `$ ssh-keygen` 2. Upload the key onto the server. Replace *myserver* with the hostname or IP address of your remote server. - `$ ssh-copy-id myserver` + `$ ssh-copy-id myserver` If you're using Mac OS X and you don't have ssh-copy-id installed, download and install [Homebrew](http://mxcl.github.com/homebrew "Homebrew") and run the `brew install ssh-copy-id` command. @@ -21,7 +21,7 @@ If successful, you should now see a message like: > Now try logging into the machine, with "ssh 'myserver'", and check in: > -> ~/.ssh/authorized_keys +> ~/.ssh/authorized_keys > > to make sure we haven't added extra keys that you weren't expecting. diff --git a/source/_posts/2012-04-16-omega-subtheme-drush-omega-tools.md b/source/_posts/2012-04-16-omega-subtheme-drush-omega-tools.md index 1d8dfae6..a35152e5 100644 --- a/source/_posts/2012-04-16-omega-subtheme-drush-omega-tools.md +++ b/source/_posts/2012-04-16-omega-subtheme-drush-omega-tools.md @@ -3,31 +3,31 @@ title: Create an Omega Subtheme with LESS CSS Preprocessor using Omega Tools and nav: blog slug: create-omega-subtheme-less-css-preprocessor-using-omega-tools-and-drush tags: - - drupal-7 - - omega - - theming - - less - - drupal-planet - - drupal + - drupal-7 + - omega + - theming + - less + - drupal-planet + - drupal --- In this tutorial I'll be showing how to create an [Omega](http://drupal.org/project/omega) subtheme using the [Omega Tools](http://drupal.org/project/omega_tools) module, and have it working with the [LESS CSS preprocessor](http://lesscss.org). The first thing that I need to do is download the Omega theme and the Omega Tools and [LESS](http://drupal.org/project/less "LESS module on drupal.org") modules, and then to enable both modules. I'm doing this using Drush, but you can of course do this via the admin interface at admin/modules. - $ drush dl less omega omega_tools; - $ drush en -y less omega_tools + $ drush dl less omega omega_tools; + $ drush en -y less omega_tools With the Omega Tools module enabled I get the drush omega-subtheme command that creates my Omega subtheme programatically. Using this command, I'm creating a new subtheme, enabling it and setting it as the default theme on my site. - $ drush omega-subtheme "Oliver Davies" --machine_name="oliverdavies" --enable --set-default + $ drush omega-subtheme "Oliver Davies" --machine_name="oliverdavies" --enable --set-default By default, four stylesheets are created within the subtheme's css directory. The first thing that I'm going to do is rename `global.css` to `global.less`. - $ mv css/global.css css/global.less + $ mv css/global.css css/global.less Now I need to find all references to global.css within my oliverdavies.info file. I did this using `$ nano oliverdavies.info`, pressing `Ctrl+W` to search, then `Ctrl+R` to replace, entering `global.css` as the search phrase, and then `global.less` as the replacement text. After making any changes to oliverdavies.info, I need to clear Drupal's caches for the changes to be applied. - $ drush cc all + $ drush cc all I tested my changes by making some quick additions to my global.less file and reloading the page. diff --git a/source/_posts/2012-04-17-nagios-centos.md b/source/_posts/2012-04-17-nagios-centos.md index 0e9b7796..41b92bba 100644 --- a/source/_posts/2012-04-17-nagios-centos.md +++ b/source/_posts/2012-04-17-nagios-centos.md @@ -3,9 +3,9 @@ title: Installing Nagios on CentOS nav: blog slug: installing-nagios-centos tags: - - nagios - - centos - - linux + - nagios + - centos + - linux --- A great post details that details the steps needed to install [Nagios](http://nagios.org) - a popular open source system and network monitoring software application - on CentOS. diff --git a/source/_posts/2012-04-19-custom-theme-templates.md b/source/_posts/2012-04-19-custom-theme-templates.md index eb66a980..e902205f 100644 --- a/source/_posts/2012-04-19-custom-theme-templates.md +++ b/source/_posts/2012-04-19-custom-theme-templates.md @@ -2,11 +2,11 @@ title: Adding Custom Theme Templates in Drupal 7 nav: blog description: > - Today, I had a situation where I was displaying a list of teasers for news article nodes. The article content type had several different fields assigned to it, including main and thumbnail images. In this case, I wanted to have different output and fields displayed when a teaser was displayed compared to when a complete node was displayed. + Today, I had a situation where I was displaying a list of teasers for news article nodes. The article content type had several different fields assigned to it, including main and thumbnail images. In this case, I wanted to have different output and fields displayed when a teaser was displayed compared to when a complete node was displayed. slug: adding-custom-theme-templates-drupal-7 tags: - - drupal-planet - - drupal + - drupal-planet + - drupal --- Today, I had a situation where I was displaying a list of teasers for news article nodes. The article content type had several different fields assigned to it, including main and thumbnail images. In this case, I wanted to have different output and fields displayed when a teaser was displayed compared to when a complete node was displayed. @@ -14,10 +14,10 @@ I have previously seen it done this way by adding this into in a node.tpl.php fi ~~~~ if ($teaser) { - // The teaser output. + // The teaser output. } else { - // The whole node output. + // The whole node output. } ~~~~ @@ -27,10 +27,10 @@ The function requires the node variables as an argument - one of which is theme_ ~~~~php array ( - 0 => 'node__article', - 1 => 'node__343', - 2 => 'node__view__latest_news', - 3 => 'node__view__latest_news__page', + 0 => 'node__article', + 1 => 'node__343', + 2 => 'node__view__latest_news', + 3 => 'node__view__latest_news__page', ) ~~~~ @@ -41,12 +41,12 @@ So, within my theme's template.php file: * Implementation of hook_preprocess_HOOK(). */ function mytheme_preprocess_node(&$variables) { - $node = $variables['node']; - - if ($variables['teaser']) { - // Add a new item into the theme_hook_suggestions array. - $variables['theme_hook_suggestions'][] = 'node__' . $node->type . '_teaser'; - } + $node = $variables['node']; + + if ($variables['teaser']) { + // Add a new item into the theme_hook_suggestions array. + $variables['theme_hook_suggestions'][] = 'node__' . $node->type . '_teaser'; + } } ~~~~ @@ -54,11 +54,11 @@ After adding the new suggestion: ~~~~php array ( - 0 => 'node__article', - 1 => 'node__343', - 2 => 'node__view__latest_news', - 3 => 'node__view__latest_news__page', - 4 => 'node__article_teaser', + 0 => 'node__article', + 1 => 'node__343', + 2 => 'node__view__latest_news', + 3 => 'node__view__latest_news__page', + 4 => 'node__article_teaser', ) ~~~~ diff --git a/source/_posts/2012-05-23-apache-text-files.md b/source/_posts/2012-05-23-apache-text-files.md index a95cf880..63cf41b4 100644 --- a/source/_posts/2012-05-23-apache-text-files.md +++ b/source/_posts/2012-05-23-apache-text-files.md @@ -3,15 +3,15 @@ title: Prevent Apache from displaying text files within a web browser nav: blog slug: prevent-apache-displaying-text-files-within-web-browser tags: - - apache - - code - - drupal + - apache + - code + - drupal --- When you download [Drupal](http://drupal.org), there are several text files that are placed in the root of your installation. You don't want or need these to be visible to anyone attempting to view them in a browser - especially CHANGELOG.txt as that includes the exact version of Drupal you are running and could therefore have security implications. Rather than delete these files or change the file permissions manually for each file, I can add the following lines into my VirtualHost configuration: - - Order deny,allow - Deny from all - + + Order deny,allow + Deny from all + This prevents any files with a .txt extension from being accessed and rendered in a web browser. \ No newline at end of file diff --git a/source/_posts/2012-05-23-checkout-specific-revision-svn-command-line.md b/source/_posts/2012-05-23-checkout-specific-revision-svn-command-line.md index fbdd116d..680d254c 100644 --- a/source/_posts/2012-05-23-checkout-specific-revision-svn-command-line.md +++ b/source/_posts/2012-05-23-checkout-specific-revision-svn-command-line.md @@ -3,13 +3,13 @@ title: Checkout a specific revision from SVN from the command line nav: blog slug: checkout-specific-revision-svn-command-line tags: - - svn - - version-control + - svn + - version-control --- If you're checking out the repository for the first time: - svn checkout -r 1234 url://repository/path + svn checkout -r 1234 url://repository/path If you already have the repository checked out: - svn up -r 1234 \ No newline at end of file + svn up -r 1234 \ No newline at end of file diff --git a/source/_posts/2012-05-23-date-popup-custom-form.md b/source/_posts/2012-05-23-date-popup-custom-form.md index e3edf6a1..72843a93 100644 --- a/source/_posts/2012-05-23-date-popup-custom-form.md +++ b/source/_posts/2012-05-23-date-popup-custom-form.md @@ -3,34 +3,34 @@ title: How to add a date popup calendar onto a custom form nav: blog slug: add-date-popup-calendar-custom-form tags: - - forms - - form-api - - date - - calendar - - drupal-7 - - drupal-planet - - drupal + - forms + - form-api + - date + - calendar + - drupal-7 + - drupal-planet + - drupal --- First, I need to download the [Date](http://drupal.org/project/date "Date module on Drupal.org") module, and make my module dependent on date_popup by adding the following line into my module's .info file. - dependencies[] = date_popup + dependencies[] = date_popup Within my form builder function: ~~~php $form['date'] = array( - '#title' => t('Arrival date'), + '#title' => t('Arrival date'), - // Provided by the date_popup module - '#type' => 'date_popup', + // Provided by the date_popup module + '#type' => 'date_popup', - // Uses the PHP date() format - http://php.net/manual/en/function.date.php - '#date_format' => 'j F Y', + // Uses the PHP date() format - http://php.net/manual/en/function.date.php + '#date_format' => 'j F Y', - // Limits the year range to the next two upcoming years - '#date_year_range' => '0:+2', + // Limits the year range to the next two upcoming years + '#date_year_range' => '0:+2', - // Default value must be in 'Y-m-d' format. - '#default_value' => date('Y-m-d', time()), + // Default value must be in 'Y-m-d' format. + '#default_value' => date('Y-m-d', time()), ); ~~~ \ No newline at end of file diff --git a/source/_posts/2012-05-23-forward-domain-mod-rewrite.md b/source/_posts/2012-05-23-forward-domain-mod-rewrite.md index 7cb3ee49..8a22d477 100644 --- a/source/_posts/2012-05-23-forward-domain-mod-rewrite.md +++ b/source/_posts/2012-05-23-forward-domain-mod-rewrite.md @@ -3,23 +3,23 @@ title: Forward one domain to another using mod_rewrite and .htaccess nav: blog slug: forward-one-domain-another-using-modrewrite-and-htaccess tags: - - .htaccess - - code - - drupal - - apache - - mod_rewrite + - .htaccess + - code + - drupal + - apache + - mod_rewrite --- Within the mod_rewrite section of your .htaccess file, add the following lines: - RewriteCond %{HTTP_HOST} ^yoursite\.co\.uk$ - RewriteRule (.*) http://yoursite.com/$1 [R=301,L] + RewriteCond %{HTTP_HOST} ^yoursite\.co\.uk$ + RewriteRule (.*) http://yoursite.com/$1 [R=301,L] This automatically forwards any users from http://yoursite.co.uk to http://yoursite.com. This can also be used to forward multiple domains: - RewriteCond %{HTTP_HOST} ^yoursite\.co\.uk$ [OR] - RewriteCond %{HTTP_HOST} ^yoursite\.info$ [OR] - RewriteCond %{HTTP_HOST} ^yoursite\.biz$ [OR] - RewriteCond %{HTTP_HOST} ^yoursite\.eu$ - RewriteRule (.*) http://yoursite.com/$1 [R=301,L] + RewriteCond %{HTTP_HOST} ^yoursite\.co\.uk$ [OR] + RewriteCond %{HTTP_HOST} ^yoursite\.info$ [OR] + RewriteCond %{HTTP_HOST} ^yoursite\.biz$ [OR] + RewriteCond %{HTTP_HOST} ^yoursite\.eu$ + RewriteRule (.*) http://yoursite.com/$1 [R=301,L] If any of the RewriteCond conditions apply, then the RewriteRule is executed. \ No newline at end of file diff --git a/source/_posts/2012-05-23-info-file-drupal-7-theme.md b/source/_posts/2012-05-23-info-file-drupal-7-theme.md index 43728400..7eae94b0 100644 --- a/source/_posts/2012-05-23-info-file-drupal-7-theme.md +++ b/source/_posts/2012-05-23-info-file-drupal-7-theme.md @@ -3,10 +3,10 @@ title: Writing a .info file for a Drupal 7 theme nav: blog slug: writing-info-file-drupal-7-theme tags: - - theming - - drupal-theming - - drupal - - code + - theming + - drupal-theming + - drupal + - code --- ~~~ name = My Theme diff --git a/source/_posts/2012-05-24-dividing-drupals-process-and-preprocess-functions.md b/source/_posts/2012-05-24-dividing-drupals-process-and-preprocess-functions.md index 02b65010..421b0fa9 100644 --- a/source/_posts/2012-05-24-dividing-drupals-process-and-preprocess-functions.md +++ b/source/_posts/2012-05-24-dividing-drupals-process-and-preprocess-functions.md @@ -4,10 +4,10 @@ nav: blog description: If you use a lot of process and preprocess functions within your Drupal theme, then your template.php can get very long and it can become difficult to find a certain piece of code. Following the example of the Omega theme, I've started separating my process and preprocess functions into their own files. slug: dividing-drupals-process-and-preprocess-functions-separate-files tags: - - drupal - - code - - theming - - preprocessing + - drupal + - code + - theming + - preprocessing --- If you use a lot of process and preprocess functions within your Drupal theme, then your template.php can get very long and it can become difficult to find a certain piece of code. Following the example of the [Omega theme](http://drupal.org/project/omega "The Omega theme on Drupal.org"), I've started separating my process and preprocess functions into their own files. For example, mytheme_preprocess_node can be placed within a preprocess/node.inc file, and mytheme_process_page can be placed within process/page.inc. @@ -22,7 +22,7 @@ The first step is to use the default mytheme_process() and mytheme_preprocess() * Initialises the mytheme_invoke() function for the preprocess hook. */ function mytheme_preprocess(&$variables, $hook) { - mytheme_invoke('preprocess', $hook, $variables); + mytheme_invoke('preprocess', $hook, $variables); } /** @@ -31,7 +31,7 @@ function mytheme_preprocess(&$variables, $hook) { * Initialises the mytheme_invoke() function for the process hook. */ function mytheme_process(&$variables, $hook) { - mytheme_invoke('process', $hook, $variables); + mytheme_invoke('process', $hook, $variables); } ~~~ @@ -44,39 +44,39 @@ Now, to write the `mytheme_invoke()` function: * Invokes custom process and preprocess functions. * * @param string $type - * The type of function we are trying to include (i.e. process or preprocess). + * The type of function we are trying to include (i.e. process or preprocess). * * @param array $variables - * The variables array. + * The variables array. * * @param string $hook - * The name of the hook. - * - * @see mytheme_preprocess() + * The name of the hook. + * + * @see mytheme_preprocess() * @see mytheme_process() */ function mytheme_invoke($type, $hook, &$variables) { - global $theme_key; - - // The name of the function to look for (e.g. mytheme_process_node). - $function = $theme_key . '_' . $type . '_' . $hook; + global $theme_key; + + // The name of the function to look for (e.g. mytheme_process_node). + $function = $theme_key . '_' . $type . '_' . $hook; - // If the function doesn't exist within template.php, look for the - // appropriate include file. - if (!function_exists($function)) { - // The file to search for (e.g. process/node.inc). - $file = drupal_get_path('theme', $theme_key) . '/' . $type . '/' . $type . '-' . str_replace('_', '-', $hook) . '.inc'; + // If the function doesn't exist within template.php, look for the + // appropriate include file. + if (!function_exists($function)) { + // The file to search for (e.g. process/node.inc). + $file = drupal_get_path('theme', $theme_key) . '/' . $type . '/' . $type . '-' . str_replace('_', '-', $hook) . '.inc'; - // If the file exists, include it. - if (is_file($file)) { - include($file); - } + // If the file exists, include it. + if (is_file($file)) { + include($file); } + } - // Try to call the function again. - if (function_exists($function)) { - $function($variables); - } + // Try to call the function again. + if (function_exists($function)) { + $function($variables); + } } ~~~ diff --git a/source/_posts/2012-07-12-my-new-drupal-modules.md b/source/_posts/2012-07-12-my-new-drupal-modules.md index fbf3820f..b784f16b 100644 --- a/source/_posts/2012-07-12-my-new-drupal-modules.md +++ b/source/_posts/2012-07-12-my-new-drupal-modules.md @@ -3,12 +3,12 @@ title: My new Drupal modules nav: blog description: After a busy few days, I've released two new contrib Drupal modules. tags: - - drupal - - drupal-modules - - drupal-6 - - drupal-7 - - drupal-planet - - accessibility + - drupal + - drupal-modules + - drupal-6 + - drupal-7 + - drupal-planet + - accessibility --- After a busy few days, I've released two new contrib Drupal modules: diff --git a/source/_posts/2012-07-14-install-nomensa-media-player-drupal.md b/source/_posts/2012-07-14-install-nomensa-media-player-drupal.md index 7da73df9..37f7eb1b 100644 --- a/source/_posts/2012-07-14-install-nomensa-media-player-drupal.md +++ b/source/_posts/2012-07-14-install-nomensa-media-player-drupal.md @@ -3,10 +3,10 @@ title: Install and Configure the Nomensa Accessible Media Player in Drupal nav: blog slug: install-nomensa-media-player-drupal tags: - - accessibility - - drupal - - drupal-planet - - nomensa + - accessibility + - drupal + - drupal-planet + - nomensa --- *The official documentation for this module is now located at . This post was accurate at the time of writing, whereas the documentation page will be kept up to date with any future changes.* @@ -36,11 +36,11 @@ Within your content add links to your videos. For example: ### YouTube - Checking colour contrast + Checking colour contrast ### Vimeo - Screen readers are strange, when you're a stranger by Leonie Watson + Screen readers are strange, when you're a stranger by Leonie Watson ## Adding captions @@ -51,8 +51,8 @@ The best way that I can suggest to do this is to use a File field to upload your 3. Right-click the uploaded file, copy the link location, and use this for the path to your captions file. For example: - - Checking colour contrast Captions for Checking Colour Contrast + + Checking colour contrast Captions for Checking Colour Contrast ## Screencast diff --git a/source/_posts/2012-07-27-linux-journal.md b/source/_posts/2012-07-27-linux-journal.md index 1b1fa42d..52e65ce9 100644 --- a/source/_posts/2012-07-27-linux-journal.md +++ b/source/_posts/2012-07-27-linux-journal.md @@ -4,11 +4,11 @@ nav: blog description: I'm absolutely delighted to announce that I'm going to be writing an article for Linux Journal magazine's upcoming Drupal special. slug: writing-article-linux-journal tags: - - drupal - - distributions - - installation-profiles - - writing - - linux-journal + - drupal + - distributions + - installation-profiles + - writing + - linux-journal --- I'm absolutely delighted to announce that I'm going to be writing an article for [Linux Journal](http://www.linuxjournal.com) magazine's upcoming Drupal special. The article is going to be entitled "Speeding Up Your Drupal Development Using Installation Profiles and Distributions" and will be mentioning existing distributions available on Drupal.org, but mainly focussing on the steps needed to create your own custom distribution. Needless to say, I'm quite excited about it! diff --git a/source/_posts/2012-08-18-display-custom-menu-drupal-7-theme-template-file.md b/source/_posts/2012-08-18-display-custom-menu-drupal-7-theme-template-file.md index e81f42bd..56a9c466 100644 --- a/source/_posts/2012-08-18-display-custom-menu-drupal-7-theme-template-file.md +++ b/source/_posts/2012-08-18-display-custom-menu-drupal-7-theme-template-file.md @@ -4,11 +4,11 @@ nav: blog description: For reference, this is the code needed to display a menu in a Drupal 7 template file. slug: display-custom-menu-drupal-7-theme-template-file tags: - - drupal - - drupal-7 - - drupal-planet - - php - - aria + - drupal + - drupal-7 + - drupal-planet + - php + - aria --- For reference, this is the code needed to display a menu in a Drupal 7 template file, including the navigation ARIA role. @@ -16,11 +16,11 @@ For reference, this is the code needed to display a menu in a Drupal 7 template $menu_name = 'menu-footer-menu'; $menu_id = 'footer-menu'; print theme('links', array( - 'links' => menu_navigation_links($menu_name), - 'attributes' => array( - 'id' => $menu_id, - 'role' => 'navigation', - 'class'=> array('links', 'inline') - ) + 'links' => menu_navigation_links($menu_name), + 'attributes' => array( + 'id' => $menu_id, + 'role' => 'navigation', + 'class'=> array('links', 'inline') + ) )); ~~~ diff --git a/source/_posts/2012-09-06-reflections-speaking-unifieddiff.md b/source/_posts/2012-09-06-reflections-speaking-unifieddiff.md index 502c6c88..8d841d4c 100644 --- a/source/_posts/2012-09-06-reflections-speaking-unifieddiff.md +++ b/source/_posts/2012-09-06-reflections-speaking-unifieddiff.md @@ -4,7 +4,7 @@ nav: blog description: Yesterday evening I went to and spoke at the UnifiedDiff meetup in Cardiff, having offered previously to do a presentation providing an introduction to Drupal. slug: reflections-speaking-unifieddiff tags: - - talks + - talks --- Yesterday evening I went along and spoke at the [UnifiedDiff meetup](http://www.unifieddiff.co.uk) in Cardiff, having offered previously to do a presentation providing an introduction to Drupal. diff --git a/source/_posts/2012-10-25-my-sublime-text-2-settings.md b/source/_posts/2012-10-25-my-sublime-text-2-settings.md index 64e10924..c142ec6e 100644 --- a/source/_posts/2012-10-25-my-sublime-text-2-settings.md +++ b/source/_posts/2012-10-25-my-sublime-text-2-settings.md @@ -3,7 +3,7 @@ title: My Sublime Text 2 settings nav: blog description: Sublime Text 2 has been my text editor of choice for the past few months, and I use it at home, in work, and on any virtual machines that I run. So rather than having to manually re-enter my settings each time, I thought that I'd document them here for future reference. tags: - - sublime-text + - sublime-text --- [Sublime Text 2](http://www.sublimetext.com/2) has been my text editor of choice for the past few months, and I use it at home, in work, and on any virtual machines that I run. So rather than having to manually re-enter my settings each time, I thought that I'd document them here for future reference. These preferences ensure that the code is compliant with [Drupal coding standards](http://drupal.org/coding-standards "Drupal coding standards on Drupal.org") - using two spaces instead of a tab, no trailing whitespace, blank line at the end of a file etc. @@ -13,64 +13,64 @@ These can be changed by going to Preferences > Settings - User. ~~~ { - "color_scheme": "Packages/Theme - Aqua/Color Schemes/Tomorrow Night Aqua.tmTheme", - "default_line_ending": "unix", - "ensure_newline_at_eof_on_save": true, - "fallback_encoding": "UTF-8", - "file_exclude_patterns": - [ - "*.pyc", - "*.pyo", - "*.exe", - "*.dll", - "*.obj", - "*.o", - "*.a", - "*.lib", - "*.so", - "*.dylib", - "*.ncb", - "*.sdf", - "*.suo", - "*.pdb", - "*.idb", - ".DS_Store", - "*.class", - "*.psd", - "*.db", - "*.sublime*" - ], - "folder_exclude_patterns": - [ - ".svn", - ".git", - ".hg", - "CVS", - "FirePHPCore" - ], - "font_options": - [ - "no_bold", - "no_italic" - ], - "font_size": 16.0, - "highlight_line": true, - "ignored_packages": - [ - ], - "line_padding_bottom": 1, - "rulers": - [ - 80 - ], - "save_on_focus_lost": true, - "shift_tab_unindent": true, - "tab_size": 2, - "theme": "Soda Light.sublime-theme", - "translate_tabs_to_spaces": true, - "trim_automatic_white_space": true, - "trim_trailing_white_space_on_save": true, - "word_wrap": false + "color_scheme": "Packages/Theme - Aqua/Color Schemes/Tomorrow Night Aqua.tmTheme", + "default_line_ending": "unix", + "ensure_newline_at_eof_on_save": true, + "fallback_encoding": "UTF-8", + "file_exclude_patterns": + [ + "*.pyc", + "*.pyo", + "*.exe", + "*.dll", + "*.obj", + "*.o", + "*.a", + "*.lib", + "*.so", + "*.dylib", + "*.ncb", + "*.sdf", + "*.suo", + "*.pdb", + "*.idb", + ".DS_Store", + "*.class", + "*.psd", + "*.db", + "*.sublime*" + ], + "folder_exclude_patterns": + [ + ".svn", + ".git", + ".hg", + "CVS", + "FirePHPCore" + ], + "font_options": + [ + "no_bold", + "no_italic" + ], + "font_size": 16.0, + "highlight_line": true, + "ignored_packages": + [ + ], + "line_padding_bottom": 1, + "rulers": + [ + 80 + ], + "save_on_focus_lost": true, + "shift_tab_unindent": true, + "tab_size": 2, + "theme": "Soda Light.sublime-theme", + "translate_tabs_to_spaces": true, + "trim_automatic_white_space": true, + "trim_trailing_white_space_on_save": true, + "word_wrap": false } ~~~ @@ -80,8 +80,8 @@ These can be changed by going to Preferences > Key Bindings - User. ~~~ [ - { "keys": ["alt+s"], "command": "toggle_side_bar" }, - { "keys": ["alt+r"], "command": "reindent" } + { "keys": ["alt+s"], "command": "toggle_side_bar" }, + { "keys": ["alt+r"], "command": "reindent" } ] ~~~ diff --git a/source/_posts/2012-11-15-accessible-bristol-site.md b/source/_posts/2012-11-15-accessible-bristol-site.md index c49a0f85..b9248ef4 100644 --- a/source/_posts/2012-11-15-accessible-bristol-site.md +++ b/source/_posts/2012-11-15-accessible-bristol-site.md @@ -3,9 +3,9 @@ title: Accessible Bristol site launched nav: blog description: I'm happy to report that the Accessible Bristol was launched this week, on Drupal 7. tags: - - accessibility - - accessible-bristol - - nomensa + - accessibility + - accessible-bristol + - nomensa --- I'm happy to report that the [Accessible Bristol](http://www.accessiblebristol.org.uk) website was launched this week, on Drupal 7. The site's been developed over the past few months, and uses the [User Relationships](http://drupal.org/project/user_relationships) and [Privatemsg](http://drupal.org/project/privatemsg) modules to provide a community-based platform where people with an interest in accessibility can register and network with each other. diff --git a/source/_posts/2012-11-17-open-sublime-text-2-mac-os-x-command-line.md b/source/_posts/2012-11-17-open-sublime-text-2-mac-os-x-command-line.md index 91d54a4b..fb9b5406 100644 --- a/source/_posts/2012-11-17-open-sublime-text-2-mac-os-x-command-line.md +++ b/source/_posts/2012-11-17-open-sublime-text-2-mac-os-x-command-line.md @@ -3,13 +3,13 @@ title: Open Sublime Text 2 from the Mac OS X Command Line nav: blog slug: open-sublime-text-2-mac-os-x-command-line tags: - - sublime-text - - mac-os-x - - terminal + - sublime-text + - mac-os-x + - terminal --- Paste the following code into the Mac OS X Terminal, assuming that you've installed Sublime Text 2 into the /Applications folder. - $ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/sublime + $ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/sublime Now you can type `sublime ` open a file or directory in Sublime Text, or `sublime .` to open the current directory. diff --git a/source/_posts/2012-12-06-use-sass-and-compass-drupal-7-using-sassy.md b/source/_posts/2012-12-06-use-sass-and-compass-drupal-7-using-sassy.md index 460a799a..641c5271 100644 --- a/source/_posts/2012-12-06-use-sass-and-compass-drupal-7-using-sassy.md +++ b/source/_posts/2012-12-06-use-sass-and-compass-drupal-7-using-sassy.md @@ -3,14 +3,14 @@ title: How to use SASS and Compass in Drupal 7 using Sassy nav: blog slug: use-sass-and-compass-drupal-7-using-sassy tags: - - compass - - css - - drupal - - drupal-7 - - drupal-planet - - less - - preprocessing - - sass + - compass + - css + - drupal + - drupal-7 + - drupal-planet + - less + - preprocessing + - sass --- I've recently started using [SASS](http://sass-lang.com) rather than LESS to do my CSS preprocessing - namely due to its integration with [Compass](http://compass-style.org) and it's built-in CSS3 mixins. There are three modules that provide the ability to use SASS within Drupal: @@ -24,17 +24,17 @@ Alternatively, you could use a base theme like [Sasson](http://drupal.org/projec The first thing to do is download the PHPSass library from [GitHub](https://github.com/richthegeek/phpsass "PHPSass on GitHub"), as this is a requirement of the Sassy module and we can't enable it without the library. So, in a Terminal window: - $ mkdir -p sites/all/libraries; - $ cd sites/all/libraries; - $ wget https://github.com/richthegeek/phpsass/archive/master.tar.gz; - $ tar zxf master.tar.gz; - $ rm master.tar.gz; - $ mv phpsass-master/ phpsass + $ mkdir -p sites/all/libraries; + $ cd sites/all/libraries; + $ wget https://github.com/richthegeek/phpsass/archive/master.tar.gz; + $ tar zxf master.tar.gz; + $ rm master.tar.gz; + $ mv phpsass-master/ phpsass Or, if you're using Drush Make files: - libraries[phpsass][download][type] = "get" - libraries[phpsass][download][url] = "https://github.com/richthegeek/phpsass/archive/master.tar.gz" + libraries[phpsass][download][type] = "get" + libraries[phpsass][download][url] = "https://github.com/richthegeek/phpsass/archive/master.tar.gz" The PHPSass library should now be located at `sites/all/libraries/phpsass`. @@ -42,8 +42,8 @@ The PHPSass library should now be located at `sites/all/libraries/phpsass`. This is easy if you use [Drush](http://drupal.org/project/drush): - $ drush dl libraries prepro sassy - $ drush en -y libraries prepro sassy sassy_compass + $ drush dl libraries prepro sassy + $ drush en -y libraries prepro sassy sassy_compass Otherwise, download the each module from it's respective project page and place it within your `sites/all/modules` or `sites/all/modules/contrib` directory. diff --git a/source/_posts/2013-01-09-checking-if-user-logged-drupal-right-way.md b/source/_posts/2013-01-09-checking-if-user-logged-drupal-right-way.md index fddcd5b9..3971c05a 100644 --- a/source/_posts/2013-01-09-checking-if-user-logged-drupal-right-way.md +++ b/source/_posts/2013-01-09-checking-if-user-logged-drupal-right-way.md @@ -4,18 +4,18 @@ nav: blog description: How to check if a user is logged into Drupal by using the user_is_logged_in() and user_is_anonymous() functions. slug: checking-if-user-logged-drupal-right-way tags: - - drupal - - drupal-6 - - drupal-7 - - drupal-planet - - php + - drupal + - drupal-6 + - drupal-7 + - drupal-planet + - php --- I see this regularly when working on Drupal sites when someone wants to check whether the current user is logged in to Drupal (authenticated) or not (anonymous): ~~~~ global $user; if ($user->uid) { - // The user is logged in. + // The user is logged in. } ~~~~ @@ -24,7 +24,7 @@ or ~~~~ global $user; if (!$user->uid) { - // The user is not logged in. + // The user is not logged in. } ~~~~ @@ -32,7 +32,7 @@ The better way to do this is to use the [user_is_logged_in()](http://api.drupal. ~~~~ if (user_is_logged_in()) { - // Do something. + // Do something. } ~~~~ @@ -45,13 +45,13 @@ A great use case for this is within a `hook_menu()` implementation within a cust * Implements hook_menu(). */ function mymodule_menu() { - $items['foo'] = array( - 'title' => 'Foo', - 'page callback' => 'mymodule_foo', - 'access callback' => 'user_is_logged_in', - ); + $items['foo'] = array( + 'title' => 'Foo', + 'page callback' => 'mymodule_foo', + 'access callback' => 'user_is_logged_in', + ); - return $items; + return $items; } ~~~~ diff --git a/source/_posts/2013-02-16-creating-and-using-custom-tokens-drupal-7.md b/source/_posts/2013-02-16-creating-and-using-custom-tokens-drupal-7.md index 4fb7ad46..daa01d76 100644 --- a/source/_posts/2013-02-16-creating-and-using-custom-tokens-drupal-7.md +++ b/source/_posts/2013-02-16-creating-and-using-custom-tokens-drupal-7.md @@ -3,10 +3,10 @@ title: Creating and using custom tokens in Drupal 7 nav: blog slug: creating-and-using-custom-tokens-drupal-7 tags: - - drupal - - drupal-planet - - drupal-7 - - tokens + - drupal + - drupal-planet + - drupal-7 + - tokens --- This post outlines the steps required to create your own custom tokens in Drupal. @@ -32,13 +32,13 @@ The first thing that we need to do is define the new token type and/or the token * Implements hook_token_info(). */ function foo_token_info() { - $info = array(); + $info = array(); - // Add any new tokens. - $info['tokens']['foo']['bar'] = t('This is my new bar token within the foo type.'); + // Add any new tokens. + $info['tokens']['foo']['bar'] = t('This is my new bar token within the foo type.'); - // Return them. - return $info; + // Return them. + return $info; } ~~~ @@ -55,12 +55,12 @@ Now that the Token module is aware of our new token, we now need to determine wh * Implements hook_tokens(). */ function foo_tokens($type, $tokens, array $data = array(), array $options = array()) { - $replacements = array(); + $replacements = array(); - // Code goes here... + // Code goes here... - // Return the replacements. - return $replacements; + // Return the replacements. + return $replacements; } ~~~ @@ -71,29 +71,29 @@ The first thing to check for is the type of token using an `if()` function, as t * Implements hook_tokens(). */ function foo_tokens($type, $tokens, array $data = array(), array $options = array()) { - $replacements = array(); + $replacements = array(); - // The first thing that we're going to check for is the type of token - node, - // user etc... - if ($type == 'foo') { - // Loop through each of the available tokens. - foreach ($tokens as $name => $original) { - // Find the desired token by name - switch ($name) { - case 'bar': - $new = ''; + // The first thing that we're going to check for is the type of token - node, + // user etc... + if ($type == 'foo') { + // Loop through each of the available tokens. + foreach ($tokens as $name => $original) { + // Find the desired token by name + switch ($name) { + case 'bar': + $new = ''; - // Work out the value of $new... + // Work out the value of $new... - // Add the new value into the replacements array. - $replacements[$original] = $new; - break; - } - } + // Add the new value into the replacements array. + $replacements[$original] = $new; + break; + } } + } - // Return the replacements. - return $replacements; + // Return the replacements. + return $replacements; } ~~~ @@ -106,22 +106,22 @@ An example from Copyright Block module: * Implements hook_tokens(). */ function copyright_block_tokens($type, $tokens, array $data = array(), array $options = array()) { - $replacements = array(); + $replacements = array(); - if ($type == 'copyright_statement') { - foreach ($tokens as $name => $original) { - switch ($name) { - case 'dates': - $start_year = variable_get('copyright_block_start_year', date('Y')); - $current_year = date('Y'); + if ($type == 'copyright_statement') { + foreach ($tokens as $name => $original) { + switch ($name) { + case 'dates': + $start_year = variable_get('copyright_block_start_year', date('Y')); + $current_year = date('Y'); - $replacements[$original] = $start_year < $current_year ? $start_year . '-' . $current_year : $start_year; - break; - } - } + $replacements[$original] = $start_year < $current_year ? $start_year . '-' . $current_year : $start_year; + break; + } } + } - return $replacements; + return $replacements; } ~~~ diff --git a/source/_posts/2013-03-02-quickest-way-install-sublime-text-2-ubuntu.md b/source/_posts/2013-03-02-quickest-way-install-sublime-text-2-ubuntu.md index 8c796ea2..892110d7 100644 --- a/source/_posts/2013-03-02-quickest-way-install-sublime-text-2-ubuntu.md +++ b/source/_posts/2013-03-02-quickest-way-install-sublime-text-2-ubuntu.md @@ -3,14 +3,14 @@ title: The Quickest way to Install Sublime Text 2 in Ubuntu nav: blog slug: quickest-way-install-sublime-text-2-ubuntu tags: - - linux - - sublime-text - - ubuntu + - linux + - sublime-text + - ubuntu --- After reading numerous blog posts about how to install [Sublime Text 2](http://www.sublimetext.com/2 "Sublime Text 2") in [Ubuntu](http://www.ubuntu.com/2 "Ubuntu"), this is definitely the quickest way! Just paste the following lines into your Terminal: - $ sudo add-apt-repository ppa:webupd8team/sublime-text-2 - $ sudo apt-get update - $ sudo apt-get install sublime-text + $ sudo add-apt-repository ppa:webupd8team/sublime-text-2 + $ sudo apt-get update + $ sudo apt-get install sublime-text After running this, Sublime Text 2 has been installed within the */usr/lib/sublime-text-2* directory and can be launched from the Dashboard, or by typing `subl`, `sublime-text` or `sublime-text-2` into a Terminal window. \ No newline at end of file diff --git a/source/_posts/2013-04-20-leaving-nomensa-joining-precedent.md b/source/_posts/2013-04-20-leaving-nomensa-joining-precedent.md index e32f172d..a0a2cadb 100644 --- a/source/_posts/2013-04-20-leaving-nomensa-joining-precedent.md +++ b/source/_posts/2013-04-20-leaving-nomensa-joining-precedent.md @@ -3,9 +3,9 @@ title: Leaving Nomensa, Joining Precedent nav: blog description: Yesterday was my last day working at Nomensa. Next week, I'll be starting as a Senior Developer at Precedent. tags: - - nomensa - - precedent - - personal + - nomensa + - precedent + - personal --- Yesterday was my last day working at [Nomensa](http://www.nomensa.com "Nomensa"). Next week, I'll be starting as a Senior Developer at [Precedent](http://www.precedent.co.uk "Precedent"). diff --git a/source/_posts/2013-04-27-display-git-branch-or-tag-names-your-bash-prompt.md b/source/_posts/2013-04-27-display-git-branch-or-tag-names-your-bash-prompt.md index 0751aced..968ba472 100644 --- a/source/_posts/2013-04-27-display-git-branch-or-tag-names-your-bash-prompt.md +++ b/source/_posts/2013-04-27-display-git-branch-or-tag-names-your-bash-prompt.md @@ -4,10 +4,10 @@ nav: blog description: Whilst watching Drupalize.me's recent Introduction to Git series, I thought it was useful the way that the current Git branch or tag name was displayed in the bash prompt. Here's how to do it. slug: display-git-branch-or-tag-names-your-bash-prompt tags: - - drupal - - drupal-planet - - git - - terminal + - drupal + - drupal-planet + - git + - terminal --- Whilst watching [Drupalize.me](http://drupalize.me "Drupalize.me")'s recent [Introduction to Git series](http://drupalize.me/series/introduction-git-series "Introduction to Git on Drupalize.me"), I thought it was useful the way that the current Git branch or tag name was displayed in the bash prompt. @@ -22,33 +22,33 @@ Here's how to do it. To begin with, create a new file to contain the functions, - vim ~/.bash/git-prompt + vim ~/.bash/git-prompt Paste the following code into the file, and save it. ~~~~ parse_git_branch () { - git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' + git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } parse_git_tag () { - git describe --tags 2> /dev/null + git describe --tags 2> /dev/null } parse_git_branch_or_tag() { - local OUT="$(parse_git_branch)" - if [ "$OUT" == " ((no branch))" ]; then - OUT="($(parse_git_tag))"; - fi - echo $OUT + local OUT="$(parse_git_branch)" + if [ "$OUT" == " ((no branch))" ]; then + OUT="($(parse_git_tag))"; + fi + echo $OUT } ~~~~ Edit your `.bashrc` or `.bash_profile` file to override the PS1 value. - vim ~/.bashrc + vim ~/.bashrc -Add the following code at the bottom of the file, and save it. +Add the following code at the bottom of the file, and save it. ~~~~ source ~/.bash/git-prompt diff --git a/source/_posts/2013-06-13-some-useful-links-using-simpletest-drupal.md b/source/_posts/2013-06-13-some-useful-links-using-simpletest-drupal.md index 1d456152..01ae28a4 100644 --- a/source/_posts/2013-06-13-some-useful-links-using-simpletest-drupal.md +++ b/source/_posts/2013-06-13-some-useful-links-using-simpletest-drupal.md @@ -3,11 +3,11 @@ title: Some useful links for using SimpleTest in Drupal nav: blog slug: some-useful-links-using-simpletest-drupal tags: - - simpletest - - tdd - - test-driven-development - - drupal-planet - - drupal + - simpletest + - tdd + - test-driven-development + - drupal-planet + - drupal --- Here are some useful links that I've found when researching about unit testing in Drupal using SimpleTest: diff --git a/source/_posts/2013-07-17-creating-local-and-staging-sites-drupals-domain-module-enabled.md b/source/_posts/2013-07-17-creating-local-and-staging-sites-drupals-domain-module-enabled.md index 195b7af6..af2a33e0 100644 --- a/source/_posts/2013-07-17-creating-local-and-staging-sites-drupals-domain-module-enabled.md +++ b/source/_posts/2013-07-17-creating-local-and-staging-sites-drupals-domain-module-enabled.md @@ -3,11 +3,11 @@ title: Creating Local and Staging sites with Drupal's Domain Module Enabled nav: blog slug: creating-local-and-staging-sites-drupals-domain-module-enabled tags: - - drupal - - drupal-planet - - databases - - domain - - table-prefixing + - drupal + - drupal-planet + - databases + - domain + - table-prefixing --- The [Domain Access project](https://drupal.org/project/domain "The Domain Access project on Drupal.org") is a suite of modules that provide tools for running a group of affiliated sites from one Drupal installation and a single shared database. The issue is that the domains are stored within the database so these are copied across when the data is migrated between environments, whereas the domains are obviously going to change. @@ -23,16 +23,16 @@ Within each site's settings.php file, define the prefix for the domain table wit ~~~~php $databases['default']['default'] = array( - 'driver' => 'mysql', - 'database' => 'foobar', - 'username' => 'foo', - 'password' => 'bar', - 'host' => 'localhost', - 'prefix' => array( - 'default' => '', - 'domain' => 'local_', // This will use the local_domain table. - // Add any other prefixed tables here. - ), + 'driver' => 'mysql', + 'database' => 'foobar', + 'username' => 'foo', + 'password' => 'bar', + 'host' => 'localhost', + 'prefix' => array( + 'default' => '', + 'domain' => 'local_', // This will use the local_domain table. + // Add any other prefixed tables here. + ), ); ~~~~ diff --git a/source/_posts/2013-07-26-going-to-drupalcon.md b/source/_posts/2013-07-26-going-to-drupalcon.md index 39a2a9ad..70be05d1 100644 --- a/source/_posts/2013-07-26-going-to-drupalcon.md +++ b/source/_posts/2013-07-26-going-to-drupalcon.md @@ -3,8 +3,8 @@ title: Going to DrupalCon nav: blog slug: going-drupalcon tags: - - drupalcon - - precedent + - drupalcon + - precedent --- [Precedent](http://www.precedent.co.uk) are sending myself and two of our other Drupal Developers to [Drupalcon Prague](http://prague2013.drupal.org). diff --git a/source/_posts/2013-09-06-create-zen-sub-theme-using-drush.md b/source/_posts/2013-09-06-create-zen-sub-theme-using-drush.md index ba5a5a9a..3a79cd7d 100644 --- a/source/_posts/2013-09-06-create-zen-sub-theme-using-drush.md +++ b/source/_posts/2013-09-06-create-zen-sub-theme-using-drush.md @@ -3,19 +3,19 @@ title: Create a Zen Sub-theme Using Drush nav: blog description: How to quickly create a Zen sub-theme using Drush. tags: - - drupal - - drupal-planet - - drush - - zen - - theming + - drupal + - drupal-planet + - drush + - zen + - theming --- First, download the [Zen](https://drupal.org/project/zen "The Zen theme") theme if you haven't already done so. - $ drush dl zen + $ drush dl zen This will now enable you to use the "drush zen" command. - $ drush zen "Oliver Davies" oliverdavies --description="A Zen sub-theme for oliverdavies.co.uk" --without-rtl + $ drush zen "Oliver Davies" oliverdavies --description="A Zen sub-theme for oliverdavies.co.uk" --without-rtl The parameters that I'm passing it are: diff --git a/source/_posts/2013-11-19-dont-bootstrap-drupal-use-drush.md b/source/_posts/2013-11-19-dont-bootstrap-drupal-use-drush.md index 1b6be34b..3e6244f1 100644 --- a/source/_posts/2013-11-19-dont-bootstrap-drupal-use-drush.md +++ b/source/_posts/2013-11-19-dont-bootstrap-drupal-use-drush.md @@ -2,9 +2,9 @@ title: Don't Bootstrap Drupal, Use Drush nav: blog tags: - - drush - - drupal-planet - - php + - drush + - drupal-planet + - php --- There are times when doing Drupal development when you need to run a custom PHP script, maybe moving data from one field to another, that doesn't warrant the time and effort to create a custom module. In this scenario, it would be quicker to write a .php script and bootstrap Drupal to gain access to functions like `node_load()` and `db_query()`. @@ -25,7 +25,7 @@ $node = node_load(1); The script would need be placed in the root of your Drupal directory, and you would then have had to open a browser window and visit http://example.com/foo.php to execute it. This is where the "drush php-script" command (or "drush scr" for short) is useful, and can be used to execute the script from the command line. - $ drush scr foo.php + $ drush scr foo.php It also means that I no longer need to manually bootstrap Drupal, so my script is much cleaner. @@ -38,10 +38,10 @@ $node = node_load(1); I prefer to keep these scripts outside of my Drupal directory in a separate "scripts" directory (with Drupal in a "drupal" directory on the same level). This makes it easier to update Drupal as I don't need to worry about accidentally deleting the additional files. From within the drupal directory, I can now run the following command to go up one level, into the scripts directory and then execute the script. Note that you do not need to include the file extension. - $ drush scr ../scripts/foo + $ drush scr ../scripts/foo Or, if you're using [Drush aliases](http://deeson-online.co.uk/labs/drupal-drush-aliases-and-how-use-them "Drupal, Drush aliases, and how to use them"): - $ drush @mysite.local scr foo + $ drush @mysite.local scr foo If you commonly use the same scripts for different projects, you could also store these within a separate Git repository and checkout the scripts directory using a [Git submodule](http://git-scm.com/book/en/Git-Tools-Submodules "Git Submodules"). \ No newline at end of file diff --git a/source/_posts/2013-11-27-useful-vagrant-commands.md b/source/_posts/2013-11-27-useful-vagrant-commands.md index efd128c0..7f23d22c 100644 --- a/source/_posts/2013-11-27-useful-vagrant-commands.md +++ b/source/_posts/2013-11-27-useful-vagrant-commands.md @@ -3,7 +3,7 @@ title: Useful Vagrant Commands nav: blog description: Here are the basic commands that you need to adminster a virtual machine using Vagrant. tags: - - vagrant + - vagrant --- [Vagrant](http://www.vagrantup.com "About Vagrant") is a tool for managing virtual machines within [VirtualBox](https://www.virtualbox.org) from the command line. Here are some useful commands to know when using Vagrant: diff --git a/source/_posts/2013-12-24-quickly-apply-patches-using-git-and-curl-or-wget.md b/source/_posts/2013-12-24-quickly-apply-patches-using-git-and-curl-or-wget.md index 83ec9f8b..c9857d8f 100644 --- a/source/_posts/2013-12-24-quickly-apply-patches-using-git-and-curl-or-wget.md +++ b/source/_posts/2013-12-24-quickly-apply-patches-using-git-and-curl-or-wget.md @@ -3,18 +3,18 @@ title: Quickly Apply Patches Using Git and curl or wget nav: blog description: How to quickly download a patch file and apply it to a Git repository in one line tags: - - git - - drupal-planet + - git + - drupal-planet --- Testing a patch file is usually a two-step process. First you download the patch file from the source, and then you run a separate command to apply it. You can save time and typing by running the two commands on one line: - $ curl http://drupal.org/files/[patch-name].patch | git apply + $ curl http://drupal.org/files/[patch-name].patch | git apply Or, if you don't have curl installed, you can use wget: - $ wget -q -O - http://drupal.org/files/[patch-name].patch | git apply + $ wget -q -O - http://drupal.org/files/[patch-name].patch | git apply These commands need to be run within the root of your Git repository (i.e. where the .git directory is). diff --git a/source/_posts/2013-12-31-download-different-versions-drupal-drush.md b/source/_posts/2013-12-31-download-different-versions-drupal-drush.md index e75202b4..79d1f5ef 100644 --- a/source/_posts/2013-12-31-download-different-versions-drupal-drush.md +++ b/source/_posts/2013-12-31-download-different-versions-drupal-drush.md @@ -4,9 +4,9 @@ nav: blog description: How to download different versions of Drupal core using Drush. slug: download-different-versions-drupal-drush tags: - - drupal - - drupal-planet - - drush + - drupal + - drupal-planet + - drush --- If you use [Drush](https://raw.github.com/drush-ops/drush/master/README.md "About Drush"), it's likely that you've used the `drush pm-download` (or `drush dl` for short) command to start a new project. This command downloads projects from Drupal.org, but if you don't specify a project or type "drush dl drupal", the command will download the current stable version of Drupal core. Currently, this will be Drupal 7 with that being the current stable version of core at the time of writing this post. @@ -16,22 +16,22 @@ I still maintain a number of Drupal 6 sites and occassionally need to download D By declarding the core version of Drupal, such as "drupal-6", Drush will download that instead. - $ drush dl drupal-6 + $ drush dl drupal-6 This downloads the most recent stable version of Drupal 6. If you don't want that, you can add the --select and additionally the --all options to be presented with an entire list to chose from. - $ drush dl drupal-6 --select - $ drush dl drupal-6 --select --all + $ drush dl drupal-6 --select + $ drush dl drupal-6 --select --all If you want the most recent development version, just type: - $ drush dl drupal-6.x + $ drush dl drupal-6.x The same can be done for other core versions of Drupal, from Drupal 5 upwards. - # This will download Drupal 5 - $ drush dl drupal-5 - # This will download Drupal 8 - $ drush dl drupal-8 + # This will download Drupal 5 + $ drush dl drupal-5 + # This will download Drupal 8 + $ drush dl drupal-8 For a full list of the available options, type "drush help pm-download" into a Terminal window or take a look at the entry on [drush.ws](http://drush.ws/#pm-download, "The entry for pm-download on drush.ws"). \ No newline at end of file diff --git a/source/_posts/2014-01-15-some-useful-git-aliases.md b/source/_posts/2014-01-15-some-useful-git-aliases.md index 20c0e7ec..e40443bd 100644 --- a/source/_posts/2014-01-15-some-useful-git-aliases.md +++ b/source/_posts/2014-01-15-some-useful-git-aliases.md @@ -2,7 +2,7 @@ title: Some Useful Git Aliases nav: blog tags: - - git + - git --- Here are some bash aliases that I use and find helpful for quickly writing Git and Git Flow commands. These should be placed within your `~/.bashrc` or `~/.bash_profile` file: diff --git a/source/_posts/2014-02-09-drupalcamp-london-2014.md b/source/_posts/2014-02-09-drupalcamp-london-2014.md index 53833244..79a56609 100644 --- a/source/_posts/2014-02-09-drupalcamp-london-2014.md +++ b/source/_posts/2014-02-09-drupalcamp-london-2014.md @@ -3,10 +3,10 @@ title: DrupalCamp London 2014 nav: blog description: It's all booked, I'm going to be attending DrupalCamp London. tags: - - drupal - - drupalcamp-london - - git - - git-flow + - drupal + - drupalcamp-london + - git + - git-flow --- It's all booked, I'm going to be attending [DrupalCamp London](http://2014.drupalcamplondon.co.uk). diff --git a/source/_posts/2014-03-03-drupalcamp-london-git-flow.md b/source/_posts/2014-03-03-drupalcamp-london-git-flow.md index 8bead3d1..4f07ddb2 100644 --- a/source/_posts/2014-03-03-drupalcamp-london-git-flow.md +++ b/source/_posts/2014-03-03-drupalcamp-london-git-flow.md @@ -4,10 +4,10 @@ nav: blog description: Slides and notes from my talk, "What is Git Flow?", that I presented at DrupalCamp London 2014. slug: what-git-flow tags: - - git - - git-flow - - drupalcamp-london - - talks + - git + - git-flow + - drupalcamp-london + - talks tweets: true --- Here are my slides from my "What is Git Flow?" session at [DrupalCamp London](http://2014.drupalcamplondon.co.uk). diff --git a/source/_posts/2014-05-03-drupal-association.md b/source/_posts/2014-05-03-drupal-association.md index 3c4b8758..f784ce19 100644 --- a/source/_posts/2014-05-03-drupal-association.md +++ b/source/_posts/2014-05-03-drupal-association.md @@ -2,8 +2,8 @@ title: Drupal Association nav: blog tags: - - drupal - - personal + - drupal + - personal --- Today was my last day working at [Precedent](http://www.precedent.com). Next week, I'll be starting my [new job](https://assoc.drupal.org/node/18923 "Drupal.org Developer") at the [Drupal Association](http://assoc.drupal.org) working on Drupal's home - [Drupal.org](http://www.drupal.org). diff --git a/source/_posts/2014-05-06-thanks.md b/source/_posts/2014-05-06-thanks.md index dee9584b..3a343ac9 100644 --- a/source/_posts/2014-05-06-thanks.md +++ b/source/_posts/2014-05-06-thanks.md @@ -2,8 +2,8 @@ title: Thanks nav: blog tags: - - drupal - - drupal-association - - personal + - drupal + - drupal-association + - personal --- This is just a quick post to thank everyone for their comments and congratulations after my previous post about [joining the Drupal Association](/blog/drupal-association/). I’m looking forward to my first day in the job tomorrow. \ No newline at end of file diff --git a/source/_posts/2014-05-21-git-format-patch.md b/source/_posts/2014-05-21-git-format-patch.md index 2a3aefec..830a5de9 100644 --- a/source/_posts/2014-05-21-git-format-patch.md +++ b/source/_posts/2014-05-21-git-format-patch.md @@ -3,10 +3,10 @@ title: git format-patch is your Friend nav: blog slug: git-format-patch tags: - - patches - - drupal - - drupal-planet - - git + - patches + - drupal + - drupal-planet + - git --- ## The Problem @@ -18,7 +18,7 @@ There is an option that the maintainer can add to the end of their commit messag For example: - --author="opdavies " + --author="opdavies " This differs slightly different for each Drupal user, and the code can be found on their Drupal.org profile page. @@ -75,8 +75,8 @@ If you need to commit a patch that was created using `git format-patch`, the bes For example, within your repository, run: - $ git am /path/to/file - $ git am ~/Code/metatag-comment-fragment-conflict-2265447-4.patch + $ git am /path/to/file + $ git am ~/Code/metatag-comment-fragment-conflict-2265447-4.patch You should end up with some output similar to the following: diff --git a/source/_posts/2014-07-02-drush-make-drupalbristol.md b/source/_posts/2014-07-02-drush-make-drupalbristol.md index d0b9fb5a..64acd387 100644 --- a/source/_posts/2014-07-02-drush-make-drupalbristol.md +++ b/source/_posts/2014-07-02-drush-make-drupalbristol.md @@ -2,11 +2,11 @@ title: drush make drupalbristol nav: blog tags: - - drupal - - drush - - drush-make - - drupal-bristol - - talks + - drupal + - drush + - drush-make + - drupal-bristol + - talks --- Here are my slides from this month's talk night at the [Drupal Bristol user group](https://groups.drupal.org/bristol-and-west-uk). diff --git a/source/_posts/2014-10-06-fix-vagrant-loading-wrong-virtual-machine.md b/source/_posts/2014-10-06-fix-vagrant-loading-wrong-virtual-machine.md index be16ee78..b2be1dce 100644 --- a/source/_posts/2014-10-06-fix-vagrant-loading-wrong-virtual-machine.md +++ b/source/_posts/2014-10-06-fix-vagrant-loading-wrong-virtual-machine.md @@ -3,10 +3,10 @@ title: How to fix Vagrant Loading the Wrong Virtual Machine nav: blog slug: fix-vagrant-loading-wrong-virtual-machine tags: - - vagrant - - virtualbox + - vagrant + - virtualbox meta: - description: How to fix it when Vagrant loads the wrong virtual machine. + description: How to fix it when Vagrant loads the wrong virtual machine. --- A few times recently, I've had instances where Vagrant seems to have forgotten which virtual machine it's supposed to load, probably due to renaming a project directory or the .vagrant directory being moved accidentally. diff --git a/source/_posts/2014-10-21-updating-features-and-adding-components-using-drush.md b/source/_posts/2014-10-21-updating-features-and-adding-components-using-drush.md index 2a5855d6..2031207b 100644 --- a/source/_posts/2014-10-21-updating-features-and-adding-components-using-drush.md +++ b/source/_posts/2014-10-21-updating-features-and-adding-components-using-drush.md @@ -3,10 +3,10 @@ title: Updating Features and Adding Components Using Drush nav: blog slug: updating-features-and-adding-components-using-drush tags: - - drupal - - drupal-planet - - drush - - features + - drupal + - drupal-planet + - drush + - features --- If you use the [Features module](http://drupal.org/project/features) to manage your Drupal configuration, it can be time consuming to update features through the UI, especially if you are working on a remote server and need to keep downloading and uploading files. @@ -18,7 +18,7 @@ To search for a component, use the `drush features-components` command. This wil To filter further, you can also use the `grep` command to filter the results. For example, `drush features-components --not-exported field_base | grep foo`, would only return non-exported field bases containing the word "foo". -The result is a source and a component, separated by a colon. For example, `field_base:field_foo`. +The result is a source and a component, separated by a colon. For example, `field_base:field_foo`. ## Exporting the Feature @@ -26,7 +26,7 @@ Once you have a list of the components that you need to add, you can export the For example: - $ drush features-export -y myfeature field_base:field_foo field_instance:user-field_foo + $ drush features-export -y myfeature field_base:field_foo field_instance:user-field_foo In this example, the base for field_boo and it's instance on the user object is being added to the "myfeature" feature. diff --git a/source/_posts/2014-11-18-include-css-fonts-using-sass-each-loop.md b/source/_posts/2014-11-18-include-css-fonts-using-sass-each-loop.md index 3592fdba..41e9e844 100644 --- a/source/_posts/2014-11-18-include-css-fonts-using-sass-each-loop.md +++ b/source/_posts/2014-11-18-include-css-fonts-using-sass-each-loop.md @@ -4,54 +4,54 @@ nav: blog description: How to use an SASS each loop to easily add multiple fonts to your CSS. slug: include-css-fonts-using-sass-each-loop tags: - - compass - - drupal-planet - - fonts - - sass + - compass + - drupal-planet + - fonts + - sass --- Using a file structure similar to this, organise your font files into directories, using the the font name for both the directory name and for the file names. ~~~~ . ├── FuturaBold -│ ├── FuturaBold.eot -│ ├── FuturaBold.svg -│ ├── FuturaBold.ttf -│ └── FuturaBold.woff +│ ├── FuturaBold.eot +│ ├── FuturaBold.svg +│ ├── FuturaBold.ttf +│ └── FuturaBold.woff ├── FuturaBoldItalic -│ ├── FuturaBoldItalic.eot -│ ├── FuturaBoldItalic.svg -│ ├── FuturaBoldItalic.ttf -│ └── FuturaBoldItalic.woff +│ ├── FuturaBoldItalic.eot +│ ├── FuturaBoldItalic.svg +│ ├── FuturaBoldItalic.ttf +│ └── FuturaBoldItalic.woff ├── FuturaBook -│ ├── FuturaBook.eot -│ ├── FuturaBook.svg -│ ├── FuturaBook.ttf -│ └── FuturaBook.woff +│ ├── FuturaBook.eot +│ ├── FuturaBook.svg +│ ├── FuturaBook.ttf +│ └── FuturaBook.woff ├── FuturaItalic -│ ├── FuturaItalic.eot -│ ├── FuturaItalic.svg -│ ├── FuturaItalic.ttf -│ └── FuturaItalic.woff +│ ├── FuturaItalic.eot +│ ├── FuturaItalic.svg +│ ├── FuturaItalic.ttf +│ └── FuturaItalic.woff ~~~~ Within your SASS file, start an `@each` loop, listing the names of the fonts. In the same way as PHP's `foreach` loop, each font name will get looped through using the `$family` variable and then compiled into CSS. ~~~~ @each $family in FuturaBook, FuturaBold, FuturaBoldItalic, FuturaItalic { - @font-face { - font-family: #{$family}; - src: url('../fonts/#{$family}/#{$family}.eot'); - src: url('../fonts/#{$family}/#{$family}.eot?#iefix') format('embedded-opentype'), - url('../fonts/#{$family}/#{$family}.woff') format('woff'), - url('../fonts/#{$family}/#{$family}.ttf') format('truetype'), - url('../fonts/#{$family}/#{$family}.svg##{$family}') format('svg'); - font-weight: normal; - font-style: normal; - } + @font-face { + font-family: #{$family}; + src: url('../fonts/#{$family}/#{$family}.eot'); + src: url('../fonts/#{$family}/#{$family}.eot?#iefix') format('embedded-opentype'), + url('../fonts/#{$family}/#{$family}.woff') format('woff'), + url('../fonts/#{$family}/#{$family}.ttf') format('truetype'), + url('../fonts/#{$family}/#{$family}.svg##{$family}') format('svg'); + font-weight: normal; + font-style: normal; + } } ~~~~ When the CSS has been compiled, you can then use in your CSS in the standard way. - font-family: "FuturaBook"; \ No newline at end of file + font-family: "FuturaBook"; \ No newline at end of file diff --git a/source/_posts/2014-11-20-using-remote-files-when-developing-locally-stage-file-proxy-module.md b/source/_posts/2014-11-20-using-remote-files-when-developing-locally-stage-file-proxy-module.md index ae7f16eb..e853ea45 100644 --- a/source/_posts/2014-11-20-using-remote-files-when-developing-locally-stage-file-proxy-module.md +++ b/source/_posts/2014-11-20-using-remote-files-when-developing-locally-stage-file-proxy-module.md @@ -2,9 +2,9 @@ title: Using Remote Files when Developing Locally with Stage File Proxy Module nav: blog tags: - - drupal - - drupal-planet - - servers + - drupal + - drupal-planet + - servers --- Download the [Stage File Proxy](https://www.drupal.org/project/stage_file_proxy) module from Drupal.org and enable it on your site. @@ -13,15 +13,10 @@ As this module is only going to be needed on pre-production sites, it would be b ~~~php // File proxy to the live site. $conf['stage_file_proxy_origin'] = 'http://www.example.com'; -~~~ -~~~php // Don't copy the files, just link to them. $conf['stage_file_proxy_hotlink'] = TRUE; -~~~ - -~~~php // Image style images are the wrong size otherwise. $conf['stage_file_proxy_use_imagecache_root'] = FALSE; ~~~ diff --git a/source/_posts/2014-11-27-pantheon-settings-files.md b/source/_posts/2014-11-27-pantheon-settings-files.md index eb502615..7026f77d 100644 --- a/source/_posts/2014-11-27-pantheon-settings-files.md +++ b/source/_posts/2014-11-27-pantheon-settings-files.md @@ -3,10 +3,10 @@ title: Include environment-specific settings files on Pantheon nav: blog slug: pantheon-settings-files tags: - - drupal - - drupal-planet - - pantheon - - settings.php + - drupal + - drupal-planet + - pantheon + - settings.php --- I was recently doing some work on a site hosted on [Pantheon](http://getpantheon.com) and came across an issue, for which part of the suggested fix was to ensure that the `$base_url` variable was explicitly defined within settings.php (this is also best practice on all Drupal sites). @@ -14,22 +14,22 @@ The way that was recommended was by using a `switch()` function based on Pantheo ~~~php switch ($_SERVER['PANTHEON_ENVIRONMENT']) { - case 'dev': - // Development environment. - $base_url = 'dev-my-site.gotpantheon.com'; - break; + case 'dev': + // Development environment. + $base_url = 'dev-my-site.gotpantheon.com'; + break; - case 'test': - // Testing environment. - $base_url = 'test-my-site.gotpantheon.com'; - break; + case 'test': + // Testing environment. + $base_url = 'test-my-site.gotpantheon.com'; + break; - case 'live': - // Production environment. - $base_url = 'live-my-site.gotpantheon.com'; - break; + case 'live': + // Production environment. + $base_url = 'live-my-site.gotpantheon.com'; + break; } ~~~ @@ -41,17 +41,17 @@ To do this, add the following code to the bottom of settings.php: ~~~php if (isset($_SERVER['PANTHEON_ENVIRONMENT'])) { - if ($_SERVER['PANTHEON_ENVIRONMENT'] != 'live') { - // You can still add things here, for example to apply to all sites apart - // from production. Mail reroutes, caching settings etc. - } + if ($_SERVER['PANTHEON_ENVIRONMENT'] != 'live') { + // You can still add things here, for example to apply to all sites apart + // from production. Mail reroutes, caching settings etc. + } - // Include an environment-specific settings file, for example - // settings.dev.php, if one exists. - $environment_settings = __DIR__ . '/settings.' . $_SERVER['PANTHEON_ENVIRONMENT'] . '.php'; - if (file_exists($environment_settings)) { - include $environment_settings; - } + // Include an environment-specific settings file, for example + // settings.dev.php, if one exists. + $environment_settings = __DIR__ . '/settings.' . $_SERVER['PANTHEON_ENVIRONMENT'] . '.php'; + if (file_exists($environment_settings)) { + include $environment_settings; + } } ~~~ diff --git a/source/_posts/2014-12-20-include-local-drupal-settings-file-environment-configuration-and-overrides.md b/source/_posts/2014-12-20-include-local-drupal-settings-file-environment-configuration-and-overrides.md index fdca4deb..e3dd4d37 100644 --- a/source/_posts/2014-12-20-include-local-drupal-settings-file-environment-configuration-and-overrides.md +++ b/source/_posts/2014-12-20-include-local-drupal-settings-file-environment-configuration-and-overrides.md @@ -3,19 +3,19 @@ title: Include a Local Drupal Settings file for Environment Configuration and Ov nav: blog slug: include-local-drupal-settings-file-environment-configuration-and-overrides tags: - - drupal - - drupal-6 - - drupal-7 - - drupal-8 - - drupal-planet - - settings.php + - drupal + - drupal-6 + - drupal-7 + - drupal-8 + - drupal-planet + - settings.php --- At the bottom of settings.php, add the following code: ~~~php $local_settings = __DIR__ . '/settings.local.php'; if (file_exists($local_settings)) { - include $local_settings; + include $local_settings; } ~~~ @@ -25,7 +25,7 @@ Environment specific settings like `$databases` and `$base_url` can be placed wi settings.php though is ignored by default by Git by a .gitignore file, so it won't show up as a file available to be committed. There are two ways to fix this. The first is to use the `--force` option when adding the file which overrides the ignore file: - git add --force sites/default/settings.php + git add --force sites/default/settings.php The other option is to update the .gitignore file itself so that settings.php is no longer ignored. An updated .gitignore file could look like: diff --git a/source/_posts/2014-12-22-configuring-the-reroute-email-module.md b/source/_posts/2014-12-22-configuring-the-reroute-email-module.md index 67a7a974..41847c02 100644 --- a/source/_posts/2014-12-22-configuring-the-reroute-email-module.md +++ b/source/_posts/2014-12-22-configuring-the-reroute-email-module.md @@ -2,11 +2,11 @@ title: Configuring the Reroute Email Module nav: blog tags: - - drupal - - drupal-6 - - drupal-7 - - drupal-planet - - email + - drupal + - drupal-6 + - drupal-7 + - drupal-planet + - email draft: true --- [Reroute Email](https://www.drupal.org/project/reroute_email) module uses `hook_mail_alter()` to prevent emails from being sent to users from non-production sites. It allows you to enter one or more email addresses that will receive the emails instead of delivering them to the original user. @@ -39,9 +39,9 @@ If you want to add multiple addresses, these should be added in a semicolon-deli ~~~php $conf['reroute_email_address'] = implode(';', array( - 'person1@example.com', - 'person2@example.com', - 'person3@example.com', + 'person1@example.com', + 'person2@example.com', + 'person3@example.com', )); ~~~ diff --git a/source/_posts/2015-03-20-2014.md b/source/_posts/2015-03-20-2014.md index b80df783..8822d2d5 100644 --- a/source/_posts/2015-03-20-2014.md +++ b/source/_posts/2015-03-20-2014.md @@ -3,9 +3,9 @@ title: 2014 description: A look back at 2014. nav: blog tags: - - drupal-association - - drupalcamp-london - - personal + - drupal-association + - drupalcamp-london + - personal tweets: true --- A lot happened in 2014. Here are some of the main things that I'd like to highlight: diff --git a/source/_posts/2015-04-03-minimum-core-version.md b/source/_posts/2015-04-03-minimum-core-version.md index 5a5d13bd..88fcc8de 100644 --- a/source/_posts/2015-04-03-minimum-core-version.md +++ b/source/_posts/2015-04-03-minimum-core-version.md @@ -3,14 +3,14 @@ title: How to Define a Minimum Drupal Core Version description: How to define a minimum Drupal core version for your module or theme. nav: blog tags: - - drupal - - drupal-7 - - drupal-planet + - drupal + - drupal-7 + - drupal-planet meta: - og: - title: 'How to Define a Minimum Drupal Core Version' - description: 'How to define a minimum Drupal core version for your module or theme.' - type: article + og: + title: 'How to Define a Minimum Drupal Core Version' + description: 'How to define a minimum Drupal core version for your module or theme.' + type: article --- This week, my first code patch was [committed to Drupal core](https://www.drupal.org/node/2394517#comment-9773143). The patch adds the `user_has_role()` function to the user module, to simplify the way to check whether a user in Drupal has been assigned a specific role. This is something that I normally write a custom function for each project, but it's now available in Drupal core as of [7.36](https://www.drupal.org/drupal-7.36-release-notes). @@ -26,7 +26,7 @@ What I'm going to be doing for my contrib projects is defining a minimum version You can define a simple dependency for your module by adding a line this this to your project's .info file: - dependencies[] = views + dependencies[] = views This would make your module dependant on having the [Views](https://www.drupal.org/project/views) module present and enabled, which you'd need if you were including views as part of your module, for example. @@ -34,12 +34,12 @@ This would make your module dependant on having the [Views](https://www.drupal.o In the previous example, our module would enable if _any_ version of Views was enabled, but we need to specify a specific version. We can do this by including version numbers within the dependencies field in the following format: - dependencies[] = modulename (major.minor) + dependencies[] = modulename (major.minor) This can be a for a specific module release or a branch name: - dependencies[] = modulename (1.0) - dependencies[] = modulename (1.x) + dependencies[] = modulename (1.0) + dependencies[] = modulename (1.x) We can also use the following as part of the field for extra granularity: @@ -52,7 +52,7 @@ We can also use the following as part of the field for extra granularity: In the original scenario, we want to specify that the module can only be enabled on Drupal core 7.36 or later. To do this, we can use the "greater than or equal to" option. - dependencies[] = system (>=7.36) + dependencies[] = system (>=7.36) Because we need to check for Drupal's core version, we're using the system module as the dependency and specifying that it needs to be either equal to or greater than 7.36. If this dependency is not met, e.g. Drupal 7.35 is being used, then the module cannot be enabled rather than showing a function not found error for `user_has_role()` when it is called. diff --git a/source/_talks/2013-07-10-ldap.md b/source/_talks/2013-07-10-ldap.md index 488ff586..cd34fc95 100644 --- a/source/_talks/2013-07-10-ldap.md +++ b/source/_talks/2013-07-10-ldap.md @@ -3,11 +3,11 @@ title: LDAP Integration with Drupal location: South Wales Drupal User Group description: An overview of the Drupal LDAP module and how I customised it for a client project. tags: - - user-group - - drupal - - ldap + - user-group + - drupal + - ldap meta: - description: 'Integrating Drupal with LDAP.' + description: 'Integrating Drupal with LDAP.' nav: talks --- An overview of the [Drupal LDAP module](https://www.drupal.org/project/ldap) and how I integrated and customised it for a client project. \ No newline at end of file diff --git a/source/_talks/2014-03-01-git-flow.md b/source/_talks/2014-03-01-git-flow.md index 1ef087d1..25e3ec81 100644 --- a/source/_talks/2014-03-01-git-flow.md +++ b/source/_talks/2014-03-01-git-flow.md @@ -5,13 +5,13 @@ description: Never Commit to Master: An Introd slides: https://speakerdeck.com/opdavies/never-commit-to-master-an-introduction-to-git-flow slides_embed: tags: - - conference - - drupalcamp - - drupalcamp-london - - git - - git-flow + - conference + - drupalcamp + - drupalcamp-london + - git + - git-flow meta: - description: + description: slug: git-flow nav: talks --- diff --git a/source/_talks/2014-07-02-drush-make-drupalbristol.md b/source/_talks/2014-07-02-drush-make-drupalbristol.md index 1dd7f455..fc91bead 100644 --- a/source/_talks/2014-07-02-drush-make-drupalbristol.md +++ b/source/_talks/2014-07-02-drush-make-drupalbristol.md @@ -5,12 +5,12 @@ description: drush make drupalbristol tags: - - user-group - - drupal - - drush - - drush-make + - user-group + - drupal + - drush + - drush-make meta: - description: 'An introduction to Drush and Drush Make.' + description: 'An introduction to Drush and Drush Make.' nav: talks --- An introduction to Drush and Drush Make. \ No newline at end of file diff --git a/source/_talks/2014-08-19-drupal-association.md b/source/_talks/2014-08-19-drupal-association.md index ecfef7fb..ace4a413 100644 --- a/source/_talks/2014-08-19-drupal-association.md +++ b/source/_talks/2014-08-19-drupal-association.md @@ -3,10 +3,10 @@ title: About the Drupal Association location: South Wales Drupal User Group description: An impromptu talk about the Drupal Association and I've done there since joining the team. tags: - - user-group - - drupal-association + - user-group + - drupal-association meta: - description: "An impromptu talk about the Drupal Association and I've done there since joining the team." + description: "An impromptu talk about the Drupal Association and I've done there since joining the team." slug: drupal-association nav: talks --- diff --git a/source/_talks/2015-01-18-drupalorg-2015-whats-coming-next.md b/source/_talks/2015-01-18-drupalorg-2015-whats-coming-next.md index ae1afb09..9ba46136 100644 --- a/source/_talks/2015-01-18-drupalorg-2015-whats-coming-next.md +++ b/source/_talks/2015-01-18-drupalorg-2015-whats-coming-next.md @@ -4,12 +4,12 @@ location: DrupalCamp London date: 2015-02-28 description: Drupal.org in 2015: What's coming next? tags: - - conference - - drupalcamp - - drupalcamp-london - - drupalorg + - conference + - drupalcamp + - drupalcamp-london + - drupalorg meta: - description: 'Everything that you wanted to know about Drupal 8 in ten minutes, but were afraid to ask!' + description: 'Everything that you wanted to know about Drupal 8 in ten minutes, but were afraid to ask!' slug: drupalorg-2015 nav: talks --- diff --git a/source/_talks/2015-04-08-drupal-8.md b/source/_talks/2015-04-08-drupal-8.md index ba77e83a..9f51bc35 100644 --- a/source/_talks/2015-04-08-drupal-8.md +++ b/source/_talks/2015-04-08-drupal-8.md @@ -6,12 +6,12 @@ description: Drupal 8 (l slides: https://speakerdeck.com/opdavies/drupal-8 slides_embed: tags: - - meetup - - phpsw - - drupal - - drupal-8 + - meetup + - phpsw + - drupal + - drupal-8 meta: - description: 'Everything that you wanted to know about Drupal 8 in ten minutes, but were afraid to ask!' + description: 'Everything that you wanted to know about Drupal 8 in ten minutes, but were afraid to ask!' slug: drupal-8 nav: talks --- diff --git a/source/blog.html.twig b/source/blog.html.twig index 7f783d4f..1ff623ed 100644 --- a/source/blog.html.twig +++ b/source/blog.html.twig @@ -3,12 +3,12 @@ layout: default title: Blog nav: blog use: - - posts + - posts ---

Blog

\ No newline at end of file diff --git a/source/blog/tags.html.twig b/source/blog/tags.html.twig index 3b76dfc8..b95319c9 100644 --- a/source/blog/tags.html.twig +++ b/source/blog/tags.html.twig @@ -3,12 +3,12 @@ layout: default title: Tags nav: blog use: - - posts_tags + - posts_tags ---

Tags

\ No newline at end of file diff --git a/source/blog/tags/tag.html.twig b/source/blog/tags/tag.html.twig index 4a11729f..4e83d536 100644 --- a/source/blog/tags/tag.html.twig +++ b/source/blog/tags/tag.html.twig @@ -3,21 +3,21 @@ layout: default title: Tag Archive nav: blog generator: - - posts_tag_index + - posts_tag_index --- {% block head_meta %} - - + + {% endblock %} {% block title %}{{ page.title }} "{{ page.tag }}"{% endblock %} {% block content %} -

"{{ page.tag }}"

+

"{{ page.tag }}"

+ {% for post in page.tag_posts %} +
  • {{ post.title }}
  • + {% endfor %} + {% endblock content %} \ No newline at end of file diff --git a/source/blog/tags/tag.xml b/source/blog/tags/tag.xml index 9fdea16e..3620c9e4 100644 --- a/source/blog/tags/tag.xml +++ b/source/blog/tags/tag.xml @@ -3,21 +3,21 @@ generator: [posts_tag_index] --- - - {{ site.title }} - {{ site.url }} - en - {% if site.description %}{{ site.description|raw }}{% endif %} - - {{ site.calculated_date|date('r') }} - {% for post in page.tag_posts|slice(0, 10) %} - - {{ post.title }} - {{ site.url }}{{ post.url }} - {{ site.url }}{{ post.url }} - {{ post.date|date('r') }} - {{ post.description|raw }} - - {% endfor %} - + + {{ site.title }} + {{ site.url }} + en + {% if site.description %}{{ site.description|raw }}{% endif %} + + {{ site.calculated_date|date('r') }} + {% for post in page.tag_posts|slice(0, 10) %} + + {{ post.title }} + {{ site.url }}{{ post.url }} + {{ site.url }}{{ post.url }} + {{ post.date|date('r') }} + {{ post.description|raw }} + + {% endfor %} + \ No newline at end of file diff --git a/source/company-information.md b/source/company-information.md index 63d9af2c..a4c60e48 100644 --- a/source/company-information.md +++ b/source/company-information.md @@ -3,7 +3,7 @@ layout: default title: Company Information nav: company meta: - description: 'Company information for Oliver Davies Ltd.' + description: 'Company information for Oliver Davies Ltd.' --- # Company Information diff --git a/source/contact.md b/source/contact.md index 9ca6e428..995d9298 100644 --- a/source/contact.md +++ b/source/contact.md @@ -3,7 +3,7 @@ layout: default title: Contact nav: contact meta: - description: 'Information about how to get in touch with Oliver.' + description: 'Information about how to get in touch with Oliver.' --- # Contact diff --git a/source/index.md b/source/index.md index 670839ce..57a3ff73 100644 --- a/source/index.md +++ b/source/index.md @@ -2,16 +2,16 @@ layout: default nav: about meta: + description: 'The personal website and blog of Oliver Davies, a Drupal Developer and System Administrator from Wales, UK.' + og: + title: 'Oliver Davies - Drupal Developer' description: 'The personal website and blog of Oliver Davies, a Drupal Developer and System Administrator from Wales, UK.' - og: - title: 'Oliver Davies - Drupal Developer' - description: 'The personal website and blog of Oliver Davies, a Drupal Developer and System Administrator from Wales, UK.' - type: website - image: - url: http://www.oliverdavies.co.uk/assets/images/oliver.jpg - width: 327 - height: 327 - type: image/jpg + type: website + image: + url: http://www.oliverdavies.co.uk/assets/images/oliver.jpg + width: 327 + height: 327 + type: image/jpg --- # About diff --git a/source/services.md b/source/services.md index d99b32a9..51a70267 100644 --- a/source/services.md +++ b/source/services.md @@ -3,7 +3,7 @@ layout: default title: Services nav: services meta: - description: 'Information about freelance services that Oliver offers.' + description: 'Information about freelance services that Oliver offers.' --- # Services diff --git a/source/sitemap.xml b/source/sitemap.xml index 4f5d0274..70ef3c7e 100644 --- a/source/sitemap.xml +++ b/source/sitemap.xml @@ -3,36 +3,36 @@ permalink: sitemap.xml --- - - {{ site.url }} - {{ site.calculated_date | date('Y-m-d') }} - daily - 0.8 - + + {{ site.url }} + {{ site.calculated_date | date('Y-m-d') }} + daily + 0.8 + - {% set pages = { 0: 'accessibility', 1: 'blog', 2: 'company-information', 3: 'contact', 4: 'services', 5: 'talks', 6: 'work' } %} - {% for page in pages %} - - {{ site.url }}/{{ page }} - {{ site.calculated_date | date('Y-m-d') }} - monthly - 0.6 - - {% endfor %} - - - {{ site.url }}/blog + {% set pages = { 0: 'accessibility', 1: 'blog', 2: 'company-information', 3: 'contact', 4: 'services', 5: 'talks', 6: 'work' } %} + {% for page in pages %} + + {{ site.url }}/{{ page }} {{ site.calculated_date | date('Y-m-d') }} monthly - 0.8 - - - {% for post in data.posts %} - - {{ site.url }}{{ post.url }} - {{ post.date|date('c') }} - weekly - 1.0 - + 0.6 + {% endfor %} + + + {{ site.url }}/blog + {{ site.calculated_date | date('Y-m-d') }} + monthly + 0.8 + + + {% for post in data.posts %} + + {{ site.url }}{{ post.url }} + {{ post.date|date('c') }} + weekly + 1.0 + + {% endfor %} \ No newline at end of file diff --git a/source/talks.html.twig b/source/talks.html.twig index 48e245f7..9c3d621f 100644 --- a/source/talks.html.twig +++ b/source/talks.html.twig @@ -3,9 +3,9 @@ layout: default title: Talks nav: talks meta: - description: 'Information about previous and upcoming talks that Oliver has presented at conferences and user groups' + description: 'Information about previous and upcoming talks that Oliver has presented at conferences and user groups' use: - - talks + - talks ---

    Talks

    @@ -16,28 +16,28 @@ use: {% set found = false %} {% for talk in talks if talk.date >= now %} - {% if loop.first %} - {% set found = true %} -

    Upcoming Talks

    -
    - {% endif %} + {% if loop.first %} + {% set found = true %} +

    Upcoming Talks

    +
    + {% endif %} - {% include 'talk-listing-item' %} + {% include 'talk-listing-item' %} {% endfor %} {% if found %} -
    +
    {% endif %} {% set found = false %} {% for talk in talks if talk.date < now %} - {% if loop.first %} - {% set found = true %} -

    Previous Talks

    -
    - {% endif %} + {% if loop.first %} + {% set found = true %} +

    Previous Talks

    +
    + {% endif %} - {% include 'talk-listing-item' %} + {% include 'talk-listing-item' %} {% endfor %} {% if found %} -
    +
    {% endif %} diff --git a/source/themes/opdavies/opdavies/Gemfile b/source/themes/opdavies/opdavies/Gemfile index bbdf4e7a..4b44e5c5 100644 --- a/source/themes/opdavies/opdavies/Gemfile +++ b/source/themes/opdavies/opdavies/Gemfile @@ -2,9 +2,9 @@ source 'https://rubygems.org' group :development do - gem "sass" - gem "sass-globbing" - gem "bootstrap-sass" - gem "compass" + gem "sass" + gem "sass-globbing" + gem "bootstrap-sass" + gem "compass" end \ No newline at end of file diff --git a/source/themes/opdavies/opdavies/Gemfile.lock b/source/themes/opdavies/opdavies/Gemfile.lock index ce9f7460..ac2acc85 100644 --- a/source/themes/opdavies/opdavies/Gemfile.lock +++ b/source/themes/opdavies/opdavies/Gemfile.lock @@ -1,41 +1,41 @@ GEM - remote: https://rubygems.org/ - specs: - autoprefixer-rails (5.1.8) - execjs - json - bootstrap-sass (3.3.4.1) - autoprefixer-rails (>= 5.0.0.1) - sass (>= 3.2.19) - chunky_png (1.3.4) - compass (1.0.3) - chunky_png (~> 1.2) - compass-core (~> 1.0.2) - compass-import-once (~> 1.0.5) - rb-fsevent (>= 0.9.3) - rb-inotify (>= 0.9) - sass (>= 3.3.13, < 3.5) - compass-core (1.0.3) - multi_json (~> 1.0) - sass (>= 3.3.0, < 3.5) - compass-import-once (1.0.5) - sass (>= 3.2, < 3.5) - execjs (2.4.0) - ffi (1.9.8) - json (1.8.2) - multi_json (1.11.0) - rb-fsevent (0.9.4) - rb-inotify (0.9.5) - ffi (>= 0.5.0) - sass (3.4.13) - sass-globbing (1.1.1) - sass (>= 3.1) + remote: https://rubygems.org/ + specs: + autoprefixer-rails (5.1.8) + execjs + json + bootstrap-sass (3.3.4.1) + autoprefixer-rails (>= 5.0.0.1) + sass (>= 3.2.19) + chunky_png (1.3.4) + compass (1.0.3) + chunky_png (~> 1.2) + compass-core (~> 1.0.2) + compass-import-once (~> 1.0.5) + rb-fsevent (>= 0.9.3) + rb-inotify (>= 0.9) + sass (>= 3.3.13, < 3.5) + compass-core (1.0.3) + multi_json (~> 1.0) + sass (>= 3.3.0, < 3.5) + compass-import-once (1.0.5) + sass (>= 3.2, < 3.5) + execjs (2.4.0) + ffi (1.9.8) + json (1.8.2) + multi_json (1.11.0) + rb-fsevent (0.9.4) + rb-inotify (0.9.5) + ffi (>= 0.5.0) + sass (3.4.13) + sass-globbing (1.1.1) + sass (>= 3.1) PLATFORMS - ruby + ruby DEPENDENCIES - bootstrap-sass - compass - sass - sass-globbing + bootstrap-sass + compass + sass + sass-globbing diff --git a/source/themes/opdavies/opdavies/_layouts/default.html.twig b/source/themes/opdavies/opdavies/_layouts/default.html.twig index 06261118..ae4a2afb 100644 --- a/source/themes/opdavies/opdavies/_layouts/default.html.twig +++ b/source/themes/opdavies/opdavies/_layouts/default.html.twig @@ -1,35 +1,35 @@ - - - - - {% if page.meta.description %} - - {% endif %} - {% if page.meta.og %}{% include "og" with {og: page.meta.og} %}{% endif %} - - {% include 'title' %} - - {% block styles %}{% endblock %} - - - {% include 'navbar' %} + + + + + {% if page.meta.description %} + + {% endif %} + {% if page.meta.og %}{% include "og" with {og: page.meta.og} %}{% endif %} + + {% include 'title' %} + + {% block styles %}{% endblock %} + + + {% include 'navbar' %} -
    -
    -
    - {% block content_wrapper %} - {% block content %}{% endblock %} - {% endblock %} -
    -
    {# .row #} -
    {# .container #} +
    +
    +
    + {% block content_wrapper %} + {% block content %}{% endblock %} + {% endblock %} +
    +
    {# .row #} +
    {# .container #} -
    - -
    +
    + +
    - {% include 'footer-scripts' %} - + {% include 'footer-scripts' %} + diff --git a/source/themes/opdavies/opdavies/_layouts/post.html.twig b/source/themes/opdavies/opdavies/_layouts/post.html.twig index 5679ae55..f7e377dd 100644 --- a/source/themes/opdavies/opdavies/_layouts/post.html.twig +++ b/source/themes/opdavies/opdavies/_layouts/post.html.twig @@ -1,24 +1,24 @@ {% extends 'default' %} {% block content_wrapper %} - {% include 'post-header' %} - {% block content %}{% endblock %} + {% include 'post-header' %} + {% block content %}{% endblock %} - {% if page.tags %} -

    - Tags: - {% for tag in page.tags %} - {{ tag }}{% if not loop.last %}, {% endif %} - {% endfor %} -

    - {% endif %} + {% if page.tags %} +

    + Tags: + {% for tag in page.tags %} + {{ tag }}{% if not loop.last %}, {% endif %} + {% endfor %} +

    + {% endif %} - {% include 'about-author' %} + {% include 'about-author' %} - {% if page.next_post or page.previous_post %} - - {% endif %} + {% if page.next_post or page.previous_post %} + + {% endif %} {% endblock %} \ No newline at end of file diff --git a/source/themes/opdavies/opdavies/_layouts/project.html.twig b/source/themes/opdavies/opdavies/_layouts/project.html.twig index c5939b14..4a7e45ba 100644 --- a/source/themes/opdavies/opdavies/_layouts/project.html.twig +++ b/source/themes/opdavies/opdavies/_layouts/project.html.twig @@ -1,8 +1,8 @@ {% extends 'default' %} {% block content_wrapper %} -
    - {% if page.website %}{{ page.website }}{% endif %} - {% block content %}{% endblock %} -
    +
    + {% if page.website %}{{ page.website }}{% endif %} + {% block content %}{% endblock %} +
    {% endblock %} \ No newline at end of file diff --git a/source/themes/opdavies/opdavies/_layouts/talk.html.twig b/source/themes/opdavies/opdavies/_layouts/talk.html.twig index a4b4ccdd..7cf58526 100644 --- a/source/themes/opdavies/opdavies/_layouts/talk.html.twig +++ b/source/themes/opdavies/opdavies/_layouts/talk.html.twig @@ -1,12 +1,12 @@ {% extends 'default' %} {% block content_wrapper %} -

    {{ page.title }}

    - {% block content %}{% endblock %} +

    {{ page.title }}

    + {% block content %}{% endblock %} - {% if page.slides_embed %} -
    - {{ page.slides_embed|raw }} -
    - {% endif %} + {% if page.slides_embed %} +
    + {{ page.slides_embed|raw }} +
    + {% endif %} {% endblock %} \ No newline at end of file diff --git a/source/themes/opdavies/opdavies/_partials/about-author.html.twig b/source/themes/opdavies/opdavies/_partials/about-author.html.twig index 4efe9880..8fd7a7a1 100644 --- a/source/themes/opdavies/opdavies/_partials/about-author.html.twig +++ b/source/themes/opdavies/opdavies/_partials/about-author.html.twig @@ -1,5 +1,5 @@
    -

    About the Author

    - Picture of Oliver -

    {{ site.bio|raw }}

    +

    About the Author

    + Picture of Oliver +

    {{ site.bio|raw }}

    \ No newline at end of file diff --git a/source/themes/opdavies/opdavies/_partials/footer-scripts.html.twig b/source/themes/opdavies/opdavies/_partials/footer-scripts.html.twig index 2238e384..4637ceea 100644 --- a/source/themes/opdavies/opdavies/_partials/footer-scripts.html.twig +++ b/source/themes/opdavies/opdavies/_partials/footer-scripts.html.twig @@ -4,17 +4,17 @@ {% block scripts %}{% endblock %} {% if page.tweets == true %} - + {% endif %} {% if site.google_analytics_tracking_id %} - + ga('create', '{{ site.google_analytics_tracking_id }}', 'auto'); + ga('send', 'pageview'); + {% endif %} \ No newline at end of file diff --git a/source/themes/opdavies/opdavies/_partials/latest-posts.html.twig b/source/themes/opdavies/opdavies/_partials/latest-posts.html.twig index 1f0a5192..9c720811 100644 --- a/source/themes/opdavies/opdavies/_partials/latest-posts.html.twig +++ b/source/themes/opdavies/opdavies/_partials/latest-posts.html.twig @@ -1,11 +1,11 @@ {% if data.posts %} -
    -

    Latest Posts

    +
    +

    Latest Posts

    -
      - {% for post in data.posts | slice(0,5) %} - {{ post.title }} - {% endfor %} -
    -
    +
      + {% for post in data.posts | slice(0,5) %} + {{ post.title }} + {% endfor %} +
    +
    {% endif %} \ No newline at end of file diff --git a/source/themes/opdavies/opdavies/_partials/navbar.html.twig b/source/themes/opdavies/opdavies/_partials/navbar.html.twig index 967cd890..46ca84a4 100644 --- a/source/themes/opdavies/opdavies/_partials/navbar.html.twig +++ b/source/themes/opdavies/opdavies/_partials/navbar.html.twig @@ -1,21 +1,21 @@ diff --git a/source/themes/opdavies/opdavies/_partials/og.html.twig b/source/themes/opdavies/opdavies/_partials/og.html.twig index ce53b5ee..f9e81e60 100644 --- a/source/themes/opdavies/opdavies/_partials/og.html.twig +++ b/source/themes/opdavies/opdavies/_partials/og.html.twig @@ -1,37 +1,37 @@ {% if og.title %} - + {% endif %} {% if og.description %} - + {% endif %} {% if og.type %} - + {% endif %} {% if og.image and og.image.url %} - - {% if og.image.type %} - - {% endif %} - {% if og.image.width %} - - {% endif %} - {% if og.image.height %} - - {% endif %} + + {% if og.image.type %} + + {% endif %} + {% if og.image.width %} + + {% endif %} + {% if og.image.height %} + + {% endif %} {% endif %} {% if og.title %} - {% if og.image %} - - - - {% else %} - - {% endif %} - - - + {% if og.image %} + + + + {% else %} + + {% endif %} + + + {% endif %} \ No newline at end of file diff --git a/source/themes/opdavies/opdavies/_partials/post-header.html.twig b/source/themes/opdavies/opdavies/_partials/post-header.html.twig index 1d98cca0..220ef964 100644 --- a/source/themes/opdavies/opdavies/_partials/post-header.html.twig +++ b/source/themes/opdavies/opdavies/_partials/post-header.html.twig @@ -2,9 +2,9 @@

    Posted: {{ page.date | date('jS F Y') }}

    {# {% if page.tags %} - Tags: - {% for tag in page.tags %} - {{ tag }}{% if not loop.last %},{% else %}.{% endif %} - {% endfor %} + Tags: + {% for tag in page.tags %} + {{ tag }}{% if not loop.last %},{% else %}.{% endif %} + {% endfor %} {% endif %} #} \ No newline at end of file diff --git a/source/themes/opdavies/opdavies/_partials/title.html.twig b/source/themes/opdavies/opdavies/_partials/title.html.twig index 6fcae373..3ddec683 100644 --- a/source/themes/opdavies/opdavies/_partials/title.html.twig +++ b/source/themes/opdavies/opdavies/_partials/title.html.twig @@ -1,14 +1,14 @@ {% set separator = '|' %} {% spaceless %} - {% if page.full_title %} - {{ page.full_title }} - {% elseif page.title and site.title %} - {{ page.title }} {{ separator }} {{ site.title }} - {% elseif site.title %} - {% if site.subtitle %} - {{ site.subtitle }} {{ separator }} {{ site.title }} - {% else %} - {{ site.title }} - {% endif %} + {% if page.full_title %} + {{ page.full_title }} + {% elseif page.title and site.title %} + {{ page.title }} {{ separator }} {{ site.title }} + {% elseif site.title %} + {% if site.subtitle %} + {{ site.subtitle }} {{ separator }} {{ site.title }} + {% else %} + {{ site.title }} {% endif %} + {% endif %} {% endspaceless %} \ No newline at end of file diff --git a/source/themes/opdavies/opdavies/assets/sass/base/_base.scss b/source/themes/opdavies/opdavies/assets/sass/base/_base.scss index cf8ccee6..d4f3a7c0 100644 --- a/source/themes/opdavies/opdavies/assets/sass/base/_base.scss +++ b/source/themes/opdavies/opdavies/assets/sass/base/_base.scss @@ -1,3 +1,3 @@ body { - padding-top: 60px; + padding-top: 60px; } \ No newline at end of file diff --git a/source/themes/opdavies/opdavies/assets/sass/base/_lists.scss b/source/themes/opdavies/opdavies/assets/sass/base/_lists.scss index e220ea3c..257e2e43 100644 --- a/source/themes/opdavies/opdavies/assets/sass/base/_lists.scss +++ b/source/themes/opdavies/opdavies/assets/sass/base/_lists.scss @@ -1,11 +1,11 @@ dt { - margin-top: .5em; + margin-top: .5em; - &:after { - content: ':'; - } + &:after { + content: ':'; + } } dd { - padding-left: 2em; + padding-left: 2em; } \ No newline at end of file diff --git a/source/themes/opdavies/opdavies/assets/sass/base/_tables.scss b/source/themes/opdavies/opdavies/assets/sass/base/_tables.scss index ccd39949..877e6738 100644 --- a/source/themes/opdavies/opdavies/assets/sass/base/_tables.scss +++ b/source/themes/opdavies/opdavies/assets/sass/base/_tables.scss @@ -1,3 +1,3 @@ table { - width: 100%; + width: 100%; } \ No newline at end of file diff --git a/source/themes/opdavies/opdavies/assets/sass/components/_footer.scss b/source/themes/opdavies/opdavies/assets/sass/components/_footer.scss index 97fa86cf..d46d4ef0 100644 --- a/source/themes/opdavies/opdavies/assets/sass/components/_footer.scss +++ b/source/themes/opdavies/opdavies/assets/sass/components/_footer.scss @@ -1,5 +1,5 @@ .copyright { - border-top: 1px solid #CCC; - margin-top: 1em; - padding-top: 1em; + border-top: 1px solid #CCC; + margin-top: 1em; + padding-top: 1em; } \ No newline at end of file diff --git a/source/themes/opdavies/opdavies/assets/sass/components/_latest-posts.scss b/source/themes/opdavies/opdavies/assets/sass/components/_latest-posts.scss index 9b98cf10..ef1ab442 100644 --- a/source/themes/opdavies/opdavies/assets/sass/components/_latest-posts.scss +++ b/source/themes/opdavies/opdavies/assets/sass/components/_latest-posts.scss @@ -1,6 +1,6 @@ .latest-posts { - li.active a { - color: $dark-gray; - font-weight: $semibold; - } + li.active a { + color: $dark-gray; + font-weight: $semibold; + } } \ No newline at end of file diff --git a/source/work.md b/source/work.md index 9c600792..e2353a86 100644 --- a/source/work.md +++ b/source/work.md @@ -3,7 +3,7 @@ layout: default title: Work nav: work meta: - description: "Information about Oliver's current work." + description: "Information about Oliver's current work." --- # Work @@ -15,15 +15,15 @@ Some of the tasks that I've worked on so far: * Building new pages for [Supporting Partners](https://www.drupal.org/supporters/partners), [Technology Supporters](https://www.drupal.org/supporters/technology) and [Hosting Supporters](https://www.drupal.org/supporters/hosting). * Improving user profiles - * Configuring human-readable paths for user profiles using [Pathauto](https://www.drupal.org/project/pathauto). - * Migration of user data from profile values to fields, and various user profile improvements. - * Adding [LoginToboggan](https://www.drupal.org/project/logintoboggan) to Drupal.org and improving the user login and registration processes. + * Configuring human-readable paths for user profiles using [Pathauto](https://www.drupal.org/project/pathauto). + * Migration of user data from profile values to fields, and various user profile improvements. + * Adding [LoginToboggan](https://www.drupal.org/project/logintoboggan) to Drupal.org and improving the user login and registration processes. * Theming of [DrupalCon Amsterdam](https://amsterdam2014.drupal.org) and [DrupalCon Latin America](https://latinamerica2015.drupal.org) sites. * Working on responsive [Bluecheese](https://www.drupal.org/project/bluecheese) (the Drupal.org theme). * Customisations to the [Election](https://www.drupal.org/project/election) module for the [2015 Drupal Association Board community elections](http://assoc.drupal.org/2015-nominations). * User role progression - * Adding a "New" badge to pictures of new users for their first 90 days on the site. - * Adding a "confirm" button to relevant user profile pages and comments. + * Adding a "New" badge to pictures of new users for their first 90 days on the site. + * Adding a "confirm" button to relevant user profile pages and comments. ## Freelance diff --git a/templates/post.md b/templates/post.md index b2930d39..89f3c8d3 100644 --- a/templates/post.md +++ b/templates/post.md @@ -3,6 +3,6 @@ title: description: nav: blog tags: - - + - draft: true --- diff --git a/templates/project.md b/templates/project.md index 8c921a25..3811cb9b 100644 --- a/templates/project.md +++ b/templates/project.md @@ -4,7 +4,7 @@ website: client_name: client_url: tags: - - + - --- Some text about the project.