Spaces
This commit is contained in:
parent
dd0e1fb2f7
commit
eed827355e
|
@ -1,27 +1,27 @@
|
|||
sculpin:
|
||||
permalink: pretty
|
||||
ignore:
|
||||
- '_examples/*'
|
||||
- '**/*.scss'
|
||||
- '**/config.rb'
|
||||
- '**/Gemfile*'
|
||||
permalink: pretty
|
||||
ignore:
|
||||
- '_examples/*'
|
||||
- '**/*.scss'
|
||||
- '**/config.rb'
|
||||
- '**/Gemfile*'
|
||||
sculpin_content_types:
|
||||
posts:
|
||||
permalink: blog/:slug_title/
|
||||
taxonomies:
|
||||
- tags
|
||||
projects:
|
||||
enabled: false
|
||||
permalink: projects/:slug_title/
|
||||
taxonomies:
|
||||
- tags
|
||||
talks:
|
||||
permalink: talks/:year/:month/:day/:slug_title/
|
||||
taxonomies:
|
||||
- tags
|
||||
testimonials:
|
||||
enabled: false
|
||||
permalink: testimonials/:slug_title/
|
||||
layout: default
|
||||
posts:
|
||||
permalink: blog/:slug_title/
|
||||
taxonomies:
|
||||
- tags
|
||||
projects:
|
||||
enabled: false
|
||||
permalink: projects/:slug_title/
|
||||
taxonomies:
|
||||
- tags
|
||||
talks:
|
||||
permalink: talks/:year/:month/:day/:slug_title/
|
||||
taxonomies:
|
||||
- tags
|
||||
testimonials:
|
||||
enabled: false
|
||||
permalink: testimonials/:slug_title/
|
||||
layout: default
|
||||
sculpin_theme:
|
||||
theme: opdavies/opdavies
|
||||
theme: opdavies/opdavies
|
||||
|
|
|
@ -17,26 +17,26 @@ lanyrd: http://lanyrd.com/profile/opdavies
|
|||
joindin: https://joind.in/user/view/27119
|
||||
|
||||
bio: >
|
||||
<p><a href="/">Oliver Davies</a> is a Drupal Developer and System Administrator based in the UK. He works for the <a href="https://assoc.drupal.org">Drupal Association</a> and also provides freelance consultancy services for Drupal websites and Linux servers.</p>
|
||||
<p><a href="/">Oliver Davies</a> is a Drupal Developer and System Administrator based in the UK. He works for the <a href="https://assoc.drupal.org">Drupal Association</a> and also provides freelance consultancy services for Drupal websites and Linux servers.</p>
|
||||
|
||||
toolkit:
|
||||
- title: Drupal
|
||||
url: https://www.drupal.org
|
||||
- title: Sculpin
|
||||
url: http://sculpin.io
|
||||
- title: Git
|
||||
url: http://git-scm.com
|
||||
- title: SASS
|
||||
url: http://sass-lang.com
|
||||
- title: Compass
|
||||
url: http://compass-style.org
|
||||
- title: Susy
|
||||
url: http://susy.oddbird.net
|
||||
- title: Grunt
|
||||
url: http://gruntjs.com
|
||||
- title: Vagrant
|
||||
url: http://vagrantup.com
|
||||
- title: Puppet
|
||||
url: http://en.wikipedia.org/wiki/Puppet_%28software%29
|
||||
- title: Jenkins
|
||||
url: http://jenkins-ci.org
|
||||
- title: Drupal
|
||||
url: https://www.drupal.org
|
||||
- title: Sculpin
|
||||
url: http://sculpin.io
|
||||
- title: Git
|
||||
url: http://git-scm.com
|
||||
- title: SASS
|
||||
url: http://sass-lang.com
|
||||
- title: Compass
|
||||
url: http://compass-style.org
|
||||
- title: Susy
|
||||
url: http://susy.oddbird.net
|
||||
- title: Grunt
|
||||
url: http://gruntjs.com
|
||||
- title: Vagrant
|
||||
url: http://vagrantup.com
|
||||
- title: Puppet
|
||||
url: http://en.wikipedia.org/wiki/Puppet_%28software%29
|
||||
- title: Jenkins
|
||||
url: http://jenkins-ci.org
|
||||
|
|
|
@ -3,5 +3,5 @@ title:
|
|||
description:
|
||||
nav: blog
|
||||
tags:
|
||||
-
|
||||
-
|
||||
---
|
|
@ -4,7 +4,7 @@ website:
|
|||
client_name:
|
||||
client_url:
|
||||
tags:
|
||||
-
|
||||
-
|
||||
---
|
||||
Some text about the project.
|
||||
|
||||
|
|
|
@ -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
|
||||
<?php if ($terms): ?>
|
||||
<div class="terms terms-inline">
|
||||
<?php print t('Posted in') . $terms; ?>
|
||||
</div>
|
||||
<div class="terms terms-inline">
|
||||
<?php print t('Posted in') . $terms; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
~~~
|
||||
|
||||
|
@ -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";
|
||||
}
|
||||
~~~
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -3,14 +3,14 @@ title: Conditional Email Addresses in a Webform
|
|||
nav: blog
|
||||
slug: conditional-email-addresses-webform
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- conditional-email
|
||||
- webform
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- conditional-email
|
||||
- webform
|
||||
---
|
||||
I created a new Webform to serve as a simple Contact form, but left the main configuration until after I created the form components. I added 'Name', 'Email', 'Subject' and 'Message' fields, as well as a 'Category' select list. Below 'Options', I entered each of my desired options in the following format:
|
||||
|
||||
Email address|Visible name
|
||||
Email address|Visible name
|
||||
|
||||
I went back to the form configuration page and expanded 'Conditional Email Recipients', and selected my Category. Note that the standard 'Email To' field above it needs to be empty. Originally, I made the mistake of leaving addresses in that field which resulted in people being sent emails regardles of which category was selected. I then configured the rest of the form.
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
title: Quickly Create Zen Subthemes Using Zenophile
|
||||
nav: blog
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- drupal-modules
|
||||
- drupal-theming
|
||||
- zen
|
||||
- zenophile
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- drupal-modules
|
||||
- drupal-theming
|
||||
- zen
|
||||
- zenophile
|
||||
---
|
||||
If you use the [Zen](http://drupal.org/project/zen) theme, then you should also be using the [Zenophile](http://drupal.org/project/zenophile) module!
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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!**
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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):**<br>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):**<br>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):**<br>Quickly create Zen subthemes.
|
||||
* **[Add Another](http://drupal.org/project/addanother):**<br>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.
|
||||
* **[Add Another](http://drupal.org/project/addanother):**<br>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.
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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'.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
@ -16,7 +16,7 @@ In preparation for my Blog posts being added to [Drupal Planet](http://drupal.or
|
|||
|
||||
I didn't want to manually open each post and add the new tag, so I decided to make the changes myself directly into the database using SQL, and as a follow-up to a previous post - [Quickly Change the Content Type of Multiple Nodes using SQL](/blog/change-content-type-multiple-nodes-using-sql).
|
||||
|
||||
**Again, before changing any values within the database, ensure that you have an up-to-date backup which you can restore if you encounter a problem!**
|
||||
**Again, before changing any values within the database, ensure that you have an up-to-date backup which you can restore if you encounter a problem!**
|
||||
|
||||
The first thing I did was create the 'Drupal Planet' term in my Tags vocabulary. I decided to do this via the administration area of my site, and not via the database. Then, using [Sequel Pro](http://www.sequelpro.com), I ran the following SQL query to give me a list of Blog posts on my site - showing just their titles and nid values.
|
||||
|
||||
|
@ -27,13 +27,13 @@ SELECT title, nid FROM node WHERE TYPE = 'blog' ORDER BY title ASC;
|
|||
I made a note of the nid's of the returned nodes, and kept them for later. I then ran a similar query against the term_data table. This returned a list of Taxonomy terms - showing the term's name, and it's unique tid value.
|
||||
|
||||
~~~sql
|
||||
SELECT NAME, tid FROM term_data ORDER BY NAME ASC;
|
||||
SELECT NAME, tid FROM term_data ORDER BY NAME ASC;
|
||||
~~~
|
||||
|
||||
The term that I was interested in, Drupal Planet, had the tid of 84. To confirm that no nodes were already assigned a taxonomy term with this tid, I ran another query against the database. I'm using aliases within this query to link the node, term_node and term_data tables. For more information on SQL aliases, take a look at <http://w3schools.com/sql/sql_alias.asp>.
|
||||
|
||||
~~~sql
|
||||
SELECT * FROM node n, term_data td, term_node tn WHERE td.tid = 84 AND n.nid = tn.nid AND tn.tid = td.tid;
|
||||
SELECT * FROM node n, term_data td, term_node tn WHERE td.tid = 84 AND n.nid = tn.nid AND tn.tid = td.tid;
|
||||
~~~
|
||||
|
||||
As expected, it returned no rows.
|
||||
|
|
|
@ -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))*.
|
||||
|
||||
|
|
|
@ -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!
|
||||
|
||||
|
|
|
@ -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
|
||||
<?php
|
||||
|
@ -97,27 +97,27 @@ This was all then added into a 'print' statement which displayed it into the pag
|
|||
~~~php
|
||||
<?php
|
||||
if ($selected_gallery_total != 0) {
|
||||
$output = '<i>There are currently ' . $selected_gallery_total . ' photos in this gallery.';
|
||||
$output .= 'Last one added on ' . $latest_photo . '</i>';
|
||||
print $output;
|
||||
$output = '<i>There are currently ' . $selected_gallery_total . ' photos in this gallery.';
|
||||
$output .= 'Last one added on ' . $latest_photo . '</i>';
|
||||
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
|
||||
<?php
|
||||
if ($selected_gallery_total != 0) {
|
||||
$output = '<i>There are currently ' . $selected_gallery_total . ' photos in this gallery.';
|
||||
$output .= 'Last one added on ' . date("l, jS F, Y", $latest_photo) . '.</i>';
|
||||
print $output;
|
||||
$output = '<i>There are currently ' . $selected_gallery_total . ' photos in this gallery.';
|
||||
$output .= 'Last one added on ' . date("l, jS F, Y", $latest_photo) . '.</i>';
|
||||
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.
|
||||
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.
|
|
@ -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 <http://www.onlineconversion.com/unix_time.htm>, 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 <http://www.onlineconversion.com/unix_time.htm>, 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.
|
||||
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.
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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!
|
||||
|
||||
|
|
|
@ -3,26 +3,26 @@ title: How to Create and Apply Patches
|
|||
nav: blog
|
||||
slug: create-and-apply-patches
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- modules
|
||||
- patches
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- modules
|
||||
- patches
|
||||
---
|
||||
Earlier this year, I posted a solution to [an issue](http://drupal.org/node/753898) on the Drupal.org issue queue. Originally, I just posted the code back onto the issue, but have now created a patch that can easily be applied to any Drupal 6 installation. Here is a run-through of the process of creating and applying a patch. In this case, I made changes to the `user_pass_validate()` function that's found within `modules/user/user.pages.inc`.
|
||||
|
||||
To begin with, a download a fresh copy of Drupal 6.19 and created a copy of the original user.pages.inc file. Within the duplicate file, I made the same changes to the function that I did in earlier code, and saved the changes. Now, within my Terminal, I can navigate to Drupal's root directory and create the patch.
|
||||
|
||||
diff -rup modules/user/user.pages.inc modules/user/user.pages2.inc > /Users/oliver/Desktop/different_messages_for_blocked_users.patch
|
||||
diff -rup modules/user/user.pages.inc modules/user/user.pages2.inc > /Users/oliver/Desktop/different_messages_for_blocked_users.patch
|
||||
|
||||
This command compares the differences between the two files, and creates the specified patch file.
|
||||
|
||||
To apply the patch to my Drupal installation, I go back to Terminal and run the following code:
|
||||
|
||||
patch -p0 < /Users/oliver/Desktop/different_messages_for_blocked_users.patch
|
||||
patch -p0 < /Users/oliver/Desktop/different_messages_for_blocked_users.patch
|
||||
|
||||
If, for some reason, I need to reverse the patch, I can run this code:
|
||||
|
||||
patch -p0 -R < /Users/oliver/Desktop/different_messages_for_blocked_users.patch
|
||||
patch -p0 -R < /Users/oliver/Desktop/different_messages_for_blocked_users.patch
|
||||
|
||||
And that's it!
|
||||
|
||||
|
|
|
@ -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
|
|||
<?php
|
||||
$terms = db_query("SELECT * FROM {term_data} WHERE vid = 1");
|
||||
while ($term = db_fetch_array($terms)) {
|
||||
print '<h3>' . $term['name'] . '</h3>';
|
||||
print views_embed_view('gallery', 'page_2', $term['name']);
|
||||
print '<h3>' . $term['name'] . '</h3>';
|
||||
print views_embed_view('gallery', 'page_2', $term['name']);
|
||||
}
|
||||
?>
|
||||
~~~
|
|
@ -3,7 +3,7 @@ title: Create a Better Photo Gallery in Drupal - Part 2.1
|
|||
nav: blog
|
||||
slug: create-better-photo-gallery-drupal-part-21
|
||||
tags:
|
||||
- drupal
|
||||
- drupal
|
||||
---
|
||||
Today, I realised that I hadn't published the code that I used to create the total figures of galleries and photos at the top of the gallery (I said at the end of [Part 2](/blog/create-better-photo-gallery-drupal-part-2 "Create a Better Photo Gallery in Drupal - Part 2") that I'd include it in [Part 3](/blog/create-better-photo-gallery-drupal-part-3 "Create a Better Photo Gallery in Drupal - Part 3"), but I forgot). So, here it is:
|
||||
|
||||
|
@ -16,38 +16,38 @@ $galleries = db_query("SELECT nid FROM {node} WHERE type = 'gallery' AND status
|
|||
$output = 0;
|
||||
// Prints a list of nids of published galleries.
|
||||
while($gallery = db_fetch_array($galleries)) {
|
||||
$gallery_id = $gallery['nid'];
|
||||
$photos = $photos + db_result(db_query("SELECT COUNT(*) FROM node n, content_type_photo ctp WHERE n.status = 1 AND n.type = 'photo' AND ctp.field_gallery_nid = $gallery_id AND n.nid = ctp.nid"));
|
||||
$gallery_id = $gallery['nid'];
|
||||
$photos = $photos + db_result(db_query("SELECT COUNT(*) FROM node n, content_type_photo ctp WHERE n.status = 1 AND n.type = 'photo' AND ctp.field_gallery_nid = $gallery_id AND n.nid = ctp.nid"));
|
||||
}
|
||||
|
||||
|
||||
// Prints the output.
|
||||
print 'There ';
|
||||
if($photos == 1) {
|
||||
print 'is';
|
||||
print 'is';
|
||||
}
|
||||
else {
|
||||
print 'are';
|
||||
print 'are';
|
||||
}
|
||||
print ' currently ';
|
||||
print $photos . ' ';
|
||||
if($photos == 1) {
|
||||
print 'photo';
|
||||
print 'photo';
|
||||
}
|
||||
else {
|
||||
print 'photos';
|
||||
print 'photos';
|
||||
}
|
||||
print ' in ';
|
||||
|
||||
|
||||
// Counts the number of published galleries on the site.
|
||||
$galleries = db_result(db_query("SELECT COUNT(*) FROM {node} WHERE TYPE = 'gallery' AND STATUS = 1"));
|
||||
|
||||
|
||||
// Prints the number of published galleries.
|
||||
print $galleries;
|
||||
if ($galleries == 1) {
|
||||
print ' gallery';
|
||||
print ' gallery';
|
||||
}
|
||||
else {
|
||||
print ' galleries';
|
||||
print ' galleries';
|
||||
}
|
||||
print '.';
|
||||
?>
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ title: Proctor & Stevenson
|
|||
nav: blog
|
||||
slug: proctor-stevenson
|
||||
tags:
|
||||
- personal
|
||||
- personal
|
||||
---
|
||||
2 weeks ago, I handed in my notice of resignation to [Horse & Country TV](http://horseandcountry.tv)because I've been offered a new role at [Proctor & Stevenson](http://proctors.co.uk) - a Marketing Design and Communications agency in Bristol.
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ title: Proctors Hosting the next Drupal Meetup
|
|||
nav: blog
|
||||
slug: proctors-hosting-next-drupal-meetup
|
||||
tags:
|
||||
- meetups
|
||||
- drupal-bristol
|
||||
- meetups
|
||||
- drupal-bristol
|
||||
---
|
||||
My employer, [Proctor & Stevenson](http://www.proctors.co.uk), are going to be hosting the next Bristol & South West Drupal meetup on the 25th May at our offices.
|
||||
|
||||
|
|
|
@ -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!
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
~~~
|
||||
<Location "/svn">
|
||||
DAV svn
|
||||
SVNParentPath /home/svn
|
||||
DAV svn
|
||||
SVNParentPath /home/svn
|
||||
</Location>
|
||||
~~~
|
||||
|
||||
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:
|
|||
|
||||
~~~~
|
||||
<Location "/svn">
|
||||
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
|
||||
</Location>
|
||||
~~~~
|
||||
|
||||
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.
|
||||
|
|
|
@ -3,17 +3,17 @@ title: How to use Authorized Keys to Create a Passwordless SSH Connection
|
|||
nav: blog
|
||||
slug: use-authorized-keys-create-passwordless-ssh-connection
|
||||
tags:
|
||||
- linux
|
||||
- ssh
|
||||
- linux
|
||||
- ssh
|
||||
---
|
||||
If you're accessing Linux servers or automating tasks between servers, rather than having to enter your user password every time, you can also use SSH public key authentication. This is a simple process that involves creating a local key and storing it within the *authorized_keys* file on the remote server.
|
||||
|
||||
1. Check if you already have a SSH key.
|
||||
`$ ssh-add -L`
|
||||
`$ ssh-add -L`
|
||||
2. If you don't have one, create one.
|
||||
`$ ssh-keygen`
|
||||
`$ ssh-keygen`
|
||||
2. Upload the key onto the server. Replace *myserver* with the hostname or IP address of your remote server.
|
||||
`$ ssh-copy-id myserver`
|
||||
`$ ssh-copy-id myserver`
|
||||
|
||||
If you're using Mac OS X and you don't have ssh-copy-id installed, download and install [Homebrew](http://mxcl.github.com/homebrew "Homebrew") and run the `brew install ssh-copy-id` command.
|
||||
|
||||
|
@ -21,7 +21,7 @@ If successful, you should now see a message like:
|
|||
|
||||
> Now try logging into the machine, with "ssh 'myserver'", and check in:
|
||||
>
|
||||
> ~/.ssh/authorized_keys
|
||||
> ~/.ssh/authorized_keys
|
||||
>
|
||||
> to make sure we haven't added extra keys that you weren't expecting.
|
||||
|
||||
|
|
|
@ -3,31 +3,31 @@ title: Create an Omega Subtheme with LESS CSS Preprocessor using Omega Tools and
|
|||
nav: blog
|
||||
slug: create-omega-subtheme-less-css-preprocessor-using-omega-tools-and-drush
|
||||
tags:
|
||||
- drupal-7
|
||||
- omega
|
||||
- theming
|
||||
- less
|
||||
- drupal-planet
|
||||
- drupal
|
||||
- drupal-7
|
||||
- omega
|
||||
- theming
|
||||
- less
|
||||
- drupal-planet
|
||||
- drupal
|
||||
---
|
||||
In this tutorial I'll be showing how to create an [Omega](http://drupal.org/project/omega) subtheme using the [Omega Tools](http://drupal.org/project/omega_tools) module, and have it working with the [LESS CSS preprocessor](http://lesscss.org).
|
||||
|
||||
The first thing that I need to do is download the Omega theme and the Omega Tools and [LESS](http://drupal.org/project/less "LESS module on drupal.org") modules, and then to enable both modules. I'm doing this using Drush, but you can of course do this via the admin interface at admin/modules.
|
||||
|
||||
$ drush dl less omega omega_tools;
|
||||
$ drush en -y less omega_tools
|
||||
$ drush dl less omega omega_tools;
|
||||
$ drush en -y less omega_tools
|
||||
|
||||
With the Omega Tools module enabled I get the drush omega-subtheme command that creates my Omega subtheme programatically. Using this command, I'm creating a new subtheme, enabling it and setting it as the default theme on my site.
|
||||
|
||||
$ drush omega-subtheme "Oliver Davies" --machine_name="oliverdavies" --enable --set-default
|
||||
$ drush omega-subtheme "Oliver Davies" --machine_name="oliverdavies" --enable --set-default
|
||||
|
||||
By default, four stylesheets are created within the subtheme's css directory. The first thing that I'm going to do is rename `global.css` to `global.less`.
|
||||
|
||||
$ mv css/global.css css/global.less
|
||||
$ mv css/global.css css/global.less
|
||||
|
||||
Now I need to find all references to global.css within my oliverdavies.info file. I did this using `$ nano oliverdavies.info`, pressing `Ctrl+W` to search, then `Ctrl+R` to replace, entering `global.css` as the search phrase, and then `global.less` as the replacement text. After making any changes to oliverdavies.info, I need to clear Drupal's caches for the changes to be applied.
|
||||
|
||||
$ drush cc all
|
||||
$ drush cc all
|
||||
|
||||
I tested my changes by making some quick additions to my global.less file and reloading the page.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
title: Adding Custom Theme Templates in Drupal 7
|
||||
nav: blog
|
||||
description: >
|
||||
Today, I had a situation where I was displaying a list of teasers for news article nodes. The article content type had several different fields assigned to it, including main and thumbnail images. In this case, I wanted to have different output and fields displayed when a teaser was displayed compared to when a complete node was displayed.
|
||||
Today, I had a situation where I was displaying a list of teasers for news article nodes. The article content type had several different fields assigned to it, including main and thumbnail images. In this case, I wanted to have different output and fields displayed when a teaser was displayed compared to when a complete node was displayed.
|
||||
slug: adding-custom-theme-templates-drupal-7
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- drupal
|
||||
---
|
||||
Today, I had a situation where I was displaying a list of teasers for news article nodes. The article content type had several different fields assigned to it, including main and thumbnail images. In this case, I wanted to have different output and fields displayed when a teaser was displayed compared to when a complete node was displayed.
|
||||
|
||||
|
@ -14,10 +14,10 @@ I have previously seen it done this way by adding this into in a node.tpl.php fi
|
|||
|
||||
~~~~
|
||||
if ($teaser) {
|
||||
// The teaser output.
|
||||
// The teaser output.
|
||||
}
|
||||
else {
|
||||
// The whole node output.
|
||||
// The whole node output.
|
||||
}
|
||||
~~~~
|
||||
|
||||
|
@ -27,10 +27,10 @@ The function requires the node variables as an argument - one of which is theme_
|
|||
|
||||
~~~~php
|
||||
array (
|
||||
0 => 'node__article',
|
||||
1 => 'node__343',
|
||||
2 => 'node__view__latest_news',
|
||||
3 => 'node__view__latest_news__page',
|
||||
0 => 'node__article',
|
||||
1 => 'node__343',
|
||||
2 => 'node__view__latest_news',
|
||||
3 => 'node__view__latest_news__page',
|
||||
)
|
||||
~~~~
|
||||
|
||||
|
@ -41,12 +41,12 @@ So, within my theme's template.php file:
|
|||
* Implementation of hook_preprocess_HOOK().
|
||||
*/
|
||||
function mytheme_preprocess_node(&$variables) {
|
||||
$node = $variables['node'];
|
||||
|
||||
if ($variables['teaser']) {
|
||||
// Add a new item into the theme_hook_suggestions array.
|
||||
$variables['theme_hook_suggestions'][] = 'node__' . $node->type . '_teaser';
|
||||
}
|
||||
$node = $variables['node'];
|
||||
|
||||
if ($variables['teaser']) {
|
||||
// Add a new item into the theme_hook_suggestions array.
|
||||
$variables['theme_hook_suggestions'][] = 'node__' . $node->type . '_teaser';
|
||||
}
|
||||
}
|
||||
~~~~
|
||||
|
||||
|
@ -54,11 +54,11 @@ After adding the new suggestion:
|
|||
|
||||
~~~~php
|
||||
array (
|
||||
0 => 'node__article',
|
||||
1 => 'node__343',
|
||||
2 => 'node__view__latest_news',
|
||||
3 => 'node__view__latest_news__page',
|
||||
4 => 'node__article_teaser',
|
||||
0 => 'node__article',
|
||||
1 => 'node__343',
|
||||
2 => 'node__view__latest_news',
|
||||
3 => 'node__view__latest_news__page',
|
||||
4 => 'node__article_teaser',
|
||||
)
|
||||
~~~~
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
||||
<Files ~ "\.txt$">
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</Files>
|
||||
<Files ~ "\.txt$">
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</Files>
|
||||
|
||||
This prevents any files with a .txt extension from being accessed and rendered in a web browser.
|
|
@ -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
|
||||
svn up -r 1234
|
|
@ -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()),
|
||||
);
|
||||
~~~
|
|
@ -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.
|
|
@ -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
|
||||
|
|
|
@ -4,10 +4,10 @@ nav: blog
|
|||
description: If you use a lot of process and preprocess functions within your Drupal theme, then your template.php can get very long and it can become difficult to find a certain piece of code. Following the example of the Omega theme, I've started separating my process and preprocess functions into their own files.
|
||||
slug: dividing-drupals-process-and-preprocess-functions-separate-files
|
||||
tags:
|
||||
- drupal
|
||||
- code
|
||||
- theming
|
||||
- preprocessing
|
||||
- drupal
|
||||
- code
|
||||
- theming
|
||||
- preprocessing
|
||||
---
|
||||
If you use a lot of process and preprocess functions within your Drupal theme, then your template.php can get very long and it can become difficult to find a certain piece of code. Following the example of the [Omega theme](http://drupal.org/project/omega "The Omega theme on Drupal.org"), I've started separating my process and preprocess functions into their own files. For example, mytheme_preprocess_node can be placed within a preprocess/node.inc file, and mytheme_process_page can be placed within process/page.inc.
|
||||
|
||||
|
@ -22,7 +22,7 @@ The first step is to use the default mytheme_process() and mytheme_preprocess()
|
|||
* Initialises the mytheme_invoke() function for the preprocess hook.
|
||||
*/
|
||||
function mytheme_preprocess(&$variables, $hook) {
|
||||
mytheme_invoke('preprocess', $hook, $variables);
|
||||
mytheme_invoke('preprocess', $hook, $variables);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -31,7 +31,7 @@ function mytheme_preprocess(&$variables, $hook) {
|
|||
* Initialises the mytheme_invoke() function for the process hook.
|
||||
*/
|
||||
function mytheme_process(&$variables, $hook) {
|
||||
mytheme_invoke('process', $hook, $variables);
|
||||
mytheme_invoke('process', $hook, $variables);
|
||||
}
|
||||
~~~
|
||||
|
||||
|
@ -44,39 +44,39 @@ Now, to write the `mytheme_invoke()` function:
|
|||
* Invokes custom process and preprocess functions.
|
||||
*
|
||||
* @param string $type
|
||||
* The type of function we are trying to include (i.e. process or preprocess).
|
||||
* The type of function we are trying to include (i.e. process or preprocess).
|
||||
*
|
||||
* @param array $variables
|
||||
* The variables array.
|
||||
* The variables array.
|
||||
*
|
||||
* @param string $hook
|
||||
* The name of the hook.
|
||||
*
|
||||
* @see mytheme_preprocess()
|
||||
* The name of the hook.
|
||||
*
|
||||
* @see mytheme_preprocess()
|
||||
* @see mytheme_process()
|
||||
*/
|
||||
function mytheme_invoke($type, $hook, &$variables) {
|
||||
global $theme_key;
|
||||
|
||||
// The name of the function to look for (e.g. mytheme_process_node).
|
||||
$function = $theme_key . '_' . $type . '_' . $hook;
|
||||
global $theme_key;
|
||||
|
||||
// The name of the function to look for (e.g. mytheme_process_node).
|
||||
$function = $theme_key . '_' . $type . '_' . $hook;
|
||||
|
||||
// If the function doesn't exist within template.php, look for the
|
||||
// appropriate include file.
|
||||
if (!function_exists($function)) {
|
||||
// The file to search for (e.g. process/node.inc).
|
||||
$file = drupal_get_path('theme', $theme_key) . '/' . $type . '/' . $type . '-' . str_replace('_', '-', $hook) . '.inc';
|
||||
// If the function doesn't exist within template.php, look for the
|
||||
// appropriate include file.
|
||||
if (!function_exists($function)) {
|
||||
// The file to search for (e.g. process/node.inc).
|
||||
$file = drupal_get_path('theme', $theme_key) . '/' . $type . '/' . $type . '-' . str_replace('_', '-', $hook) . '.inc';
|
||||
|
||||
// If the file exists, include it.
|
||||
if (is_file($file)) {
|
||||
include($file);
|
||||
// If the file exists, include it.
|
||||
if (is_file($file)) {
|
||||
include($file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Try to call the function again.
|
||||
if (function_exists($function)) {
|
||||
$function($variables);
|
||||
}
|
||||
// Try to call the function again.
|
||||
if (function_exists($function)) {
|
||||
$function($variables);
|
||||
}
|
||||
}
|
||||
~~~
|
||||
|
||||
|
|
|
@ -3,12 +3,12 @@ title: My new Drupal modules
|
|||
nav: blog
|
||||
description: After a busy few days, I've released two new contrib Drupal modules.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-modules
|
||||
- drupal-6
|
||||
- drupal-7
|
||||
- drupal-planet
|
||||
- accessibility
|
||||
- drupal
|
||||
- drupal-modules
|
||||
- drupal-6
|
||||
- drupal-7
|
||||
- drupal-planet
|
||||
- accessibility
|
||||
---
|
||||
After a busy few days, I've released two new contrib Drupal modules:
|
||||
|
||||
|
|
|
@ -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 <https://www.drupal.org/node/2383447>. 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
|
||||
|
||||
<a href="http://www.youtube.com/watch?v=Zi31YMGmQC4">Checking colour contrast</a>
|
||||
<a href="http://www.youtube.com/watch?v=Zi31YMGmQC4">Checking colour contrast</a>
|
||||
|
||||
### Vimeo
|
||||
|
||||
<a href="http://vimeo.com/33729937">Screen readers are strange, when you're a stranger by Leonie Watson</a>
|
||||
<a href="http://vimeo.com/33729937">Screen readers are strange, when you're a stranger by Leonie Watson</a>
|
||||
|
||||
## Adding captions
|
||||
|
||||
|
@ -51,8 +51,8 @@ The best way that I can suggest to do this is to use a File field to upload your
|
|||
3. Right-click the uploaded file, copy the link location, and use this for the path to your captions file.
|
||||
|
||||
For example:
|
||||
|
||||
<a href="http://www.youtube.com/watch?v=Zi31YMGmQC4">Checking colour contrast</a> <a class="captions" href="http://oliverdavies.co.uk/sites/default/files/checking-colour-contrast-captions.xml">Captions for Checking Colour Contrast</a>
|
||||
|
||||
<a href="http://www.youtube.com/watch?v=Zi31YMGmQC4">Checking colour contrast</a> <a class="captions" href="http://oliverdavies.co.uk/sites/default/files/checking-colour-contrast-captions.xml">Captions for Checking Colour Contrast</a>
|
||||
|
||||
## Screencast
|
||||
|
||||
|
|
|
@ -4,11 +4,11 @@ nav: blog
|
|||
description: I'm absolutely delighted to announce that I'm going to be writing an article for Linux Journal magazine's upcoming Drupal special.
|
||||
slug: writing-article-linux-journal
|
||||
tags:
|
||||
- drupal
|
||||
- distributions
|
||||
- installation-profiles
|
||||
- writing
|
||||
- linux-journal
|
||||
- drupal
|
||||
- distributions
|
||||
- installation-profiles
|
||||
- writing
|
||||
- linux-journal
|
||||
---
|
||||
I'm absolutely delighted to announce that I'm going to be writing an article for [Linux Journal](http://www.linuxjournal.com) magazine's upcoming Drupal special. The article is going to be entitled "Speeding Up Your Drupal Development Using Installation Profiles and Distributions" and will be mentioning existing distributions available on Drupal.org, but mainly focussing on the steps needed to create your own custom distribution. Needless to say, I'm quite excited about it!
|
||||
|
||||
|
|
|
@ -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')
|
||||
)
|
||||
));
|
||||
~~~
|
||||
|
|
|
@ -4,7 +4,7 @@ nav: blog
|
|||
description: Yesterday evening I went to and spoke at the <a href="http://www.unifieddiff.co.uk" title="UnifiedDiff">UnifiedDiff meetup</a> 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.
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ title: My Sublime Text 2 settings
|
|||
nav: blog
|
||||
description: <a href="http://www.sublimetext.com/2" title="Sublime Text 2">Sublime Text 2</a> 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" }
|
||||
]
|
||||
~~~
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@ title: Accessible Bristol site launched
|
|||
nav: blog
|
||||
description: I'm happy to report that the Accessible Bristol was launched this week, on Drupal 7.
|
||||
tags:
|
||||
- accessibility
|
||||
- accessible-bristol
|
||||
- nomensa
|
||||
- accessibility
|
||||
- accessible-bristol
|
||||
- nomensa
|
||||
---
|
||||
I'm happy to report that the [Accessible Bristol](http://www.accessiblebristol.org.uk) website was launched this week, on Drupal 7. The site's been developed over the past few months, and uses the [User Relationships](http://drupal.org/project/user_relationships) and [Privatemsg](http://drupal.org/project/privatemsg) modules to provide a community-based platform where people with an interest in accessibility can register and network with each other.
|
||||
|
||||
|
|
|
@ -3,13 +3,13 @@ title: Open Sublime Text 2 from the Mac OS X Command Line
|
|||
nav: blog
|
||||
slug: open-sublime-text-2-mac-os-x-command-line
|
||||
tags:
|
||||
- sublime-text
|
||||
- mac-os-x
|
||||
- terminal
|
||||
- sublime-text
|
||||
- mac-os-x
|
||||
- terminal
|
||||
---
|
||||
Paste the following code into the Mac OS X Terminal, assuming that you've installed Sublime Text 2 into the /Applications folder.
|
||||
|
||||
$ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/sublime
|
||||
$ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/sublime
|
||||
|
||||
Now you can type `sublime <filename>` open a file or directory in Sublime Text, or `sublime .` to open the current directory.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -4,18 +4,18 @@ nav: blog
|
|||
description: How to check if a user is logged into Drupal by using the user_is_logged_in() and user_is_anonymous() functions.
|
||||
slug: checking-if-user-logged-drupal-right-way
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-6
|
||||
- drupal-7
|
||||
- drupal-planet
|
||||
- php
|
||||
- drupal
|
||||
- drupal-6
|
||||
- drupal-7
|
||||
- drupal-planet
|
||||
- php
|
||||
---
|
||||
I see this regularly when working on Drupal sites when someone wants to check whether the current user is logged in to Drupal (authenticated) or not (anonymous):
|
||||
|
||||
~~~~
|
||||
global $user;
|
||||
if ($user->uid) {
|
||||
// The user is logged in.
|
||||
// The user is logged in.
|
||||
}
|
||||
~~~~
|
||||
|
||||
|
@ -24,7 +24,7 @@ or
|
|||
~~~~
|
||||
global $user;
|
||||
if (!$user->uid) {
|
||||
// The user is not logged in.
|
||||
// The user is not logged in.
|
||||
}
|
||||
~~~~
|
||||
|
||||
|
@ -32,7 +32,7 @@ The better way to do this is to use the [user_is_logged_in()](http://api.drupal.
|
|||
|
||||
~~~~
|
||||
if (user_is_logged_in()) {
|
||||
// Do something.
|
||||
// Do something.
|
||||
}
|
||||
~~~~
|
||||
|
||||
|
@ -45,13 +45,13 @@ A great use case for this is within a `hook_menu()` implementation within a cust
|
|||
* Implements hook_menu().
|
||||
*/
|
||||
function mymodule_menu() {
|
||||
$items['foo'] = array(
|
||||
'title' => 'Foo',
|
||||
'page callback' => 'mymodule_foo',
|
||||
'access callback' => 'user_is_logged_in',
|
||||
);
|
||||
$items['foo'] = array(
|
||||
'title' => 'Foo',
|
||||
'page callback' => 'mymodule_foo',
|
||||
'access callback' => 'user_is_logged_in',
|
||||
);
|
||||
|
||||
return $items;
|
||||
return $items;
|
||||
}
|
||||
~~~~
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
~~~
|
||||
|
||||
|
|
|
@ -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.
|
|
@ -3,9 +3,9 @@ title: Leaving Nomensa, Joining Precedent
|
|||
nav: blog
|
||||
description: Yesterday was my last day working at Nomensa. Next week, I'll be starting as a Senior Developer at Precedent.
|
||||
tags:
|
||||
- nomensa
|
||||
- precedent
|
||||
- personal
|
||||
- nomensa
|
||||
- precedent
|
||||
- personal
|
||||
---
|
||||
Yesterday was my last day working at [Nomensa](http://www.nomensa.com "Nomensa"). Next week, I'll be starting as a Senior Developer at [Precedent](http://www.precedent.co.uk "Precedent").
|
||||
|
||||
|
|
|
@ -4,10 +4,10 @@ nav: blog
|
|||
description: Whilst watching Drupalize.me's recent Introduction to Git series, I thought it was useful the way that the current Git branch or tag name was displayed in the bash prompt. Here's how to do it.
|
||||
slug: display-git-branch-or-tag-names-your-bash-prompt
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- git
|
||||
- terminal
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- git
|
||||
- terminal
|
||||
---
|
||||
Whilst watching [Drupalize.me](http://drupalize.me "Drupalize.me")'s recent [Introduction to Git series](http://drupalize.me/series/introduction-git-series "Introduction to Git on Drupalize.me"), I thought it was useful the way that the current Git branch or tag name was displayed in the bash prompt.
|
||||
|
||||
|
@ -22,33 +22,33 @@ Here's how to do it.
|
|||
|
||||
To begin with, create a new file to contain the functions,
|
||||
|
||||
vim ~/.bash/git-prompt
|
||||
vim ~/.bash/git-prompt
|
||||
|
||||
Paste the following code into the file, and save it.
|
||||
|
||||
~~~~
|
||||
parse_git_branch () {
|
||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
||||
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
|
||||
}
|
||||
|
||||
parse_git_tag () {
|
||||
git describe --tags 2> /dev/null
|
||||
git describe --tags 2> /dev/null
|
||||
}
|
||||
|
||||
parse_git_branch_or_tag() {
|
||||
local OUT="$(parse_git_branch)"
|
||||
if [ "$OUT" == " ((no branch))" ]; then
|
||||
OUT="($(parse_git_tag))";
|
||||
fi
|
||||
echo $OUT
|
||||
local OUT="$(parse_git_branch)"
|
||||
if [ "$OUT" == " ((no branch))" ]; then
|
||||
OUT="($(parse_git_tag))";
|
||||
fi
|
||||
echo $OUT
|
||||
}
|
||||
~~~~
|
||||
|
||||
Edit your `.bashrc` or `.bash_profile` file to override the PS1 value.
|
||||
|
||||
vim ~/.bashrc
|
||||
vim ~/.bashrc
|
||||
|
||||
Add the following code at the bottom of the file, and save it.
|
||||
Add the following code at the bottom of the file, and save it.
|
||||
|
||||
~~~~
|
||||
source ~/.bash/git-prompt
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -3,11 +3,11 @@ title: Creating Local and Staging sites with Drupal's Domain Module Enabled
|
|||
nav: blog
|
||||
slug: creating-local-and-staging-sites-drupals-domain-module-enabled
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- databases
|
||||
- domain
|
||||
- table-prefixing
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- databases
|
||||
- domain
|
||||
- table-prefixing
|
||||
---
|
||||
The [Domain Access project](https://drupal.org/project/domain "The Domain Access project on Drupal.org") is a suite of modules that provide tools for running a group of affiliated sites from one Drupal installation and a single shared database. The issue is that the domains are stored within the database so these are copied across when the data is migrated between environments, whereas the domains are obviously going to change.
|
||||
|
||||
|
@ -23,16 +23,16 @@ Within each site's settings.php file, define the prefix for the domain table wit
|
|||
|
||||
~~~~php
|
||||
$databases['default']['default'] = array(
|
||||
'driver' => 'mysql',
|
||||
'database' => 'foobar',
|
||||
'username' => 'foo',
|
||||
'password' => 'bar',
|
||||
'host' => 'localhost',
|
||||
'prefix' => array(
|
||||
'default' => '',
|
||||
'domain' => 'local_', // This will use the local_domain table.
|
||||
// Add any other prefixed tables here.
|
||||
),
|
||||
'driver' => 'mysql',
|
||||
'database' => 'foobar',
|
||||
'username' => 'foo',
|
||||
'password' => 'bar',
|
||||
'host' => 'localhost',
|
||||
'prefix' => array(
|
||||
'default' => '',
|
||||
'domain' => 'local_', // This will use the local_domain table.
|
||||
// Add any other prefixed tables here.
|
||||
),
|
||||
);
|
||||
~~~~
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ title: Going to DrupalCon
|
|||
nav: blog
|
||||
slug: going-drupalcon
|
||||
tags:
|
||||
- drupalcon
|
||||
- precedent
|
||||
- drupalcon
|
||||
- precedent
|
||||
---
|
||||
[Precedent](http://www.precedent.co.uk) are sending myself and two of our other Drupal Developers to [Drupalcon Prague](http://prague2013.drupal.org).
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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").
|
|
@ -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 <a href="http://vagrantup.com" title="The Vagrant Home page">Vagrant</a>.
|
||||
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:
|
||||
|
||||
|
|
|
@ -3,18 +3,18 @@ title: Quickly Apply Patches Using Git and curl or wget
|
|||
nav: blog
|
||||
description: How to quickly download a patch file and apply it to a Git repository in one line
|
||||
tags:
|
||||
- git
|
||||
- drupal-planet
|
||||
- git
|
||||
- drupal-planet
|
||||
---
|
||||
Testing a patch file is usually a two-step process. First you download the patch file from the source, and then you run a separate command to apply it.
|
||||
|
||||
You can save time and typing by running the two commands on one line:
|
||||
|
||||
$ curl http://drupal.org/files/[patch-name].patch | git apply
|
||||
$ curl http://drupal.org/files/[patch-name].patch | git apply
|
||||
|
||||
Or, if you don't have curl installed, you can use wget:
|
||||
|
||||
$ wget -q -O - http://drupal.org/files/[patch-name].patch | git apply
|
||||
$ wget -q -O - http://drupal.org/files/[patch-name].patch | git apply
|
||||
|
||||
These commands need to be run within the root of your Git repository (i.e. where the .git directory is).
|
||||
|
||||
|
|
|
@ -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").
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -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).
|
||||
|
||||
|
|
|
@ -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).
|
||||
|
|
|
@ -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).
|
||||
|
||||
|
|
|
@ -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.
|
|
@ -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 <opdavies@381388.no-reply.drupal.org>"
|
||||
--author="opdavies <opdavies@381388.no-reply.drupal.org>"
|
||||
|
||||
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:
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
title: drush make drupalbristol
|
||||
nav: blog
|
||||
tags:
|
||||
- drupal
|
||||
- drush
|
||||
- drush-make
|
||||
- drupal-bristol
|
||||
- talks
|
||||
- drupal
|
||||
- drush
|
||||
- drush-make
|
||||
- drupal-bristol
|
||||
- talks
|
||||
---
|
||||
Here are my slides from this month's talk night at the [Drupal Bristol user group](https://groups.drupal.org/bristol-and-west-uk).
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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";
|
||||
font-family: "FuturaBook";
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
~~~
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
title: Configuring the Reroute Email Module
|
||||
nav: blog
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-6
|
||||
- drupal-7
|
||||
- drupal-planet
|
||||
- email
|
||||
- drupal
|
||||
- drupal-6
|
||||
- drupal-7
|
||||
- drupal-planet
|
||||
- email
|
||||
draft: true
|
||||
---
|
||||
[Reroute Email](https://www.drupal.org/project/reroute_email) module uses `hook_mail_alter()` to prevent emails from being sent to users from non-production sites. It allows you to enter one or more email addresses that will receive the emails instead of delivering them to the original user.
|
||||
|
@ -39,9 +39,9 @@ If you want to add multiple addresses, these should be added in a semicolon-deli
|
|||
|
||||
~~~php
|
||||
$conf['reroute_email_address'] = implode(';', array(
|
||||
'person1@example.com',
|
||||
'person2@example.com',
|
||||
'person3@example.com',
|
||||
'person1@example.com',
|
||||
'person2@example.com',
|
||||
'person3@example.com',
|
||||
));
|
||||
~~~
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@ title: Accessible Bristol
|
|||
link: http://www.accessiblebristol.org
|
||||
featured: true
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-7
|
||||
- accessibility
|
||||
- drupal
|
||||
- drupal-7
|
||||
- accessibility
|
||||
---
|
||||
|
||||
## Modules used
|
||||
|
|
|
@ -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.
|
|
@ -5,13 +5,13 @@ description: <a href="/blog/what-git-flow">Never Commit to Master</a>: An Introd
|
|||
slides: https://speakerdeck.com/opdavies/never-commit-to-master-an-introduction-to-git-flow
|
||||
slides_embed: <script async class="speakerdeck-embed" data-id="201559e0f103013198dd5a5f6f23ab67" data-ratio="1.29456384323641" src="//speakerdeck.com/assets/embed.js"></script>
|
||||
tags:
|
||||
- conference
|
||||
- drupalcamp
|
||||
- drupalcamp-london
|
||||
- git
|
||||
- git-flow
|
||||
- conference
|
||||
- drupalcamp
|
||||
- drupalcamp-london
|
||||
- git
|
||||
- git-flow
|
||||
meta:
|
||||
description:
|
||||
description:
|
||||
slug: git-flow
|
||||
nav: talks
|
||||
---
|
||||
|
|
|
@ -5,12 +5,12 @@ description: <a href="/blog/drush-make-drupalbristol">drush make drupalbristol</
|
|||
slides: https://speakerdeck.com/opdavies/drush-make-drupalbristol
|
||||
slides_embed: <script async class="speakerdeck-embed" data-id="42605700f102013198de5a5f6f23ab67" data-ratio="1.29456384323641" src="//speakerdeck.com/assets/embed.js"></script>
|
||||
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.
|
|
@ -3,10 +3,10 @@ title: About the Drupal Association
|
|||
location: South Wales Drupal User Group
|
||||
description: An impromptu talk about the <a href="https://assoc.drupal.org">Drupal Association</a> 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
|
||||
---
|
||||
|
|
|
@ -4,12 +4,12 @@ location: <a href="http://www.drupalcampbrighton.co.uk/drupalcamp-brighton-2015/
|
|||
date: 2015-01-18
|
||||
description: Drupal.org in 2015: What's coming next?
|
||||
tags:
|
||||
- conference
|
||||
- drupalcamp
|
||||
- drupalcamp-brighton
|
||||
- drupalorg
|
||||
- conference
|
||||
- drupalcamp
|
||||
- drupalcamp-brighton
|
||||
- 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
|
||||
---
|
||||
|
|
|
@ -4,12 +4,12 @@ location: <a href="http://2015.drupalcamplondon.co.uk">DrupalCamp London</a>
|
|||
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
|
||||
---
|
||||
|
|
|
@ -6,12 +6,12 @@ description: <a href="https://speakerdeck.com/opdavies/drupal-8">Drupal 8</a> (l
|
|||
slides: https://speakerdeck.com/opdavies/drupal-8
|
||||
slides_embed: <script async class="speakerdeck-embed" data-id="46ba4ba577d94a32b7abdade610ceb69" data-ratio="1.29456384323641" src="//speakerdeck.com/assets/embed.js"></script>
|
||||
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
|
||||
---
|
||||
|
|
|
@ -3,12 +3,12 @@ layout: default
|
|||
title: Blog
|
||||
nav: blog
|
||||
use:
|
||||
- posts
|
||||
- posts
|
||||
---
|
||||
<h1>Blog</h1>
|
||||
|
||||
<ul>
|
||||
{% for post in data.posts %}
|
||||
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
|
||||
{% endfor %}
|
||||
{% for post in data.posts %}
|
||||
<li><a href="{{ post.url }}">{{ post.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
|
@ -3,12 +3,12 @@ layout: default
|
|||
title: Tags
|
||||
nav: blog
|
||||
use:
|
||||
- posts_tags
|
||||
- posts_tags
|
||||
---
|
||||
<h2>Tags</h2>
|
||||
|
||||
<ul>
|
||||
{% for tag,posts in data.posts_tags %}
|
||||
<li><a href="{{ site.url }}/blog/tags/{{ tag|url_encode(true) }}">{{ tag }}</a></li>
|
||||
<li><a href="{{ site.url }}/blog/tags/{{ tag|url_encode(true) }}">{{ tag }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
|
@ -3,21 +3,21 @@ layout: default
|
|||
title: Tag Archive
|
||||
nav: blog
|
||||
generator:
|
||||
- posts_tag_index
|
||||
- posts_tag_index
|
||||
---
|
||||
|
||||
{% block head_meta %}
|
||||
<link rel="alternate" type="application/atom+xml" href="{{ site.url }}/blog/tags/{{ page.tag|url_encode(true) }}.xml" title="{{ site.title }} '{{ page.tag }}' tag feed" />
|
||||
<meta name="robots" content="noindex, follow">
|
||||
<link rel="alternate" type="application/atom+xml" href="{{ site.url }}/blog/tags/{{ page.tag|url_encode(true) }}.xml" title="{{ site.title }} '{{ page.tag }}' tag feed" />
|
||||
<meta name="robots" content="noindex, follow">
|
||||
{% endblock %}
|
||||
|
||||
{% block title %}{{ page.title }} "{{ page.tag }}"{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>"{{ page.tag }}"</h2>
|
||||
<h2>"{{ page.tag }}"</h2>
|
||||
<ul>
|
||||
{% for post in page.tag_posts %}
|
||||
<li><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% for post in page.tag_posts %}
|
||||
<li><a href="{{ site.url }}{{ post.url }}">{{ post.title }}</a></li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock content %}
|
|
@ -3,21 +3,21 @@ generator: [posts_tag_index]
|
|||
---
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||
<channel>
|
||||
<title>{{ site.title }}</title>
|
||||
<link>{{ site.url }}</link>
|
||||
<language>en</language>
|
||||
{% if site.description %}<description>{{ site.description|raw }}</description>{% endif %}
|
||||
<atom:link href="{{ site.url }}{{ page.url }}" rel="self" type="application/rss+xml" />
|
||||
<lastBuildDate>{{ site.calculated_date|date('r') }}</lastBuildDate>
|
||||
{% for post in page.tag_posts|slice(0, 10) %}
|
||||
<item>
|
||||
<title>{{ post.title }}</title>
|
||||
<link>{{ site.url }}{{ post.url }}</link>
|
||||
<guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
|
||||
<pubDate>{{ post.date|date('r') }}</pubDate>
|
||||
<description>{{ post.description|raw }}</description>
|
||||
</item>
|
||||
{% endfor %}
|
||||
</channel>
|
||||
<channel>
|
||||
<title>{{ site.title }}</title>
|
||||
<link>{{ site.url }}</link>
|
||||
<language>en</language>
|
||||
{% if site.description %}<description>{{ site.description|raw }}</description>{% endif %}
|
||||
<atom:link href="{{ site.url }}{{ page.url }}" rel="self" type="application/rss+xml" />
|
||||
<lastBuildDate>{{ site.calculated_date|date('r') }}</lastBuildDate>
|
||||
{% for post in page.tag_posts|slice(0, 10) %}
|
||||
<item>
|
||||
<title>{{ post.title }}</title>
|
||||
<link>{{ site.url }}{{ post.url }}</link>
|
||||
<guid isPermaLink="true">{{ site.url }}{{ post.url }}</guid>
|
||||
<pubDate>{{ post.date|date('r') }}</pubDate>
|
||||
<description>{{ post.description|raw }}</description>
|
||||
</item>
|
||||
{% endfor %}
|
||||
</channel>
|
||||
</rss>
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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.'
|
||||
type: website
|
||||
image:
|
||||
url: http://www.oliverdavies.co.uk/assets/images/oliver.jpg
|
||||
width: 327
|
||||
height: 327
|
||||
type: image/jpg
|
||||
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
|
||||
---
|
||||
# About
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -3,36 +3,36 @@ permalink: sitemap.xml
|
|||
---
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>{{ site.url }}</loc>
|
||||
<lastmod>{{ site.calculated_date | date('Y-m-d') }}</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>{{ site.url }}</loc>
|
||||
<lastmod>{{ site.calculated_date | date('Y-m-d') }}</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
|
||||
{% set pages = { 0: 'accessibility', 1: 'blog', 2: 'company-information', 3: 'contact', 4: 'services', 5: 'talks', 6: 'work' } %}
|
||||
{% for page in pages %}
|
||||
<url>
|
||||
<loc>{{ site.url }}/{{ page }}</loc>
|
||||
{% set pages = { 0: 'accessibility', 1: 'blog', 2: 'company-information', 3: 'contact', 4: 'services', 5: 'talks', 6: 'work' } %}
|
||||
{% for page in pages %}
|
||||
<url>
|
||||
<loc>{{ site.url }}/{{ page }}</loc>
|
||||
<lastmod>{{ site.calculated_date | date('Y-m-d') }}</lastmod>
|
||||
<changefreq>monthly</changefreq>
|
||||
<priority>0.6</priority>
|
||||
</url>
|
||||
{% endfor %}
|
||||
|
||||
<url>
|
||||
<loc>{{ site.url }}/blog</loc>
|
||||
<lastmod>{{ site.calculated_date | date('Y-m-d') }}</lastmod>
|
||||
<changefreq>monthly</changefreq>
|
||||
<priority>0.6</priority>
|
||||
</url>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
|
||||
{% for post in data.posts %}
|
||||
<url>
|
||||
<loc>{{ site.url }}{{ post.url }}</loc>
|
||||
<lastmod>{{ post.date|date('c') }}</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
{% endfor %}
|
||||
|
||||
<url>
|
||||
<loc>{{ site.url }}/blog</loc>
|
||||
<lastmod>{{ site.calculated_date | date('Y-m-d') }}</lastmod>
|
||||
<changefreq>monthly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
|
||||
{% for post in data.posts %}
|
||||
<url>
|
||||
<loc>{{ site.url }}{{ post.url }}</loc>
|
||||
<lastmod>{{ post.date|date('c') }}</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
{% endfor %}
|
||||
</urlset>
|
|
@ -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
|
||||
---
|
||||
<h1>Talks</h1>
|
||||
|
||||
|
@ -16,28 +16,28 @@ use:
|
|||
|
||||
{% set found = false %}
|
||||
{% for talk in talks if talk.date >= now %}
|
||||
{% if loop.first %}
|
||||
{% set found = true %}
|
||||
<h2>Upcoming Talks</h2>
|
||||
<dl>
|
||||
{% endif %}
|
||||
{% if loop.first %}
|
||||
{% set found = true %}
|
||||
<h2>Upcoming Talks</h2>
|
||||
<dl>
|
||||
{% endif %}
|
||||
|
||||
{% include 'talk-listing-item' %}
|
||||
{% include 'talk-listing-item' %}
|
||||
{% endfor %}
|
||||
{% if found %}
|
||||
</dl>
|
||||
</dl>
|
||||
{% endif %}
|
||||
|
||||
{% set found = false %}
|
||||
{% for talk in talks if talk.date < now %}
|
||||
{% if loop.first %}
|
||||
{% set found = true %}
|
||||
<h2>Previous Talks</h2>
|
||||
<dl>
|
||||
{% endif %}
|
||||
{% if loop.first %}
|
||||
{% set found = true %}
|
||||
<h2>Previous Talks</h2>
|
||||
<dl>
|
||||
{% endif %}
|
||||
|
||||
{% include 'talk-listing-item' %}
|
||||
{% include 'talk-listing-item' %}
|
||||
{% endfor %}
|
||||
{% if found %}
|
||||
</dl>
|
||||
</dl>
|
||||
{% endif %}
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue