diff --git a/source/_layouts/default.html.twig b/source/_layouts/default.html.twig index a8afccb5..aecb35c4 100644 --- a/source/_layouts/default.html.twig +++ b/source/_layouts/default.html.twig @@ -3,40 +3,40 @@ - - - {% include 'title' %} + + + {% include 'title' %} - {% if page.meta.description %} - - {% endif %} + {% if page.meta.description %} + + {% endif %} - {% if page.meta.og %}{% include "og" with {og: page.meta.og} %}{% endif %} + {% if page.meta.og %}{% include "og" with {og: page.meta.og} %}{% endif %} - - - - - - - {% include 'navbar' %} + + + + + + + {% include 'navbar' %} -
-
- {% block content_wrapper %} -
- {% block content %}{% endblock %} -
- {% endblock %} +
+
+ {% block content_wrapper %} +
+ {% block content %}{% endblock %} +
+ {% endblock %} - {% include 'sidebar' %} -
{# .row #} -
{# .container #} + {% include 'sidebar' %} +
{# .row #} +
{# .container #} -
- -
+
+ +
- {% include 'footer-scripts' %} - + {% include 'footer-scripts' %} + diff --git a/source/_layouts/post.html.twig b/source/_layouts/post.html.twig index c673954c..084138b2 100644 --- a/source/_layouts/post.html.twig +++ b/source/_layouts/post.html.twig @@ -1,28 +1,28 @@ {% 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 +
+{% endblock %} diff --git a/source/_layouts/talk.html.twig b/source/_layouts/talk.html.twig index 8f1f0ba0..3cf2ae56 100644 --- a/source/_layouts/talk.html.twig +++ b/source/_layouts/talk.html.twig @@ -1,13 +1,13 @@ {% extends 'default' %} {% block content_wrapper %} -

{{ page.title }}

+

{{ page.title }}

- {% block content %}{% endblock %} + {% block content %}{% endblock %} - {% if page.slides_embed %} -
- {{ page.slides_embed|raw }} -
- {% endif %} + {% if page.slides_embed %} +
+ {{ page.slides_embed|raw }} +
+ {% endif %} {% endblock %} diff --git a/source/_partials/about-author.html.twig b/source/_partials/about-author.html.twig index 4639379f..00547945 100644 --- a/source/_partials/about-author.html.twig +++ b/source/_partials/about-author.html.twig @@ -1,5 +1,5 @@
-

About the Author

- Picture of Oliver -

{{ site.bio|raw }}

-
\ No newline at end of file +

About the Author

+ Picture of Oliver +

{{ site.bio|raw }}

+ diff --git a/source/_partials/footer-scripts.html.twig b/source/_partials/footer-scripts.html.twig index 2238e384..775e0ac0 100644 --- a/source/_partials/footer-scripts.html.twig +++ b/source/_partials/footer-scripts.html.twig @@ -4,17 +4,17 @@ {% block scripts %}{% endblock %} {% if page.tweets == true %} - + {% endif %} {% if site.google_analytics_tracking_id %} - -{% endif %} \ No newline at end of file + ga('create', '{{ site.google_analytics_tracking_id }}', 'auto'); + ga('send', 'pageview'); + +{% endif %} diff --git a/source/_partials/latest-posts.html.twig b/source/_partials/latest-posts.html.twig index 1f0a5192..0f47a228 100644 --- a/source/_partials/latest-posts.html.twig +++ b/source/_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 %} -
-
-{% endif %} \ No newline at end of file +
    + {% for post in data.posts | slice(0,5) %} + {{ post.title }} + {% endfor %} +
+
+{% endif %} diff --git a/source/_partials/navbar.html.twig b/source/_partials/navbar.html.twig index c0dde1f1..5bc24a4e 100644 --- a/source/_partials/navbar.html.twig +++ b/source/_partials/navbar.html.twig @@ -1,22 +1,22 @@ \ No newline at end of file + + {# .nav-collapse #} + + diff --git a/source/_partials/og.html.twig b/source/_partials/og.html.twig index ce53b5ee..f8304776 100644 --- a/source/_partials/og.html.twig +++ b/source/_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 %} - - - -{% endif %} \ No newline at end of file + {% if og.image %} + + + + {% else %} + + {% endif %} + + + +{% endif %} diff --git a/source/_partials/post-header.html.twig b/source/_partials/post-header.html.twig index 1d98cca0..f3ccde1f 100644 --- a/source/_partials/post-header.html.twig +++ b/source/_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/_partials/sidebar.html.twig b/source/_partials/sidebar.html.twig index 8af96176..ee428caf 100644 --- a/source/_partials/sidebar.html.twig +++ b/source/_partials/sidebar.html.twig @@ -1,16 +1,16 @@
-
-

Drupal Association

- - Drupal Association Individual Member - -
+
+

Drupal Association

+ + Drupal Association Individual Member + +
- -
\ No newline at end of file + + diff --git a/source/_partials/title.html.twig b/source/_partials/title.html.twig index 6fcae373..0cd09870 100644 --- a/source/_partials/title.html.twig +++ b/source/_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 %} -{% endspaceless %} \ No newline at end of file + {% endif %} +{% endspaceless %} 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..a0777e9a 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..f1b22792 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. @@ -27,4 +27,4 @@ I then added a new 'Javascript crop' action with the following settings: * Width: 200px * Height: 100px * xoffset: Left -* yoffset: Top \ No newline at end of file +* yoffset: Top 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..6fc30e94 100644 --- a/source/_posts/2010-05-06-conditional-email-address-webform.md +++ b/source/_posts/2010-05-06-conditional-email-address-webform.md @@ -3,15 +3,15 @@ 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. -Then, when I went to the finished form, the category selection was available. \ No newline at end of file +Then, when I went to the finished form, the category selection was available. diff --git a/source/_posts/2010-05-10-zenophile.md b/source/_posts/2010-05-10-zenophile.md index f2a2b360..210aefed 100644 --- a/source/_posts/2010-05-10-zenophile.md +++ b/source/_posts/2010-05-10-zenophile.md @@ -2,15 +2,15 @@ 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! The Zenophile module allows you to very quickly create Zen subthemes from within your web browser, as well as editing options such as the site directory where it should be placed, the layout type (fixed or fluid), page wrapper and sidebar widths, and the placement of the sidebars. -For more information about the Zenophile module, check out [this video](http://blip.tv/file/2427703) by [Elliott Rothman](http://elliottrothman.com). \ No newline at end of file +For more information about the Zenophile module, check out [this video](http://blip.tv/file/2427703) by [Elliott Rothman](http://elliottrothman.com). diff --git a/source/_posts/2010-05-25-fancy-slide.md b/source/_posts/2010-05-25-fancy-slide.md index b0580aae..f50528bc 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. @@ -23,4 +23,4 @@ I added the following code into my About page, as described in the Fancy Slide r ~~~ -In my opinion, this adds a nice effect to the About page. I like it because it's easy to set up, and easy to add additional images later on if required. \ No newline at end of file +In my opinion, this adds a nice effect to the About page. I like it because it's easy to set up, and easy to add additional images later on if required. 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..61a0aceb 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. @@ -14,4 +14,4 @@ To increase the quality of your images, change the setting in the two following * admin/settings/imageapi/config * admin/settings/image-toolkit -The first one is for ImageAPI. Primarily, this means Imagecache presets. The second one is for core's image.inc. This is used for resizing profile pictures in core, and some contrib modules. Once changed, I did have to flush each of the Imagecache presets (admin/build/imagecache) for the changes to take effect. \ No newline at end of file +The first one is for ImageAPI. Primarily, this means Imagecache presets. The second one is for core's image.inc. This is used for resizing profile pictures in core, and some contrib modules. Once changed, I did have to flush each of the Imagecache presets (admin/build/imagecache) for the changes to take effect. diff --git a/source/_posts/2010-06-23-social-icons-block.md b/source/_posts/2010-06-23-social-icons-block.md index 5c653176..4aadbe9e 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. @@ -20,4 +20,4 @@ I added fields for the node titles, and the link from the node's content. Both o I also used the [Nodequeue](http://drupal.org/project/nodequeue) module to create a nodequeue and arrange the icons in the order that I wanted them to be displayed. Once this was added as a relationship within my View, I was able to use node's position in the nodequeue as the sort criteria. -To complete the process, I used the [CSS Injector](http://drupal.org/project/css_injector) module to add some additional CSS styling to position and space out the icons. \ No newline at end of file +To complete the process, I used the [CSS Injector](http://drupal.org/project/css_injector) module to add some additional CSS styling to position and space out the icons. 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..c0b6826f 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. diff --git a/source/_posts/2010-06-28-flickr-photo-gallery.md b/source/_posts/2010-06-28-flickr-photo-gallery.md index a958e751..c2131f3e 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. @@ -43,4 +43,4 @@ With the new Photo nodes created, I then created the View to display them. The View selects the image within the Photo content type, and displays in it a grid using an ImageCache preset. The View is limited to 20 nodes per page, and uses a full pager if this is exceeded. The nodes are sorted by the descending post date, and filtered by whether or not they are published, and only to include Photo nodes. -As an additional effect, I also included the 'Feeds Item - Item Link' field, which is basically the original link from the RSS feed. By checking the box the exclude the item from the display, it is not shown, but makes the link available to be used elsewhere. By checking the box 'Re-write the output for this field' on the 'Content: Photo' field, I was able to add the replacement token (in this case, [url]) as the path for a link around each image. This meant that when someone clicked a thumbnail of a photo, they were directed to the Flickr website instead of the node within my Drupal site. \ No newline at end of file +As an additional effect, I also included the 'Feeds Item - Item Link' field, which is basically the original link from the RSS feed. By checking the box the exclude the item from the display, it is not shown, but makes the link available to be used elsewhere. By checking the box 'Re-write the output for this field' on the 'Content: Photo' field, I was able to add the replacement token (in this case, [url]) as the path for a link around each image. This meant that when someone clicked a thumbnail of a photo, they were directed to the Flickr website instead of the node within my Drupal site. 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..3896c461 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. @@ -21,4 +21,4 @@ I ensured that my Apache configuration within MAMP was set to port 80, and that After some troubleshooting, I found out that Web Sharing on my Mac had become enabled (I don't know why, I've never enabled it), and that this was causing a conflict with Apache. Once I opened my System Preferences and disabled it, everything worked fine! -This, along with [MAMP](http://www.mamp.info/en/index.html), [Coda](http://www.panic.com/coda), [Sequel Pro](http://www.sequelpro.com), and [Transmit](http://www.panic.com/transmit), has become an essential tool within my development environment. \ No newline at end of file +This, along with [MAMP](http://www.mamp.info/en/index.html), [Coda](http://www.panic.com/coda), [Sequel Pro](http://www.sequelpro.com), and [Transmit](http://www.panic.com/transmit), has become an essential tool within my development environment. 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..f2fdfe86 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. @@ -48,4 +48,4 @@ SELECT nid, tid FROM term_node WHERE nid = 216; Once the query had confirmed the correct tid value, I began to write the SQL Insert statement that would be needed to add the new term to the required nodes. The nid and vid values were the same on each node, and the value of my taxonomy term would need to be 84. -Once this had completed with no errors, I returned to the administration area of my Drupal site to confirm whether or not the nodes had been assigned the new term. \ No newline at end of file +Once this had completed with no errors, I returned to the administration area of my Drupal site to confirm whether or not the nodes had been assigned the new term. diff --git a/source/_posts/2010-07-12-teleport-module.md b/source/_posts/2010-07-12-teleport-module.md index b4580e0f..b87bd027 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))*. @@ -18,4 +18,4 @@ Although it's not a new module (the first commits were 2 years ago), I hope that * 'Actions' like Quicksilver: if you select a node, a second input should appear with options to go to the View page, Edit page, (un)publish, etc. Same with users. * Hook into more non-node content, like taxonomy terms and functions in the API module. -Personally, this will make navigation around both the front-end and administration area of my Drupal sites so much easier. \ No newline at end of file +Personally, this will make navigation around both the front-end and administration area of my Drupal sites so much easier. diff --git a/source/_posts/2010-08-10-adminhover-module.md b/source/_posts/2010-08-10-adminhover-module.md index 5b071eb2..410e6579 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! @@ -38,4 +38,4 @@ It is also possible to customise which links are available from within the admin * Configure block * Add block -Although, as I have additional contributed modules installed, some of these may not neccassaily be available out of the box. \ No newline at end of file +Although, as I have additional contributed modules installed, some of these may not neccassaily be available out of the box. 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..60d6997d 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. 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..a9a054e8 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. diff --git a/source/_posts/2010-08-20-image-caption-module.md b/source/_posts/2010-08-20-image-caption-module.md index e316e0f0..479241bf 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. @@ -21,4 +21,4 @@ As the Image Caption module uses the image's title tag to create the displayed c This results in a span called `image-caption-container` around the inserted image, and a caption below it called `image-caption` containing the text. -All that's left is to style these classes within your CSS stylesheet. \ No newline at end of file +All that's left is to style these classes within your CSS stylesheet. 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..f7a407ea 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! @@ -17,4 +17,4 @@ We'll be meeting in the communal area just outside of the [SubHub](http://www.su Cardiff
CF10 5FZ -For more information and to signup, visit . \ No newline at end of file +For more information and to signup, visit . diff --git a/source/_posts/2010-10-10-create-apply-patches.md b/source/_posts/2010-10-10-create-apply-patches.md index 0db8395b..39c24238 100644 --- a/source/_posts/2010-10-10-create-apply-patches.md +++ b/source/_posts/2010-10-10-create-apply-patches.md @@ -3,27 +3,27 @@ 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! -There is also a Git patch creation workflow, which is described at . Thanks to [Randy Fay](http://randyfay.com) for making me aware of this, and suggesting a slight change to my original patch creation command. \ No newline at end of file +There is also a Git patch creation workflow, which is described at . Thanks to [Randy Fay](http://randyfay.com) for making me aware of this, and suggesting a slight change to my original patch creation command. 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..c84a77ec 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..e7384b67 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,41 +16,41 @@ $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 '.'; ?> ~~~ -It was applied to the view as a header which had the input format set to PHP code. \ No newline at end of file +It was applied to the view as a header which had the input format set to PHP code. 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..edf915bb 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. @@ -17,4 +17,4 @@ Download and install the [@font-your-face](http://drupal.org/project/fontyourfac Go to admin/build/themes/fontyourface, and click 'Browse fonts to enable'. Click on the name of the font that you want to enable, check 'Enabled', and click 'Edit font' to save your changes. -With the font enabled, you can now use it in your CSS. \ No newline at end of file +With the font enabled, you can now use it in your CSS. 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..f0baa7cb 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. @@ -18,4 +18,4 @@ $fans = $xml->page->fan_count; print number_format($fans); ~~~ -This code was originally found at . \ No newline at end of file +This code was originally found at . diff --git a/source/_posts/2011-03-31-proctors.md b/source/_posts/2011-03-31-proctors.md index e3d01484..9253d18a 100644 --- a/source/_posts/2011-03-31-proctors.md +++ b/source/_posts/2011-03-31-proctors.md @@ -3,8 +3,8 @@ 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. -Proctors have an [extensive client list](http://www.proctors.co.uk/clients) - including [BMW](http://www.proctors.co.uk/clients/bmw-financial-services), [Panasonic](http://www.proctors.co.uk/clients/panasonic), the [Open University](http://www.proctors.co.uk/clients/open-university) and [VOSA](http://www.proctors.co.uk/clients/vosa), and it's going to be a fantastic opportunity for me to continue expanding my skillset whilst gaining vital experience. \ No newline at end of file +Proctors have an [extensive client list](http://www.proctors.co.uk/clients) - including [BMW](http://www.proctors.co.uk/clients/bmw-financial-services), [Panasonic](http://www.proctors.co.uk/clients/panasonic), the [Open University](http://www.proctors.co.uk/clients/open-university) and [VOSA](http://www.proctors.co.uk/clients/vosa), and it's going to be a fantastic opportunity for me to continue expanding my skillset whilst gaining vital experience. diff --git a/source/_posts/2011-05-20-proctors-drupal-meetup.md b/source/_posts/2011-05-20-proctors-drupal-meetup.md index 1aede14d..e62f84b9 100644 --- a/source/_posts/2011-05-20-proctors-drupal-meetup.md +++ b/source/_posts/2011-05-20-proctors-drupal-meetup.md @@ -3,9 +3,9 @@ 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. -You can [view more details](http://groups.drupal.org/node/147324), or register [on our website](http://www.proctors.co.uk/Drupal-SWUG-Meetup). \ No newline at end of file +You can [view more details](http://groups.drupal.org/node/147324), or register [on our website](http://www.proctors.co.uk/Drupal-SWUG-Meetup). 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..c6376991 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. @@ -27,4 +27,4 @@ Whilst this works perfectly, the field collection is not editable from the node After some searching I found [a link to a patch](http://drupal.org/node/977890#comment-4184524) which when applied adds a 'subform' widget type to the field collection field and allows for it to be embedded into, and editable from within the node form. Going back to the content type fields page, and clicking on 'Hidden' (the name of the current widget), I can change it to subform and save my changes. -With this change applied, when I go back to add or edit a node within this content type, my field collection will be easily editable directly within the form. \ No newline at end of file +With this change applied, when I go back to add or edit a node within this content type, my field collection will be easily editable directly within the form. 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..452928a9 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,8 +21,8 @@ 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. -Now the next time that you SSH onto the server, it should log you in without prompting you for your password. \ No newline at end of file +Now the next time that you SSH onto the server, it should log you in without prompting you for your password. 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..196341e1 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,32 +3,32 @@ 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. -If your changes aren't applied, then confirm that your global.less file is enabled within your theme's configuration. I did this by going to admin/appearance/settings/oliverdavies, clicking on the Toggle styles tab within *Layout configuration* and finding global.less at the bottom of *Enable optional stylesheets*. \ No newline at end of file +If your changes aren't applied, then confirm that your global.less file is enabled within your theme's configuration. I did this by going to admin/appearance/settings/oliverdavies, clicking on the Toggle styles tab within *Layout configuration* and finding global.less at the bottom of *Enable optional stylesheets*. 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..917dd6c0 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,12 +54,12 @@ 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', ) ~~~~ -Now, within my theme I can create a new node--article-teaser.tpl.php template file and this will get called instead of the node--article.tpl.php when a teaser is loaded. As I'm not specifying the node type specifically and using the dynamic $node->type value within my suggestion, this will also apply for all other content types on my site and not just news articles. \ No newline at end of file +Now, within my theme I can create a new node--article-teaser.tpl.php template file and this will get called instead of the node--article.tpl.php when a teaser is loaded. As I'm not specifying the node type specifically and using the dynamic $node->type value within my suggestion, this will also apply for all other content types on my site and not just news articles. diff --git a/source/_posts/2012-05-23-apache-text-files.md b/source/_posts/2012-05-23-apache-text-files.md index a95cf880..6bf7e571 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 +This prevents any files with a .txt extension from being accessed and rendered in a web browser. 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..fe62195d 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 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..d86f86b1 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..57a4dc0e 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 +If any of the RewriteCond conditions apply, then the RewriteRule is executed. 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..ee6de3fe 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 @@ -36,4 +36,4 @@ stylesheets[print][] = css/print.css # Add javascript files styles[] = js/mytheme.js -~~~ \ No newline at end of file +~~~ 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..9887c3d9 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,40 +44,40 @@ 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); + } } ~~~ -As `mytheme_invoke()` checks to see if the function already exists before searching for checking the include files, I could still add the functions into template.php as normal and this would override any corresponding include file. \ No newline at end of file +As `mytheme_invoke()` checks to see if the function already exists before searching for checking the include files, I could still add the functions into template.php as normal and this would override any corresponding include file. 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..9f14c7a6 100644 --- a/source/_posts/2012-07-12-my-new-drupal-modules.md +++ b/source/_posts/2012-07-12-my-new-drupal-modules.md @@ -3,16 +3,16 @@ 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: * [Block Aria Landmark Roles](http://drupal.org/project/block_aria_landmark_roles) - Inspired by [Block Class](http://drupal.org/project/block_class), this module adds additional elements to the block configuration forms that allow users to assign a ARIA landmark role to a block. * [Nomensa Accessible Media Player](http://drupal.org/project/nomensa_amp) - Provides integration with Nomensa's [Accessible Media Player](https://github.com/nomensa/Accessible-Media-Player). -Documentation for both to follow shortly on Drupal.org. \ No newline at end of file +Documentation for both to follow shortly on Drupal.org. 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..77b3bd7a 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,9 +51,9 @@ 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 -Nomensa Accessible Media Player for Drupal \ No newline at end of file +Nomensa Accessible Media Player for Drupal diff --git a/source/_posts/2012-07-27-linux-journal.md b/source/_posts/2012-07-27-linux-journal.md index 1b1fa42d..a880d87d 100644 --- a/source/_posts/2012-07-27-linux-journal.md +++ b/source/_posts/2012-07-27-linux-journal.md @@ -4,12 +4,12 @@ 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! -The article is expected to be published in October. \ No newline at end of file +The article is expected to be published in October. 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..e9cf6501 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. @@ -12,4 +12,4 @@ I'm an experienced Drupal Developer, but not an experienced public speaker (alth Initially, after aiming for a 20-minute presentation plus Q&A, I think I wrapped up the presentation in around 14 minutes, although I did about 6 minutes of answering questions afterwards including the apparently mandatory "Why use Drupal compared to WordPress or Joomla?" question, some Drupal 8 and Symfony questions, as well as an interesting question about the White House development project after I'd listed it within a list of example sites. Next time, I think that some more detailed presenter notes are needed. Typically, as soon as it sat back in my seat, the majority of things that I'd managed to remember beforehand all came flooding back to me and I thought "I should have said that whilst I was up speaking". -Overall, considering my inexperience at speaking to this type of audience, I was fairly happy with my presentation, although I'm sure that I'll change my mind once I've watched the video of it on the UnifiedDiff website. Regardless, I think that it was a great experience and I enjoyed doing it, and I'd like to thank the organisers of UnifiedDiff for having me speak at their meetup. It was great to have a more relaxed conversation with some people after the other speakers had been up, and having introduced Drupal I would be more than happy to come back and do a more in-depth presentation if there is an interest for me to do so. \ No newline at end of file +Overall, considering my inexperience at speaking to this type of audience, I was fairly happy with my presentation, although I'm sure that I'll change my mind once I've watched the video of it on the UnifiedDiff website. Regardless, I think that it was a great experience and I enjoyed doing it, and I'd like to thank the organisers of UnifiedDiff for having me speak at their meetup. It was great to have a more relaxed conversation with some people after the other speakers had been up, and having introduced Drupal I would be more than happy to come back and do a more in-depth presentation if there is an interest for me to do so. 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..23ed70d6 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" } ] ~~~ @@ -94,4 +94,4 @@ These are the packages that I currently have installed. * [LESS](https://github.com/danro/LESS-sublime) * [Package Control](http://wbond.net/sublime_packages/package_control) * [Sublime CodeIntel](http://github.com/Kronuz/SublimeCodeIntel) -* [Theme - Soda](https://github.com/buymeasoda/soda-theme) \ No newline at end of file +* [Theme - Soda](https://github.com/buymeasoda/soda-theme) diff --git a/source/_posts/2012-11-15-accessible-bristol-site.md b/source/_posts/2012-11-15-accessible-bristol-site.md index c49a0f85..abb040a1 100644 --- a/source/_posts/2012-11-15-accessible-bristol-site.md +++ b/source/_posts/2012-11-15-accessible-bristol-site.md @@ -3,10 +3,10 @@ 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. -The group is hosting a launch event on the 28th November at the Council House, College Green, Bristol. Interested? More information is available at or go to to register. \ No newline at end of file +The group is hosting a launch event on the 28th November at the Council House, College Green, Bristol. Interested? More information is available at or go to to register. 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..05068e3f 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,14 +3,14 @@ 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. -You can also type `sublime --help` to see a list of the available commands. \ No newline at end of file +You can also type `sublime --help` to see a list of the available commands. 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..45a98fe4 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. @@ -55,4 +55,4 @@ Personally, in development, I'd set caching to 'uncached' and the error reportin ## Adding SASS files into your theme -With this done, you can now add SASS and SCSS files by adding a line like `stylesheets[all][] = css/base.scss` in your theme's .info file. \ No newline at end of file +With this done, you can now add SASS and SCSS files by adding a line like `stylesheets[all][] = css/base.scss` in your theme's .info file. 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..cfefc843 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,14 +45,14 @@ 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; } ~~~~ -There is also a [user_is_anonymous()](http://api.drupal.org/api/drupal/modules!user!user.module/function/user_is_anonymous/7) function if you want the opposite result. Both of these functions are available in Drupal 6 and higher. \ No newline at end of file +There is also a [user_is_anonymous()](http://api.drupal.org/api/drupal/modules!user!user.module/function/user_is_anonymous/7) function if you want the opposite result. Both of these functions are available in Drupal 6 and higher. 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..5291aa46 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; } ~~~ @@ -135,4 +135,4 @@ $a = t('Something'); $b = token_replace($a); // This would only use foo tokens. $c = token_replace($a, array('foo')); -~~~ \ No newline at end of file +~~~ 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..e06a0d77 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 +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. 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..7461867c 100644 --- a/source/_posts/2013-04-20-leaving-nomensa-joining-precedent.md +++ b/source/_posts/2013-04-20-leaving-nomensa-joining-precedent.md @@ -3,12 +3,12 @@ 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"). The last 14 months that I've been working at Nomensa have been absolutely fantastic, and had allowed me to work on some great projects for great clients - mainly [unionlearn](http://www.unionlearn.org "unionlearn") and [Digital Theatre Plus](http://www.digitaltheatreplus.com "Digital Theatre Plus"). I've learned so much about accessibility and web standards, and have pretty much changed my whole approach to front-end development to accommodate best practices. I've also been involved with the Drupal Accessibility group since starting at Nomensa, and have written several accessibility-focused Drupal modules, including the [Nomensa Accessible Media Player](http://drupal.org/project/nomensa_amp "The Nomensa Accessible Media Player Drupal module") module and the [Accessibility Checklist](http://drupal.org/project/a11y_checklist "The accessibility checklist for Drupal"). I'll definitely be continuing my interest in accessibility, championing best practices, and incorporating it into my future work wherever possible. -With that all said, I'm really looking forward to starting my new role at Precedent, tackling some new challenges, and I'm sure that it'll be as great a place to work as Nomensa was. \ No newline at end of file +With that all said, I'm really looking forward to starting my new role at Precedent, tackling some new challenges, and I'm sure that it'll be as great a place to work as Nomensa was. 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..46ddf069 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,37 +22,37 @@ 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 PS1="\u@\h:\w\$(parse_git_branch_or_tag) $ " ~~~~ -Restart your Terminal or type `source ~/.bashrc` to see your changes. \ No newline at end of file +Restart your Terminal or type `source ~/.bashrc` to see your changes. 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..220c191b 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: @@ -16,4 +16,4 @@ Here are some useful links that I've found when researching about unit testing i * [SimpleTest Tutorial (Drupal 6)](https://drupal.org/simpletest-tutorial "SimpleTest Tutorial (Drupal 6)") * [SimpleTest Tutorial (Drupal 7)](https://drupal.org/simpletest-tutorial-drupal7 "SimpleTest Tutorial (Drupal 7)") * [SimpleTest Reference](https://drupal.org/node/278126 "SimpleTest Reference") -* [Testing with SimpleTest](https://drupal.org/node/1128366 "Testing with SimpleTest") \ No newline at end of file +* [Testing with SimpleTest](https://drupal.org/node/1128366 "Testing with 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..dd29effd 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,19 +23,19 @@ 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. + ), ); ~~~~ Within each environment-specific domain table, update the subdomain column to contain the appropriate domain names. -**Update:** I've just found out about the Domain Alias sub-module, which you can enable and add aliases to each domain, so you could add the aliases in this way also. \ No newline at end of file +**Update:** I've just found out about the Domain Alias sub-module, which you can enable and add aliases to each domain, so you could add the aliases in this way also. diff --git a/source/_posts/2013-07-26-going-to-drupalcon.md b/source/_posts/2013-07-26-going-to-drupalcon.md index 39a2a9ad..41851f61 100644 --- a/source/_posts/2013-07-26-going-to-drupalcon.md +++ b/source/_posts/2013-07-26-going-to-drupalcon.md @@ -3,11 +3,11 @@ 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). Having wanted to attend the last few Drupalcons (London, especially) but not being able to, I'm definitely looking forward to this one. -See you there! \ No newline at end of file +See you there! 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..38d77124 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: @@ -26,4 +26,4 @@ The parameters that I'm passing it are: This will create a new theme in sites/all/themes/oliverdavies. -For further help, type `$ drush help zen` to see the Drush help page for the zen command. \ No newline at end of file +For further help, type `$ drush help zen` to see the Drush help page for the zen command. 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..633be301 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 +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"). diff --git a/source/_posts/2013-11-27-useful-vagrant-commands.md b/source/_posts/2013-11-27-useful-vagrant-commands.md index efd128c0..45a24845 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: @@ -18,4 +18,4 @@ vagrant suspend | Suspend the Vagrant box. Use "vagrant up" to start the box aga vagrant halt (-f) | Halt the Vagrant box. Use -f to forcefully shut down the box without prompting for confirmation. vagrant destroy (-f) | Destroys a Vagrant box. Use -f to forcefully shut down the box without prompting for confirmation. -The full Vagrant documentation can be found at . \ No newline at end of file +The full Vagrant documentation can be found at . 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 51a4d3f5..c29889ec 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 -v + $ curl http://drupal.org/files/[patch-name].patch | git apply -v Or, if you don't have curl installed, you can use wget: - $ wget -q -O - http://drupal.org/files/[patch-name].patch | git apply -v + $ wget -q -O - http://drupal.org/files/[patch-name].patch | git apply -v 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..acb8c083 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 +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"). 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..83bdb1c2 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: @@ -26,4 +26,4 @@ alias gfi="git flow init" alias gff="git flow feature" alias gfr="git flow release" alias gfh="git flow hotfix" -~~~~ \ No newline at end of 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..9189926e 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). @@ -16,4 +16,4 @@ I'm looking forward to meeting some new people as well as catching up with some If you're also coming, see you there! -**Update:** I've just found out that my session, [What is Git Flow?](http://2014.drupalcamplondon.co.uk/drupalcamp-london-2014/session/what-git-flow "Information about the session on the DrupalCamp website"), has been accepted and will take place on the Sunday morning. It's going to be a busy weekend! \ No newline at end of file +**Update:** I've just found out that my session, [What is Git Flow?](http://2014.drupalcamplondon.co.uk/drupalcamp-london-2014/session/what-git-flow "Information about the session on the DrupalCamp website"), has been accepted and will take place on the Sunday morning. It's going to be a busy weekend! 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..c9a45dab 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). @@ -35,4 +35,4 @@ I've had some great feedback via Twitter: - \ No newline at end of file + diff --git a/source/_posts/2014-05-03-drupal-association.md b/source/_posts/2014-05-03-drupal-association.md index 3c4b8758..035b8f7e 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). @@ -15,4 +15,4 @@ I was able to [contribute some code](https://drupal.org/project/eventsforce) bac It was good to be able to introduce some new tools like [Vagrant](http://www.vagrantup.com), [Puppet](http://www.puppetlabs.com), [SASS](http://www.sass-lang.com) and [Compass](http://www.compass-style.org) into the team. I was pleased to introduce and champion the [Git Flow](http://danielkummer.github.io/git-flow-cheatsheet "Git Flow Cheat Sheet") branching model, which them became the standard approach for all Drupal projects, and hopefully soon all development projects. -Working for the Drupal Association and on Drupal.org was an opportunity that I couldn't refuse, and is certainly going to be a fun and interesting challenge. I can't wait to get started! \ No newline at end of file +Working for the Drupal Association and on Drupal.org was an opportunity that I couldn't refuse, and is certainly going to be a fun and interesting challenge. I can't wait to get started! diff --git a/source/_posts/2014-05-06-thanks.md b/source/_posts/2014-05-06-thanks.md index dee9584b..c26ad2b6 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 +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. diff --git a/source/_posts/2014-05-21-git-format-patch.md b/source/_posts/2014-05-21-git-format-patch.md index 2a3aefec..451e729f 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: @@ -89,4 +89,4 @@ Applying: #2272799 Replaced URL Each line is the commit message associated with that patch. -Assuming that there are no errors, you can go ahead and push your updated code into your remote repository. \ No newline at end of file +Assuming that there are no errors, you can go ahead and push your updated code into your remote repository. diff --git a/source/_posts/2014-07-02-drush-make-drupalbristol.md b/source/_posts/2014-07-02-drush-make-drupalbristol.md index d0b9fb5a..0107e2bc 100644 --- a/source/_posts/2014-07-02-drush-make-drupalbristol.md +++ b/source/_posts/2014-07-02-drush-make-drupalbristol.md @@ -2,12 +2,12 @@ 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). - \ No newline at end of file + 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..d6e80e55 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. @@ -15,4 +15,4 @@ Here are the steps that I took to fix this and point Vagrant back at the correct 1. Stop the machine from running using the `$ vagrant halt` command. 2. Use the `$ VBoxManage list vms` command to view a list of the virtual machines on your system. Note the ID of the correct VM that should be loading. For example, `"foo_default_1405481857614_74478" {e492bfc3-cac2-4cde-a396-e81e37e421e2}`. The number within the curly brackets is the ID of the virtual machine. 3. Within the .vagrant directory in your project (it is hidden by default), update the ID within the machines/default/virtualbox/id file. -4. Start the new VM with `$ vagrant up`. \ No newline at end of file +4. Start the new VM with `$ vagrant up`. 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..14ec05cd 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. @@ -46,4 +46,4 @@ Once finished, the feature is updated in it's original location, so there's no d * [The Features project page on Drupal.org](http://www.drupal.org/project/features) * [The "drush features-components" command](http://www.drushcommands.com/drush-6x/features/features-components) -* [The "drush features-export" command](http://www.drushcommands.com/drush-6x/features/features-export) \ No newline at end of file +* [The "drush features-export" command](http://www.drushcommands.com/drush-6x/features/features-export) 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..33b3a899 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"; 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 b69d54c6..d3a88ddb 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. @@ -25,4 +25,4 @@ If the origin site is not publicly accessible yet, maybe it's a pre-live or stag ~~~php $conf['stage_file_proxy_origin'] = 'http://user:password@prelive.example.com'; -~~~ \ No newline at end of file +~~~ diff --git a/source/_posts/2014-11-27-pantheon-settings-files.md b/source/_posts/2014-11-27-pantheon-settings-files.md index eb502615..d66c159f 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; + } } ~~~ @@ -78,4 +78,4 @@ Within the sites/default directory, I also include an example file (example.sett $base_url = ''; ~~~ -The environment specific files are also committed into Git and pushed to Pantheon, and are then included automatically on each environment. \ No newline at end of file +The environment specific files are also committed into Git and pushed to Pantheon, and are then included automatically on each environment. 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..f76c7ea3 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: @@ -38,4 +38,4 @@ sites/*/files sites/*/private ~~~ -This will allow for settings.php to be added to Git and committed, but not settings.local.php. \ No newline at end of file +This will allow for settings.php to be added to Git and committed, but not settings.local.php. 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..bae5130f 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,10 +39,10 @@ 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', )); ~~~ -In this example, person2@example.com and person3@example.com would receive their emails from the site as normal. Any emails to addresses not in the array would continue to be redirected to person1@example.com. \ No newline at end of file +In this example, person2@example.com and person3@example.com would receive their emails from the site as normal. Any emails to addresses not in the array would continue to be redirected to person1@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 e5d5c5d1..b9edfaa8 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..f4776523 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 +An overview of the [Drupal LDAP module](https://www.drupal.org/project/ldap) and how I integrated and customised it for a client project. 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..8a436f2c 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 +An introduction to Drush and Drush Make. diff --git a/source/_talks/2014-08-19-drupal-association.md b/source/_talks/2014-08-19-drupal-association.md index ecfef7fb..f4f9d581 100644 --- a/source/_talks/2014-08-19-drupal-association.md +++ b/source/_talks/2014-08-19-drupal-association.md @@ -3,11 +3,11 @@ 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 --- -An impromptu talk about the [Drupal Association](https://assoc.drupal.org) and I've done there since joining the team. \ No newline at end of file +An impromptu talk about the [Drupal Association](https://assoc.drupal.org) and I've done there since joining the team. 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 f2ba2134..4efcf0c0 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/assets/Gemfile b/source/assets/Gemfile index bbdf4e7a..c2ecf10b 100644 --- a/source/assets/Gemfile +++ b/source/assets/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 +end diff --git a/source/assets/Gemfile.lock b/source/assets/Gemfile.lock index ce9f7460..ac2acc85 100644 --- a/source/assets/Gemfile.lock +++ b/source/assets/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/assets/sass/base/_base.scss b/source/assets/sass/base/_base.scss index cf8ccee6..3af5ad33 100644 --- a/source/assets/sass/base/_base.scss +++ b/source/assets/sass/base/_base.scss @@ -1,3 +1,3 @@ body { - padding-top: 60px; -} \ No newline at end of file + padding-top: 60px; +} diff --git a/source/assets/sass/base/_lists.scss b/source/assets/sass/base/_lists.scss index e220ea3c..6e3d03a4 100644 --- a/source/assets/sass/base/_lists.scss +++ b/source/assets/sass/base/_lists.scss @@ -1,11 +1,11 @@ dt { - margin-top: .5em; + margin-top: .5em; - &:after { - content: ':'; - } + &:after { + content: ':'; + } } dd { - padding-left: 2em; -} \ No newline at end of file + padding-left: 2em; +} diff --git a/source/assets/sass/base/_tables.scss b/source/assets/sass/base/_tables.scss index ccd39949..1922e7ff 100644 --- a/source/assets/sass/base/_tables.scss +++ b/source/assets/sass/base/_tables.scss @@ -1,3 +1,3 @@ table { - width: 100%; -} \ No newline at end of file + width: 100%; +} diff --git a/source/assets/sass/components/_about-author.scss b/source/assets/sass/components/_about-author.scss index 08c6e654..85a091e4 100644 --- a/source/assets/sass/components/_about-author.scss +++ b/source/assets/sass/components/_about-author.scss @@ -1,8 +1,8 @@ .about-author { - @include clearfix; + @include clearfix; - img { - float: left; - margin: 0 1em 1em 0; - } -} \ No newline at end of file + img { + float: left; + margin: 0 1em 1em 0; + } +} diff --git a/source/assets/sass/components/_footer.scss b/source/assets/sass/components/_footer.scss index 97fa86cf..c421f0bd 100644 --- a/source/assets/sass/components/_footer.scss +++ b/source/assets/sass/components/_footer.scss @@ -1,5 +1,5 @@ .copyright { - border-top: 1px solid #CCC; - margin-top: 1em; - padding-top: 1em; -} \ No newline at end of file + border-top: 1px solid #CCC; + margin-top: 1em; + padding-top: 1em; +} diff --git a/source/assets/sass/components/_latest-posts.scss b/source/assets/sass/components/_latest-posts.scss index 9b98cf10..dfd63d6b 100644 --- a/source/assets/sass/components/_latest-posts.scss +++ b/source/assets/sass/components/_latest-posts.scss @@ -1,6 +1,6 @@ .latest-posts { - li.active a { - color: $dark-gray; - font-weight: $semibold; - } -} \ No newline at end of file + li.active a { + color: $dark-gray; + font-weight: $semibold; + } +} diff --git a/source/assets/sass/components/blocks/_drupalcon-la.scss b/source/assets/sass/components/blocks/_drupalcon-la.scss index b3664007..f1c9ec7c 100644 --- a/source/assets/sass/components/blocks/_drupalcon-la.scss +++ b/source/assets/sass/components/blocks/_drupalcon-la.scss @@ -1,5 +1,5 @@ .block--drupalcon_la { - img { - margin-bottom: .5em; - } -} \ No newline at end of file + img { + margin-bottom: .5em; + } +} diff --git a/source/blog.html.twig b/source/blog.html.twig index 7f783d4f..80a5e465 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 + {% for post in data.posts %} +
  • {{ post.title }}
  • + {% endfor %} + diff --git a/source/blog/tags.html.twig b/source/blog/tags.html.twig index 3b76dfc8..f32490ac 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..e721ca55 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 }}"

    -{% endblock content %} \ No newline at end of file + {% for post in page.tag_posts %} +
  • {{ post.title }}
  • + {% endfor %} + +{% endblock content %} diff --git a/source/blog/tags/tag.xml b/source/blog/tags/tag.xml index 9fdea16e..8467e5e2 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 %} - - \ No newline at end of file + + {{ 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 %} + + diff --git a/source/company-information.md b/source/company-information.md index 63d9af2c..a72b5445 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 @@ -14,4 +14,4 @@ Registered address : 106 Rowan Way, Malpas, Newport, NP20 6JN Company number -: 8017706 \ No newline at end of file +: 8017706 diff --git a/source/contact.md b/source/contact.md index c73963dc..65fba3f5 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 f8020a33..c934282c 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 3110e933..807e957a 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..dbab1a6f 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 %} - \ No newline at end of file + + + {{ 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 %} + 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/work.md b/source/work.md index 9c600792..b066605e 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,18 +15,18 @@ 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 In my spare time, I provide remote freelance consultancy services for Drupal websites and Linux servers. -Services include Drupal site architecture, builds, upgrades and maintenance, custom module development and theming, Linux server administration and configuration management using [Puppet](http://puppetlabs.com) and [Ansible](http://www.ansible.com), and [Jenkins](http://jenkins-ci.org) continuous integration setup and configuration. \ No newline at end of file +Services include Drupal site architecture, builds, upgrades and maintenance, custom module development and theming, Linux server administration and configuration management using [Puppet](http://puppetlabs.com) and [Ansible](http://www.ansible.com), and [Jenkins](http://jenkins-ci.org) continuous integration setup and configuration.