Fix excerpts on blog posts
This commit is contained in:
parent
429c373db7
commit
ff9f0a7b0b
|
@ -1,10 +1,10 @@
|
|||
.button
|
||||
@apply bg-blue border-blue border inline-block text-white no-underline py-1 px-3 rounded
|
||||
@apply bg-blue border-blue border inline-block text-white no-underline py-2 px-3 rounded text-sm
|
||||
|
||||
&:focus
|
||||
@apply py-2 px-3 m-0
|
||||
|
||||
&:active,
|
||||
&:focus,
|
||||
&:hover
|
||||
@apply bg-white text-blue
|
||||
|
||||
&:focus
|
||||
@apply px-3 py-1 m-0
|
||||
|
|
|
@ -7,8 +7,8 @@
|
|||
<meta name="twitter:site" content="@{{ site.twitter.name }}">
|
||||
<meta name="twitter:title" content="{{ page.title }}">
|
||||
<meta name="twitter:creator" content="@{{ site.twitter.name }}">
|
||||
<meta name="twitter:image" content="{{ page.meta.image ?: site.url ~ site.avatar.url }}">
|
||||
{% if page.meta.description %}<meta name="twitter:description" content="{{ page.meta.description }}">{% endif %}
|
||||
<meta name="twitter:image" content="{{ site.url ~ site.avatar.url }}">
|
||||
<meta name="twitter:description" content="{{ page.excerpt }}">
|
||||
{% endblock %}
|
||||
|
||||
{% block content_wrapper %}
|
||||
|
|
|
@ -1,21 +1,18 @@
|
|||
---
|
||||
title: Style Drupal 6's Taxonomy Lists with PHP, CSS and jQuery
|
||||
excerpt: Getting started with Drupal theming by styling Drupal’s taxonomy lists.
|
||||
tags:
|
||||
- drupal-6
|
||||
- drupal-planet
|
||||
- drupal-theming
|
||||
- taxonomy
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
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.
|
||||
|
||||
To start with, I wanted to have something that described what the list was displaying - like in the second example above. I wanted to have the words 'Posted in' displayed before the list of terms. To do this, I had to edit the node template file that exists within my theme folder (sites/all/themes). As I only wanted this change to affect my Blog posts, the file that I needed to change is **node-blog.tpl.php**
|
||||
|
||||
I scrolled down until I found the piece of code that displayed the terms list:
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
```language-php
|
||||
<?php if ($terms): ?>
|
||||
<div class="terms terms-inline">
|
||||
|
@ -60,4 +57,3 @@ This code finds the last item in the list, uses **.prev** to select the one befo
|
|||
content: " and";
|
||||
}
|
||||
```
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Using ImageCache and ImageCrop for my Portfolio
|
||||
excerpt: How to create thumbnail images using the ImageCache and ImageCrop modules.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-6
|
||||
|
@ -7,22 +8,18 @@ tags:
|
|||
- imagecache
|
||||
- imagecrop
|
||||
- imagefield
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
||||
I created a content type called 'Project' with a CCK ImageField called 'Screenshot'. I created a project called [Popcorn Strips](http://popcornstrips.com), used the [ScreenGrab](https://addons.mozilla.org/addon/1146) add-on for Mozilla Firefox to take a screenshot of the website, and uploaded it to the project node.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
I created a View to display the published projects, and an ImageCache
|
||||
preset to create the thumbnail image by scaling and cropping the image
|
||||
to a size of 200x100 pixels.
|
||||
I created a View to display the published projects, and an ImageCache
|
||||
preset to create the thumbnail image by scaling and cropping the image
|
||||
to a size of 200x100 pixels.
|
||||
|
||||
Although, this automatically focused the crop on the centre of the image, whereas I wanted to crop from the top and left of the image - showing the site's logo and header.
|
||||
Although, this automatically focused the crop on the centre of the image, whereas I wanted to crop from the top and left of the image - showing the site's logo and header.
|
||||
|
||||
I installed the [ImageCrop](http://drupal.org/project/imagecrop) module, which add a jQuery crop function to the standard ImageCache presents. I removed the original Scale and Crop action and replaced it with a Scale action with a width of 200px.
|
||||
I installed the [ImageCrop](http://drupal.org/project/imagecrop) module, which add a jQuery crop function to the standard ImageCache presents. I removed the original Scale and Crop action and replaced it with a Scale action with a width of 200px.
|
||||
|
||||
I then added a new 'Javascript crop' action with the following settings:
|
||||
|
||||
|
@ -30,4 +27,3 @@ I then added a new 'Javascript crop' action with the following settings:
|
|||
* Height: 100px
|
||||
* xoffset: Left
|
||||
* yoffset: Top
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
---
|
||||
title: Conditional Email Addresses in a Webform
|
||||
excerpt: How to send webform emails to a different email address based on another field.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- conditional-email
|
||||
- webform
|
||||
use: [posts]
|
||||
---
|
||||
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:
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Quickly Create Zen Subthemes Using Zenophile
|
||||
excerpt: How to use the Zenophile module to create a Zen subtheme.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
|
@ -7,7 +8,6 @@ tags:
|
|||
- drupal-theming
|
||||
- zen
|
||||
- zenophile
|
||||
use: [posts]
|
||||
---
|
||||
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!
|
||||
|
||||
|
|
|
@ -1,20 +1,17 @@
|
|||
---
|
||||
title: Create a Slideshow of Multiple Images Using Fancy Slide
|
||||
excerpt: How to create a slideshow of images using Drupal’s Fancy Slide module.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal
|
||||
- drupal-6
|
||||
- fancy-slide
|
||||
- slideshow
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
||||
I added an CCK Image field to my Page content type, and set the number of values to 3, then uploaded my images to the Page.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
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.
|
||||
Once the Images were added, I went to the Fancy Slide settings page and created the slideshow.
|
||||
|
||||
|
@ -27,4 +24,3 @@ I added the following code into my About page, as described in the Fancy Slide r
|
|||
```
|
||||
|
||||
In my opinion, this adds a nice effect to the About page. I like it because it's easy to set up, and easy to add additional images later on if required.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Quickly Import Multiples Images Using the Imagefield_Import Module
|
||||
excerpt: How to use the Imagefield Import module.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- imagefield-import
|
||||
|
@ -8,15 +9,11 @@ tags:
|
|||
- photo-gallery
|
||||
- cck
|
||||
- imagefield
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
**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!**
|
||||
|
||||
I've recently started a personal project converting a website to Drupal. It's currently a static HTML/CSS site which also uses the [Coppermine Photo Gallery](http://coppermine-gallery.net). As part of building the new website, I wanted to move all the photos from the existing site onto the new one. However, with 1260 photos in 17 albums, this could have been a lengthy process!
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
I created a new Drupal-powered Gallery as described in [this screencast](http://lullabot.com/articles/photo-galleries-views-attach) by [Jeff Eaton](http://twitter.com/eaton) - using the CCK and Imagefield modules, and re-created each of my existing Gallery nodes. Using the [Imagefield_Import](http://drupal.org/project/imagefield_import) module, I was then able to quickly import the photos into the new Galleries.
|
||||
|
||||
I downloaded all the photos from the previous Gallery via FTP, and installed and configured the Imagefield_Import module.
|
||||
|
@ -26,4 +23,3 @@ I created an 'Import' folder, selected the target field and mode. In this case,
|
|||
After clicking 'Import', a node is created for each photo, the image is uploaded, and added to the selected Gallery.
|
||||
|
||||
Just another 1248 photos to go...
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,20 +1,16 @@
|
|||
---
|
||||
title: Improve JPG Quality in Imagecache and ImageAPI
|
||||
excerpt: How to fix the quality of uploaded images in Drupal.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- imagecache
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
||||
To increase the quality of your images, change the setting in the two following places:
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
* admin/settings/imageapi/config
|
||||
* admin/settings/image-toolkit
|
||||
|
||||
The first one is for ImageAPI. Primarily, this means Imagecache presets. The second one is for core's image.inc. This is used for resizing profile pictures in core, and some contrib modules. Once changed, I did have to flush each of the Imagecache presets (admin/dist/imagecache) for the changes to take effect.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Create a Block of Social Media Icons using CCK, Views and Nodequeue
|
||||
excerpt: How to create a block of social media icons in Drupal.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
|
@ -7,15 +8,11 @@ tags:
|
|||
- views
|
||||
- nodequeue
|
||||
- oliverdavies.co.uk
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
||||
I created a 'Social icon' content type with the body field removed, and with fields for a link and image - then downloaded the favicons from the appropriate websites to use.
|
||||
{% endblock %}
|
||||
I created a 'Social icon' content type with the body field removed, and with fields for a link and image - then downloaded the favicons from the appropriate websites to use.
|
||||
|
||||
{% block content %}
|
||||
However, instead of using a custom template (node-custom.tpl.php) file, I used the Views module.
|
||||
|
||||
I added fields for the node titles, and the link from the node's content. Both of these are excluded from being displayed on the site. I then re-wrote the output of the Icon field to create the link using the URL, and using the node's title as the image's alternative text and the link's title.
|
||||
|
@ -23,4 +20,3 @@ I added fields for the node titles, and the link from the node's content. Both o
|
|||
I also used the [Nodequeue](http://drupal.org/project/nodequeue) module to create a nodequeue and arrange the icons in the order that I wanted them to be displayed. Once this was added as a relationship within my View, I was able to use node's position in the nodequeue as the sort criteria.
|
||||
|
||||
To complete the process, I used the [CSS Injector](http://drupal.org/project/css_injector) module to add some additional CSS styling to position and space out the icons.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
---
|
||||
title: 10 Useful Drupal 6 Modules
|
||||
excerpt: A list of 10 contributed modules that I currently use on each Drupal project.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- drupal
|
||||
- drupal-modules
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
||||
So, in no particular order:
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
* **[Admin](http://drupal.org/project/admin):** <br>The admin module provides UI improvements to the standard Drupal admin interface. I've just upgraded to the new [6.x-2.0-beta4](http://drupal.org/node/835870) version, and installed the newly-required [Rubik](http://code.developmentseed.org/rubik)/[Tao](http://code.developmentseed.org/tao) themes. So far, so good!
|
||||
* **[Better Permissions](http://drupal.org/project/better_perms)/[Filter Permissions](http://drupal.org/project/filter_perms): <br>**Basic permissions is a basic module which enhances the Drupal Permissions page to support collapsing and expanding permission rows. Filter permissions provides filters at the top of the Permissions page for easier management when your site has a large amount of roles and/or permissions.
|
||||
* **[Better Formats](http://drupal.org/project/better_formats): <br>**Better formats is a module to add more flexibility to Drupal's core input format system.
|
||||
|
@ -24,4 +21,3 @@ So, in no particular order:
|
|||
* **[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.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Create a Flickr Photo Gallery Using Feeds, CCK and Views
|
||||
excerpt: In this tutorial, I'll show you how to create a photo gallery which uses photos imported from Flickr.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
|
@ -11,15 +12,11 @@ tags:
|
|||
- filefield
|
||||
- flickr
|
||||
- imagefield
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
In this tutorial, I'll show you how to create a photo gallery which uses photos imported from [Flickr](http://www.flickr.com).
|
||||
|
||||
The modules that I'll use to create the Gallery are:
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
* [CCK](http://drupal.org/project/cck)
|
||||
* [Feeds](http://drupal.org/project/feeds)
|
||||
* [Feeds Image Grabber](http://drupal.org/project/feeds_imagegrabber)
|
||||
|
@ -46,4 +43,3 @@ With the new Photo nodes created, I then created the View to display them.
|
|||
The View selects the image within the Photo content type, and displays in it a grid using an ImageCache preset. The View is limited to 20 nodes per page, and uses a full pager if this is exceeded. The nodes are sorted by the descending post date, and filtered by whether or not they are published, and only to include Photo nodes.
|
||||
|
||||
As an additional effect, I also included the 'Feeds Item - Item Link' field, which is basically the original link from the RSS feed. By checking the box the exclude the item from the display, it is not shown, but makes the link available to be used elsewhere. By checking the box 'Re-write the output for this field' on the 'Content: Photo' field, I was able to add the replacement token (in this case, [url]) as the path for a link around each image. This meant that when someone clicked a thumbnail of a photo, they were directed to the Flickr website instead of the node within my Drupal site.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Change the Content Type of Multiple Nodes Using SQL
|
||||
excerpt: In this post, I will be changing values within my Drupal 6 site's database to quickly change the content type of multiple nodes.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
|
@ -8,13 +9,9 @@ tags:
|
|||
- sequel-pro
|
||||
- database
|
||||
- content-types
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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'.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
**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!**
|
||||
|
||||
To begin with, I created the 'News article' content type, and then used the Devel Generate module to generate some Blog nodes.
|
||||
|
@ -26,4 +23,3 @@ Using an SQL 'Update' command, I can change the type value from 'blog' to 'artic
|
|||
Now, when I query the database, the type is shown as 'article'.
|
||||
|
||||
Now, when I go back into the administration section of my site and view the content, the content type now shows at 'News article'.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,20 +1,17 @@
|
|||
---
|
||||
title: Create Virtual Hosts on Mac OS X Using VirtualHostX
|
||||
excerpt: How to use the VirtualHostX application to manage virtual hosts on Mac OS X.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- mamp
|
||||
- virtual-hosts
|
||||
- virtualhostx
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
||||
Normally, I would have to edit the hosts file and Apache's httpd.conf file to create a virtual host. The first to set the domain and it's associated IP address, and the other to configure the domain's directory, default index file etc. However, using [VirtualHostX](http://clickontyler.com/virtualhostx), I can quickly create a virtual host without having to edt any files. Enter the virtual domain name, the local path and the port, and apply the settings. VirtualHostX automatically restarts Apache, so the domain is ready to work straight away. You can also enter custom directives from within the GUI.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
There's also an option to share the host over the local network. Next, I intend on configuring a virtual Windows PC within VMware Fusion to view these domains so that I can do cross-browser testing before putting a site live.
|
||||
|
||||
I ensured that my Apache configuration within MAMP was set to port 80, and that VirtualHostX was using Apache from MAMP instead of Apple's built-in Apache.
|
||||
|
@ -24,4 +21,3 @@ I ensured that my Apache configuration within MAMP was set to port 80, and that
|
|||
After some troubleshooting, I found out that Web Sharing on my Mac had become enabled (I don't know why, I've never enabled it), and that this was causing a conflict with Apache. Once I opened my System Preferences and disabled it, everything worked fine!
|
||||
|
||||
This, along with [MAMP](http://www.mamp.info/en/index.html), [Coda](http://www.panic.com/coda), [Sequel Pro](http://www.sequelpro.com), and [Transmit](http://www.panic.com/transmit), has become an essential tool within my development environment.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Add a Taxonomy Term to Multiple Nodes Using SQL
|
||||
excerpt: How to add a new taxonomy term to multiple nodes in Drupal using SQL.
|
||||
tags:
|
||||
- taxonomy
|
||||
- drupal-planet
|
||||
|
@ -7,14 +8,9 @@ tags:
|
|||
- sql
|
||||
- sequal-pro
|
||||
- database
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
**Up
|
||||
In preparation for my Blog posts being added to [Drupal Planet](http://drupal.org/planet), I needed to create a new Taxonomy term (or, in this case, tag) called 'Drupal Planet', and assign it to new content to imported into their aggregator. After taking a quick look though my previous posts, I decided that 14 of my previous posts were relevant, and thought that it would be useful to also assign these the 'Drupal Planet' tag.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
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!**
|
||||
|
@ -50,4 +46,3 @@ SELECT nid, tid FROM term_node WHERE nid = 216;
|
|||
Once the query had confirmed the correct tid value, I began to write the SQL Insert statement that would be needed to add the new term to the required nodes. The nid and vid values were the same on each node, and the value of my taxonomy term would need to be 84.
|
||||
|
||||
Once this had completed with no errors, I returned to the administration area of my Drupal site to confirm whether or not the nodes had been assigned the new term.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
---
|
||||
title: Review of the Teleport Module
|
||||
excerpt: My review of Drupal’s Teleport module.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- drupal-modules
|
||||
- teleport
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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))*.
|
||||
|
||||
When you press a configurable hot-key, a jQuery dialog box appears where you can search for nodes by title or path, or directly enter the path that you want to navigate to. This will greatly reduce the number of clicks that I need to perform to get to my desired page - even compared to the [Admin](http://drupal.org/project/admin) and [Administration Menu](http://drupal.org/project/admin_menu) modules.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
Although it's not a new module (the first commits were 2 years ago), I hope that they are still planning on achieving the list of future directions listed on their Drupal.org project page:
|
||||
|
||||
* Make interface act more like Quicksilver (i.e. you should only have to press Enter once to launch)
|
||||
|
@ -21,4 +18,3 @@ Although it's not a new module (the first commits were 2 years ago), I hope that
|
|||
* Hook into more non-node content, like taxonomy terms and functions in the API module.
|
||||
|
||||
Personally, this will make navigation around both the front-end and administration area of my Drupal sites so much easier.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
---
|
||||
title: Review of the Admin:hover Module
|
||||
excerpt: My review of Drupal’s admin:hover module.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- drupal-modules
|
||||
- admin:hover
|
||||
- administration
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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!
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Create a Better Photo Gallery in Drupal - Part 1
|
||||
excerpt: How I started converting and migrating a Coppermine photo gallery into Drupal.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
|
@ -10,15 +11,11 @@ tags:
|
|||
- cck
|
||||
- views-attach
|
||||
- drupal
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
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.
|
||||
|
@ -112,8 +109,8 @@ You will notice that the returned date value for the latest photo added is disp
|
|||
|
||||
```language-php
|
||||
<?php
|
||||
if ($selected_gallery_total != 0) {
|
||||
$output = '<i>There are currently ' . $selected_gallery_total . ' photos in this gallery.';
|
||||
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;
|
||||
}
|
||||
|
@ -123,4 +120,3 @@ if ($selected_gallery_total != 0) {
|
|||
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.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,17 +1,17 @@
|
|||
---
|
||||
title: Create a Better Photo Gallery in Drupal - Part 2
|
||||
excerpt: Updating the galleries’ created and modified dates.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- photo-gallery
|
||||
- sql
|
||||
- sequel-pro
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
@ -22,9 +22,9 @@ 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.
|
||||
|
||||
```language-sql
|
||||
UPDATE node
|
||||
|
@ -36,7 +36,7 @@ SET
|
|||
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 dates 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.
|
||||
|
||||
|
|
|
@ -1,20 +1,17 @@
|
|||
---
|
||||
title: Review of the Image Caption Module
|
||||
excerpt: My review of Drupal’s Image Caption module.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal
|
||||
- drupal-6
|
||||
- imagefield
|
||||
- image-caption
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
||||
The Image Caption module uses jQuery to dynamically add captions to images. Here is a walkthrough of the process that I followed to install and configure the module. As always, I used Drush to download and enable the module, then visited the Image Caption Settings page (admin/settings/image_caption). Here, I select which node types should be included in image captioning. In my case, I only wanted this to apply to Blog posts.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
As I use the [FileField](http://drupal.org/project/filefield), [ImageField](http://drupal.org/project/imagefield) and [Insert](http://drupal.org/project/insert) modules to add images to my posts, as opposed to via a WYSIWYG editor, I'm able to add the CSS class of 'caption' to my images.
|
||||
|
||||
Now, all images inserted this way will have the CSS class of 'caption'.
|
||||
|
@ -24,4 +21,3 @@ As the Image Caption module uses the image's title tag to create the displayed c
|
|||
This results in a span called `image-caption-container` around the inserted image, and a caption below it called `image-caption` containing the text.
|
||||
|
||||
All that's left is to style these classes within your CSS stylesheet.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
---
|
||||
title: The Inaugural Meetup for the South Wales Drupal User Group
|
||||
excerpt: If you do Drupal and you're in the area, come and join us for the first SWDUG meetup!
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- swdug
|
||||
- meetups
|
||||
use: [posts]
|
||||
---
|
||||
If you do Drupal, and you're in the area, come and join us for the first South Wales Drupal User Group Meetup!
|
||||
If you do Drupal and you're in the area, come and join us for the first SWDUG meetup!
|
||||
|
||||
We'll be meeting in the communal area just outside of the [SubHub](http://www.subhub.com) HQ, at:
|
||||
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
---
|
||||
title: How to Create and Apply Patches
|
||||
excerpt: How to create and apply patches, ready for the Drupal.org issue queues.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- modules
|
||||
- patches
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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`.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
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.
|
||||
|
||||
```language-bash
|
||||
|
@ -35,4 +32,3 @@ patch -p0 -R < /Users/oliver/Desktop/different_messages_for_blocked_users.patch
|
|||
And that's it!
|
||||
|
||||
There is also a Git patch creation workflow, which is described at <http://groups.drupal.org/node/91424>. Thanks to [Randy Fay](http://randyfay.com) for making me aware of this, and suggesting a slight change to my original patch creation command.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
---
|
||||
title: Create a Better Photo Gallery in Drupal - Part 3
|
||||
excerpt: Grouping galleries by category.
|
||||
tags:
|
||||
- drupal
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
||||
I've called it 'Taxonomy', and it's similar to the original 'All Galleries' view. The differences are that I've added the taxonomy term as an argument, removed the header, and updated the path to be `gallery/%`. The other thing that I need to do is overwrite the output of the original 'All Galleries' View by creating a file called `views-view--photo-gallery--page-1.tpl.php` and placing it within my theme directory.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
Within that file, I can remove the standard content output. This still outputs the heading information from the original View. I can now use the function called 'views_embed_view' to embed my taxonomy display onto the display. The views_embed_view function is as follows:
|
||||
|
||||
```language-php
|
||||
|
@ -34,4 +31,3 @@ while ($term = db_fetch_array($terms)) {
|
|||
}
|
||||
?>
|
||||
```
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
---
|
||||
title: Create a Better Photo Gallery in Drupal - Part 2.1
|
||||
excerpt: The missing code to get totals of galleries and photos.
|
||||
tags:
|
||||
- drupal
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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:
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
```language-php
|
||||
<?php
|
||||
|
||||
|
@ -56,4 +53,3 @@ print '.';
|
|||
```
|
||||
|
||||
It was applied to the view as a header which had the input format set to PHP code.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Use Regular Expressions to Search and Replace in Coda or TextMate
|
||||
excerpt: How to perform searches using regular expressions.
|
||||
tags:
|
||||
- taxonomy
|
||||
- sequel-pro
|
||||
|
@ -7,13 +8,9 @@ tags:
|
|||
- coda
|
||||
- regular-expression
|
||||
- textmate
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
```language-sql
|
||||
SELECT nid, nid FROM node WHERE TYPE = 'blog' ORDER BY nid ASC;
|
||||
```
|
||||
|
@ -30,12 +27,10 @@ As I mentioned previously, the nid and vid values are the same for each node, an
|
|||
|
||||
So, using the 'Find and Replace' function within Coda, combined with [regular expressions](http://en.wikipedia.org/wiki/Regular_expression) (regex), I can easily format the values as needed. To begin with, I need to ensure that the RegEx search option is enabled, and that I'm using the correct escape character.
|
||||
|
||||
The first thing that I wanted to do was add the seperating comma between the two values. To do this, I
|
||||
perform a search for `\s*\t`. This searches for everything that is whitespace AND is a tab value. I can then add the comma as the replacement for each result.
|
||||
The first thing that I wanted to do was add the seperating comma between the two values. To do this, I perform a search for `\s*\t`. This searches for everything that is whitespace AND is a tab value. I can then add the comma as the replacement for each result.
|
||||
|
||||
All 31 lines have been changed.
|
||||
|
||||
Next, I can use `\n` to target the lines between the rows. I'll replace it with the next comma, the number 63 (the tid value), the closing bracket, another comma, re-add the line and add the opening bracket.
|
||||
|
||||
The only two lines that aren't changed are the first and last, as they don't have any line breaks following them. I can complete these lines manually. Now all I need to do is add the beginning of the SQL update statement, then copy and paste it into Sequel Pro.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
---
|
||||
title: Easily Embed TypeKit Fonts into your Drupal Website
|
||||
excerpt: How to use the @font-your-face module to embed TypeKit fonts into your Drupal website.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal-6
|
||||
- typekit
|
||||
use: [posts]
|
||||
---
|
||||
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.
|
||||
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
---
|
||||
title: Display the Number of Facebook fans in PHP
|
||||
excerpt: How to use PHP to display the number of fans of a Facebook page.
|
||||
tags:
|
||||
- php
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
For example, mine is <https://www.facebook.com/pages/edit/?id=143394365692197&sk=basic>.
|
||||
|
||||
I've also wrapped the output in a number_format() function so that it properly formatted with commas etc - like where I've used it within the [Gold Event listing](http://www.horseandcountry.tv/events/paid) on the Horse & Country TV website.
|
||||
|
@ -21,4 +18,3 @@ print number_format($fans);
|
|||
```
|
||||
|
||||
This code was originally found at <http://wp-snippets.com/display-number-facebook-fans>.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
title: Proctor & Stevenson
|
||||
excerpt: I’m moving jobs.
|
||||
tags:
|
||||
- personal
|
||||
use: [posts]
|
||||
---
|
||||
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.
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
title: Proctors Hosting the next Drupal Meetup
|
||||
excerpt: Proctor & Stevenson are going to be hosting the next Bristol & South West Drupal meetup.
|
||||
tags:
|
||||
- meetups
|
||||
- drupal-bristol
|
||||
use: [posts]
|
||||
---
|
||||
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.
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
title: Imagefield Import Archive
|
||||
excerpt: I've finally uploaded my first module onto Drupal.org!
|
||||
tags:
|
||||
- drupal-planet
|
||||
- imagefield-import
|
||||
use: [posts]
|
||||
---
|
||||
I've finally uploaded my first module onto Drupal.org!
|
||||
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Create Multigroups in Drupal 7 using Field Collections
|
||||
excerpt: How to replicate CCK’s multigroups in Drupal 7 using the Field Collections module.
|
||||
tags:
|
||||
- drupal-7
|
||||
- drupal-planet
|
||||
|
@ -8,15 +9,11 @@ tags:
|
|||
- field-collection
|
||||
- entity-api
|
||||
- multigroup
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
||||
But at the time of writing this, there is no CCK 3 version for Drupal 7. So, I created the same thing using [Field Collection](http://drupal.org/project/field_collection) and [Entity](http://drupal.org/project/entity) modules.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
With the modules uploaded and enabled, go to admin/structure/field-collections and create a field collection.
|
||||
|
||||
With the module enabled, you can go to your content type and add a Field Collection field. By default, the only available Widget type is 'Hidden'.
|
||||
|
@ -30,4 +27,3 @@ Whilst this works perfectly, the field collection is not editable from the node
|
|||
After some searching I found [a link to a patch](http://drupal.org/node/977890#comment-4184524) which when applied adds a 'subform' widget type to the field collection field and allows for it to be embedded into, and editable from within the node form. Going back to the content type fields page, and clicking on 'Hidden' (the name of the current widget), I can change it to subform and save my changes.
|
||||
|
||||
With this change applied, when I go back to add or edit a node within this content type, my field collection will be easily editable directly within the form.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
---
|
||||
title: How to Install and Configure Subversion (SVN) Server on Ubuntu
|
||||
excerpt: How to install and configure your own SVN server.
|
||||
tags:
|
||||
- svn
|
||||
- ubuntu
|
||||
- version-control
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
||||
Note: As I was using Ubuntu, I was using the 'apt-get' command to download and install the software packages. If you're using a different distribution of Linux, then this command may be different. I'm also assuming that Apache is already installed.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
Firstly, I'm going to ensure that all of my installed packages are up to date, and install any available updates.
|
||||
|
||||
```language-bash
|
||||
|
@ -144,4 +141,3 @@ $ 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.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
---
|
||||
title: Site Upgraded to Drupal 7
|
||||
use: [posts]
|
||||
excerpt: As the vast majority of the Drupal websites that I currently work on are built on Drupal 7, I thought that it was time that I upgraded this site.
|
||||
tags: [drupal]
|
||||
---
|
||||
As the vast majority of the Drupal websites that I currently work on are built on Drupal 7, I thought that it was time that I upgraded this site. Following the [core upgrade process](http://drupal.org/node/570162) and the [CCK migration process](http://drupal.org/node/1144136), everything was upgraded smoothly without any issues.
|
||||
|
||||
|
|
|
@ -1,20 +1,17 @@
|
|||
---
|
||||
title: How to use Authorized Keys to Create a Passwordless SSH Connection
|
||||
excerpt: How to generate a SSH key, and how to use to log in to a server using SSH without entering a password.
|
||||
tags:
|
||||
- linux
|
||||
- ssh
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
1. Check if you already have a SSH key.
|
||||
`$ ssh-add -L`
|
||||
2. If you don't have one, create one.
|
||||
`$ ssh-add -L`
|
||||
1. If you don't have one, create one.
|
||||
`$ ssh-keygen`
|
||||
2. Upload the key onto the server. Replace *myserver* with the hostname or IP address of your remote server.
|
||||
1. Upload the key onto the server. Replace *myserver* with the hostname or IP address of your remote server.
|
||||
`$ 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.
|
||||
|
@ -28,4 +25,3 @@ If successful, you should now see a message like:
|
|||
> to make sure we haven't added extra keys that you weren't expecting.
|
||||
|
||||
Now the next time that you SSH onto the server, it should log you in without prompting you for your password.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Create an Omega Subtheme with LESS CSS Preprocessor using Omega Tools and Drush
|
||||
excerpt: How to create an Omega subtheme on the command line using Drush.
|
||||
tags:
|
||||
- drupal-7
|
||||
- omega
|
||||
|
@ -7,15 +8,11 @@ tags:
|
|||
- less
|
||||
- drupal-planet
|
||||
- drupal
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
```language-bash
|
||||
$ drush dl less omega omega_tools;
|
||||
$ drush en -y less omega_tools
|
||||
|
@ -42,4 +39,3 @@ $ drush cc all
|
|||
I tested my changes by making some quick additions to my global.less file and reloading the page.
|
||||
|
||||
If your changes aren't applied, then confirm that your global.less file is enabled within your theme's configuration. I did this by going to admin/appearance/settings/oliverdavies, clicking on the Toggle styles tab within *Layout configuration* and finding global.less at the bottom of *Enable optional stylesheets*.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
---
|
||||
title: Installing Nagios on CentOS
|
||||
excerpt: How to install Nagios on CentOS.
|
||||
tags:
|
||||
- nagios
|
||||
- centos
|
||||
- linux
|
||||
use: [posts]
|
||||
---
|
||||
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.
|
||||
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
---
|
||||
title: Adding Custom Theme Templates in Drupal 7
|
||||
description: >
|
||||
excerpt: >
|
||||
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.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupal
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: How to add a date popup calendar onto a custom form
|
||||
excerpt: How to use a date popup calendar within your custom module.
|
||||
tags:
|
||||
- forms
|
||||
- form-api
|
||||
|
@ -8,13 +9,9 @@ tags:
|
|||
- drupal-7
|
||||
- drupal-planet
|
||||
- drupal
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
How to use a date popup calendar within your custom module.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
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.
|
||||
|
||||
```language-ini
|
||||
|
@ -40,4 +37,3 @@ $form['date'] = array(
|
|||
'#default_value' => date('Y-m-d', time()),
|
||||
);
|
||||
```
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
---
|
||||
title: Checkout a specific revision from SVN from the command line
|
||||
excerpt: How to checkout a specific revision from a SVN (Subversion) repository.
|
||||
tags:
|
||||
- svn
|
||||
- version-control
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
How to checkout a specific revision from a SVN (Subversion) repository.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
If you're checking out the repository for the first time:
|
||||
|
||||
```language-bash
|
||||
|
@ -21,5 +18,3 @@ If you already have the repository checked out:
|
|||
```language-bash
|
||||
$ svn up -r 1234
|
||||
```
|
||||
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
---
|
||||
title: Forward one domain to another using mod_rewrite and .htaccess
|
||||
excerpt: How to use the .htaccess file to forward to a different domain.
|
||||
tags:
|
||||
- .htaccess
|
||||
- code
|
||||
- drupal
|
||||
- apache
|
||||
- mod_rewrite
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
How to use the .htaccess file to forward to a different domain.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
Within the mod_rewrite section of your .htaccess file, add the following lines:
|
||||
|
||||
```language-apacheconf
|
||||
|
@ -31,4 +28,3 @@ RewriteRule (.*) http://yoursite.com/$1 [R=301,L]
|
|||
```
|
||||
|
||||
If any of the RewriteCond conditions apply, then the RewriteRule is executed.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
---
|
||||
title: Prevent Apache from displaying text files within a web browser
|
||||
excerpt: How to prevent Apache from displaying the contents of files like CHANGELOG.txt.
|
||||
tags:
|
||||
- apache
|
||||
- code
|
||||
- drupal
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
When you download [Drupal](http://drupal.org/project/drupal), 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.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
```language-apacheconf
|
||||
<Files ~ "\.txt$">
|
||||
Order deny,allow
|
||||
|
@ -21,4 +18,3 @@ Rather than delete these files or change the file permissions manually for each
|
|||
```
|
||||
|
||||
This prevents any files with a .txt extension from being accessed and rendered in a web browser.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,17 +1,12 @@
|
|||
---
|
||||
title: Writing a .info file for a Drupal 7 theme
|
||||
excerpt: An example .info file for a Drupal 7 theme.
|
||||
tags:
|
||||
- theming
|
||||
- drupal-theming
|
||||
- drupal
|
||||
- code
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
An example .info file for a Drupal 7 theme.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
```language-ini
|
||||
name = My Theme
|
||||
description = A description of my theme
|
||||
|
@ -41,4 +36,3 @@ stylesheets[print][] = css/print.css
|
|||
# Add javascript files
|
||||
styles[] = js/mytheme.js
|
||||
```
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
---
|
||||
title: Dividing Drupal's process and preprocess functions into separate files
|
||||
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.
|
||||
excerpt: 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.
|
||||
tags:
|
||||
- drupal
|
||||
- code
|
||||
- theming
|
||||
- preprocessing
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: My new Drupal modules
|
||||
description: After a busy few days, I've released two new contrib Drupal modules.
|
||||
excerpt: After a busy few days, I've released two new contrib Drupal modules.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-modules
|
||||
|
@ -8,15 +8,10 @@ tags:
|
|||
- drupal-7
|
||||
- drupal-planet
|
||||
- accessibility
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
After a busy few days, I've released two new contrib Drupal modules.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
* [Block Aria Landmark Roles](http://drupal.org/project/block_aria_landmark_roles) - Inspired by [Block Class](http://drupal.org/project/block_class), this module adds additional elements to the block configuration forms that allow users to assign a ARIA landmark role to a block.
|
||||
* [Nomensa Accessible Media Player](http://drupal.org/project/nomensa_amp) - Provides integration with Nomensa's [Accessible Media Player](https://github.com/nomensa/Accessible-Media-Player).
|
||||
|
||||
Documentation for both to follow shortly on Drupal.org.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
---
|
||||
title: Install and Configure the Nomensa Accessible Media Player in Drupal
|
||||
excerpt: This week I released the first version of the Nomensa Accessible Media Player module for Drupal 7. Here's some instructions of how to install and configure it.
|
||||
tags:
|
||||
- accessibility
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- nomensa
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
This week I released the first version of the Nomensa Accessible Media Player module for Drupal 7. Here's some instructions of how to install and configure it.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
*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.*
|
||||
|
||||
## Initial configuration
|
||||
|
@ -75,4 +72,3 @@ For example:
|
|||
allowfullscreen>
|
||||
</iframe>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,20 +1,15 @@
|
|||
---
|
||||
title: Writing an Article for Linux Journal
|
||||
description: I'm absolutely delighted to announce that I'm going to be writing an article for Linux Journal magazine's upcoming Drupal special.
|
||||
excerpt: I'm absolutely delighted to announce that I'm going to be writing an article for Linux Journal magazine's upcoming Drupal special.
|
||||
tags:
|
||||
- drupal
|
||||
- distributions
|
||||
- installation-profiles
|
||||
- writing
|
||||
- linux-journal
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
The article is going to be entitled "Speeding Up Your Drupal Development Using Installation Profiles and Distributions" and will be mentioning existing distributions available on Drupal.org, but mainly focussing on the steps needed to create your own custom distribution. Needless to say, I'm quite excited about it!
|
||||
|
||||
The article is expected to be published in October.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,19 +1,15 @@
|
|||
---
|
||||
title: Display a Custom Menu in a Drupal 7 Theme Template File
|
||||
description: For reference, this is the code needed to display a menu in a Drupal 7 template file.
|
||||
excerpt: The code needed to display a menu in a Drupal 7 template file.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-7
|
||||
- drupal-planet
|
||||
- php
|
||||
- aria
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
For reference, this is the code needed to display a menu in a Drupal 7 template file, including the navigation ARIA role.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
```language-php
|
||||
$menu_name = 'menu-footer-menu';
|
||||
$menu_id = 'footer-menu';
|
||||
|
@ -26,4 +22,3 @@ print theme('links', array(
|
|||
)
|
||||
));
|
||||
```
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,18 +1,13 @@
|
|||
---
|
||||
title: Reflections on speaking at UnifiedDiff
|
||||
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.
|
||||
excerpt: Yesterday evening I went along and spoke at the UnifiedDiff meetup in Cardiff.
|
||||
tags:
|
||||
- talks
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
I'm an experienced Drupal Developer, but not an experienced public speaker (although I have done several user training sessions and Drupal demonstrations for clients previously), and I think that some of the nerves that I had beforehand were apparent during the presentation, and being the first speaker for the evening probably didn't help, although I did get a [nice tweet](https://twitter.com/craigmarvelley/status/243418608720543745) mid-way through.
|
||||
|
||||
Initially, after aiming for a 20-minute presentation plus Q&A, I think I wrapped up the presentation in around 14 minutes, although I did about 6 minutes of answering questions afterwards including the apparently mandatory "Why use Drupal compared to WordPress or Joomla?" question, some Drupal 8 and Symfony questions, as well as an interesting question about the White House development project after I'd listed it within a list of example sites. Next time, I think that some more detailed presenter notes are needed. Typically, as soon as it sat back in my seat, the majority of things that I'd managed to remember beforehand all came flooding back to me and I thought "I should have said that whilst I was up speaking".
|
||||
|
||||
Overall, considering my inexperience at speaking to this type of audience, I was fairly happy with my presentation, although I'm sure that I'll change my mind once I've watched the video of it on the UnifiedDiff website. Regardless, I think that it was a great experience and I enjoyed doing it, and I'd like to thank the organisers of UnifiedDiff for having me speak at their meetup. It was great to have a more relaxed conversation with some people after the other speakers had been up, and having introduced Drupal I would be more than happy to come back and do a more in-depth presentation if there is an interest for me to do so.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
---
|
||||
title: My Sublime Text 2 settings
|
||||
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.
|
||||
excerpt: <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
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
[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.
|
||||
|
|
|
@ -1,18 +1,13 @@
|
|||
---
|
||||
title: Accessible Bristol site launched
|
||||
description: I'm happy to report that the Accessible Bristol was launched this week, on Drupal 7.
|
||||
excerpt: I'm happy to report that the Accessible Bristol was launched this week, on Drupal 7.
|
||||
tags:
|
||||
- accessibility
|
||||
- accessible-bristol
|
||||
- nomensa
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
I'm happy to announce that the [Accessible Bristol](http://www.accessiblebristol.org.uk) website was launched this week, on Drupal 7. The site has 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.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
The site has been developed over the past few months, and uses the [User Relationships](http://drupal.org/project/user_relationships) and [Privatemsg](http://drupal.org/project/privatemsg) modules to provide a community-based platform where people with an interest in accessibility can register and network with each other.
|
||||
|
||||
The group is hosting a launch event on the 28th November at the Council House, College Green, Bristol. Interested? More information is available at <http://www.accessiblebristol.org.uk/events/accessible-bristol-launch> or go to <http://buytickets.at/accessiblebristol/6434> to register.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
---
|
||||
title: Open Sublime Text 2 from the Mac OS X Command Line
|
||||
excerpt: How to open Sublime Text from the command line.
|
||||
tags:
|
||||
- sublime-text
|
||||
- mac-os-x
|
||||
- terminal
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
How to open Sublime Text from the command line.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
Paste the following code into the Mac OS X Terminal, assuming that you've installed Sublime Text 2 into the /Applications folder.
|
||||
|
||||
```language-bash
|
||||
|
@ -20,4 +17,3 @@ $ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin
|
|||
Now you can type `sublime <filename>` open a file or directory in Sublime Text, or `sublime .` to open the current directory.
|
||||
|
||||
You can also type `sublime --help` to see a list of the available commands.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: How to use SASS and Compass in Drupal 7 using Sassy
|
||||
excerpt: Use PHPSass and the Sassy module to use Sass and Compass in your Drupal theme.
|
||||
tags:
|
||||
- compass
|
||||
- css
|
||||
|
@ -9,13 +10,9 @@ tags:
|
|||
- less
|
||||
- preprocessing
|
||||
- sass
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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. Here are three modules that provide the ability to use SASS within Drupal.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
* [Sassy](http://drupal.org/project/sassy "Sassy module on drupal.org")
|
||||
* [Prepro](http://drupal.org/project/prepro "Prepro module on drupal.org")
|
||||
* [Libraries API](http://drupal.org/project/libraries "Libraries API module on drupal.org")
|
||||
|
@ -64,4 +61,3 @@ Personally, in development, I'd set caching to 'uncached' and the error reportin
|
|||
## Adding SASS files into your theme
|
||||
|
||||
With this done, you can now add SASS and SCSS files by adding a line like `stylesheets[all][] = css/base.scss` in your theme's .info file.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
---
|
||||
title: Checking if a user is logged into Drupal (the right way)
|
||||
description: How to check if a user is logged into Drupal by using the user_is_logged_in() and user_is_anonymous() functions.
|
||||
excerpt: How to check if a user is logged in by using Drupal core API functions.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-6
|
||||
- drupal-7
|
||||
- drupal-planet
|
||||
- php
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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).
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
---
|
||||
title: Creating and using custom tokens in Drupal 7
|
||||
excerpt: This post outlines the steps required to create your own custom tokens in Drupal.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- drupal-7
|
||||
- tokens
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
This post outlines the steps required to create your own custom tokens in Drupal.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
When writing the recent releases of the [Copyright Block](http://drupal.org/project/copyright_block) module, I used tokens to allow the user to edit and customise their copyright message and place the copyright_message:dates token in the desired position. When the block is rendered, the token is replaced by the necessary dates.
|
||||
|
||||
We will be using the fictional *foo* module to demonstrate this.
|
||||
|
@ -138,4 +135,3 @@ $b = token_replace($a);
|
|||
// This would only use foo tokens.
|
||||
$c = token_replace($a, array('foo'));
|
||||
```
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
---
|
||||
title: The Quickest way to Install Sublime Text 2 in Ubuntu
|
||||
excerpt: After reading numerous blog posts about how to install Sublime Text 2 in Ubuntu, this is definitely the quickest way!
|
||||
tags:
|
||||
- linux
|
||||
- sublime-text
|
||||
- ubuntu
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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!
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
Just paste the following lines into your Terminal:
|
||||
|
||||
```language-bash
|
||||
|
@ -20,4 +17,3 @@ $ 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.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
---
|
||||
title: Leaving Nomensa, Joining Precedent
|
||||
description: Yesterday was my last day working at Nomensa. Next week, I'll be starting as a Senior Developer at Precedent.
|
||||
excerpt: Yesterday was my last day working at Nomensa. Next week, I'll be starting as a Senior Developer at Precedent.
|
||||
tags:
|
||||
- nomensa
|
||||
- precedent
|
||||
- personal
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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").
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
---
|
||||
title: Display Git Branch or Tag Names in your Bash Prompt
|
||||
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.
|
||||
excerpt: 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.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- git
|
||||
- terminal
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Some useful links for using SimpleTest in Drupal
|
||||
excerpt: Here are some useful links that I've found when researching about unit testing in Drupal using SimpleTest.
|
||||
tags:
|
||||
- simpletest
|
||||
- tdd
|
||||
|
@ -7,17 +8,10 @@ tags:
|
|||
- drupal-planet
|
||||
- drupal
|
||||
- testing
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
Here are some useful links that I've found when researching about unit testing in Drupal using SimpleTest.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
* [An Introduction to Unit Testing in Drupal](http://www.lullabot.com/blog/articles/introduction-unit-testing-drupal "An Introduction to Unit Testing in Drupal")
|
||||
* [Module Developer's Guide to SimpleTest](http://www.lullabot.com/blog/articles/drupal-module-developers-guide-simpletest "Module Developer's Guide to SimpleTest")
|
||||
* [SimpleTest Tutorial (Drupal 6)](https://drupal.org/simpletest-tutorial "SimpleTest Tutorial (Drupal 6)")
|
||||
* [SimpleTest Tutorial (Drupal 7)](https://drupal.org/simpletest-tutorial-drupal7 "SimpleTest Tutorial (Drupal 7)")
|
||||
* [SimpleTest Reference](https://drupal.org/node/278126 "SimpleTest Reference")
|
||||
* [Testing with SimpleTest](https://drupal.org/node/1128366 "Testing with SimpleTest")
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,20 +1,17 @@
|
|||
---
|
||||
title: Creating Local and Staging sites with Drupal's Domain Module Enabled
|
||||
excerpt: How to use aliases within Domain module for pre-production sites.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- databases
|
||||
- domain
|
||||
- table-prefixing
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
||||
Rather than changing the domain settings within the Domain module itself, the best solution I think is to use table prefixes and create a different domain table per environment. With a live, staging and local domains, the tables would be named as follows:
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
```language-bash
|
||||
live_domain
|
||||
local_domain
|
||||
|
@ -39,4 +36,3 @@ $databases['default']['default'] = array(
|
|||
```
|
||||
|
||||
Within each environment-specific domain table, update the subdomain column to contain the appropriate domain names.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,16 +1,12 @@
|
|||
---
|
||||
title: Going to DrupalCon
|
||||
excerpt: Precedent are sending myself and two of our other Drupal Developers to Drupalcon Prague.
|
||||
tags:
|
||||
- drupalcon
|
||||
- precedent
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
[Precedent](http://www.precedent.co.uk) are sending myself and two of our other Drupal Developers to [Drupalcon Prague](http://prague2013.drupal.org).
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
Having wanted to attend the last few Drupalcons (London, especially) but not being able to, I'm definitely looking forward to this one.
|
||||
|
||||
See you there!
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,19 +1,15 @@
|
|||
---
|
||||
title: Create a Zen Sub-theme Using Drush
|
||||
description: How to quickly create a Zen sub-theme using Drush.
|
||||
excerpt: How to quickly create a Zen sub-theme using Drush.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- drush
|
||||
- zen
|
||||
- theming
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
How to use [Drush](https://drupal.org/project/drush) to quickly build a new sub-theme of [Zen](https://drupal.org/project/zen).
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
First, download the [Zen](https://drupal.org/project/zen "The Zen theme") theme if you haven't already done so.
|
||||
|
||||
```language-bash
|
||||
|
@ -36,4 +32,3 @@ The parameters that I'm passing it are:
|
|||
This will create a new theme in sites/all/themes/oliverdavies.
|
||||
|
||||
For further help, type `$ drush help zen` to see the Drush help page for the zen command.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
---
|
||||
title: Don't Bootstrap Drupal, Use Drush
|
||||
excerpt: Avoid bootstrapping Drupal manually in your scratch files - Drush has you covered!
|
||||
tags:
|
||||
- drush
|
||||
- drupal-planet
|
||||
- php
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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()`.
|
||||
|
||||
To bootstrap Drupal, you would need to add some additional lines of code to the stop of your script. Here is an alternative way.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
```language-php
|
||||
<?php
|
||||
|
||||
|
@ -51,5 +48,4 @@ Or, if you're using [Drush aliases](http://deeson-online.co.uk/labs/drupal-drush
|
|||
$ 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").
|
||||
{% endblock %}
|
||||
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").
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
---
|
||||
title: Useful Vagrant Commands
|
||||
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>.
|
||||
excerpt: 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
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
[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.
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
---
|
||||
title: Quickly Apply Patches Using Git and curl or wget
|
||||
description: How to quickly download a patch file and apply it to a Git repository in one line
|
||||
excerpt: How to quickly download a patch file and apply it to a Git repository in one line
|
||||
tags:
|
||||
- git
|
||||
- drupal-planet
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
---
|
||||
title: Download Different Versions of Drupal with Drush
|
||||
description: How to download different versions of Drupal core using Drush.
|
||||
excerpt: How to download different versions of Drupal core using Drush.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- drush
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
---
|
||||
title: Some Useful Git Aliases
|
||||
excerpt: Here are some bash aliases that I use and find helpful for quickly writing Git and Git Flow commands.
|
||||
tags:
|
||||
- git
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
Here are some bash aliases that I use and find helpful for quickly writing Git and Git Flow commands.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
These should be placed within your `~/.bashrc` or `~/.bash_profile` file:
|
||||
|
||||
```language-bash
|
||||
|
@ -32,4 +29,3 @@ alias gff="git flow feature"
|
|||
alias gfr="git flow release"
|
||||
alias gfh="git flow hotfix"
|
||||
```
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,21 +1,16 @@
|
|||
---
|
||||
title: DrupalCamp London 2014
|
||||
description: It's all booked, I'm going to be attending DrupalCamp London.
|
||||
excerpt: It's all booked, I'm going to be attending DrupalCamp London.
|
||||
tags:
|
||||
- drupal
|
||||
- drupalcamp-london
|
||||
- git
|
||||
- git-flow
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
It's all booked, I'm going to be attending [DrupalCamp London](http://2014.drupalcamplondon.co.uk) this year, my first DrupalCamp!
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
I'm going as a volunteer, so I'm going to be helping with the registrations on the Saturday morning and for another couple hours elsewhere over the weekend. I've also offered to help organise and oversee some code sprints, although I'm definitely wanting to do some sprinting of my own and attend a few sessions.
|
||||
|
||||
I'm looking forward to meeting some new people as well as catching up with some people that I met at [DrupalCon Prague](http://prague2013.drupal.org).
|
||||
|
||||
If you're also coming, see you there!
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,19 +1,15 @@
|
|||
---
|
||||
title: 'DrupalCamp London: What is Git Flow?'
|
||||
description: Slides and notes from my talk, "What is Git Flow?", that I presented at DrupalCamp London 2014.
|
||||
excerpt: Here are my slides from my "What is Git Flow?" session at DrupalCamp London.
|
||||
tags:
|
||||
- git
|
||||
- git-flow
|
||||
- drupalcamp-london
|
||||
- talks
|
||||
tweets: true
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
Here are my slides from my "What is Git Flow?" session at [DrupalCamp London](http://2014.drupalcamplondon.co.uk).
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% include 'speakerdeck' with { data_id: '201559e0f103013198dd5a5f6f23ab67' } %}
|
||||
|
||||
## Take aways
|
||||
|
@ -44,4 +40,3 @@ I've had some great feedback via Twitter:
|
|||
{% include 'tweet' with {
|
||||
content: '<p>Great talk on git flow <a href="https://twitter.com/opdavies">@opdavies</a> <a href="https://twitter.com/search?q=%23dclondon&src=hash">#dclondon</a></p>— Curve Agency (@CurveAgency) <a href="https://twitter.com/CurveAgency/statuses/440095250775035904">March 2, 2014</a>'
|
||||
} %}
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
---
|
||||
title: Drupal Association
|
||||
excerpt: Next week, I'll be working for the Drupal Association.
|
||||
tags:
|
||||
- drupal
|
||||
- personal
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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).
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
I was at Precedent for just over a year and had the opportunity to work on several Drupal projects from project leading to ad-hoc module and theme development, including my largest Drupal build to date.
|
||||
|
||||
I was also lucky enough to go to [DrupalCon Prague](http://prague2013.drupal.org) as well as [DrupalCamp London](http://2014.drupalcamplondon.co.uk).
|
||||
|
@ -19,4 +16,3 @@ I was able to [contribute some code](https://drupal.org/project/eventsforce) bac
|
|||
It was good to be able to introduce some new tools like [Vagrant](http://www.vagrantup.com), [Puppet](http://www.puppetlabs.com), [SASS](http://www.sass-lang.com) and [Compass](http://www.compass-style.org) into the team. I was pleased to introduce and champion the [Git Flow](http://danielkummer.github.io/git-flow-cheatsheet "Git Flow Cheat Sheet") branching model, which them became the standard approach for all Drupal projects, and hopefully soon all development projects.
|
||||
|
||||
Working for the Drupal Association and on Drupal.org was an opportunity that I couldn't refuse, and is certainly going to be a fun and interesting challenge. I can't wait to get started!
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
---
|
||||
title: Thanks
|
||||
excerpt: Thanks everyone for their comments about my move to the Drupal Association.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-association
|
||||
- personal
|
||||
use: [posts]
|
||||
---
|
||||
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.
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
---
|
||||
title: git format-patch is your Friend
|
||||
excerpt: An explanation of the "git format-patch" command, and how it could be used in Drupal's Git workflow.
|
||||
tags:
|
||||
- patches
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- git
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
An explanation of the "git format-patch" command, and how it could be used in Drupal's Git workflow.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
## The Problem
|
||||
|
||||
As an active contributor to the [Drupal](http://drupal.org) project, I spend a lot of time working with other peoples’ modules and themes, and occassionally have to fix a bug or add some new functionality.
|
||||
|
@ -49,7 +46,6 @@ From 80c8fa14de7f4a83c2e70367aab0aedcadf4f3b0 Mon Sep 17 00:00:00 2001
|
|||
From: Oliver Davies <oliver@oliverdavies.co.uk>
|
||||
Subject: [PATCH] Exclude comment entities when checking if this is the page,
|
||||
otherwise comment_fragment.module will break metatag
|
||||
|
||||
---
|
||||
```
|
||||
|
||||
|
@ -97,4 +93,3 @@ Applying: #2272799 Replaced URL
|
|||
Each line is the commit message associated with that patch.
|
||||
|
||||
Assuming that there are no errors, you can go ahead and push your updated code into your remote repository.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,21 +1,15 @@
|
|||
---
|
||||
title: How to fix Vagrant Loading the Wrong Virtual Machine
|
||||
excerpt: Here are the steps that I took to fix Vagrant and point it back at the correct VM.
|
||||
tags:
|
||||
- vagrant
|
||||
- virtualbox
|
||||
meta:
|
||||
description: How to fix it when Vagrant loads the wrong virtual machine.
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
A few times recently, I've had instances where [Vagrant](https://www.vagrantup.com) 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.
|
||||
|
||||
Here are the steps that I took to fix this and point Vagrant back at the correct VM.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
1. Stop the machine from running using the `$ vagrant halt` command.
|
||||
1. Use the `$ VBoxManage list vms` command to view a list of the virtual machines on your system. Note the ID of the correct VM that should be loading. For example, `"foo_default_1405481857614_74478" {e492bfc3-cac2-4cde-a396-e81e37e421e2}`. The number within the curly brackets is the ID of the virtual machine.
|
||||
1. Within the .vagrant directory in your project (it is hidden by default), update the ID within the machines/default/virtualbox/id file.
|
||||
1. Start the new VM with `$ vagrant up`.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
---
|
||||
title: Updating Features and Adding Components Using Drush
|
||||
excerpt: How to update features on the command line using Drush.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- drush
|
||||
- features
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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.
|
||||
|
||||
If you re-create a feature through the UI, you'll be prompted to download a new archive of the feature in its entirety onto your local computer. You could either commit this into a local repository and then pull it remotely, or use a tool such as SCP to upload the archive onto the server and commit it from there. You can simplify this process by using [Drush](http://drush.org).
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
## Finding Components
|
||||
|
||||
To search for a component, use the `drush features-components` command. This will display a list of all components on the site. As we're only interested in components that haven't been exported yet, add the `--not-exported` option to filter the results.
|
||||
|
@ -51,4 +48,3 @@ Once finished, the feature is updated in it's original location, so there's no d
|
|||
* [The Features project page on Drupal.org](http://www.drupal.org/project/features)
|
||||
* [The "drush features-components" command](http://www.drushcommands.com/drush-6x/features/features-components)
|
||||
* [The "drush features-export" command](http://www.drushcommands.com/drush-6x/features/features-export)
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
---
|
||||
title: Include CSS Fonts by Using a SASS each Loop
|
||||
description: How to use an SASS each loop to easily add multiple fonts to your CSS.
|
||||
excerpt: How to use an SASS each loop to easily add multiple fonts to your CSS.
|
||||
tags:
|
||||
- compass
|
||||
- drupal-planet
|
||||
- fonts
|
||||
- sass
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
How to use an @each loop in SASS to quickly include multiple font files within your stylesheet.
|
||||
|
|
|
@ -1,16 +1,13 @@
|
|||
---
|
||||
title: Using Remote Files when Developing Locally with Stage File Proxy Module
|
||||
excerpt: How to install and configure the Stage File Proxy module to serve remote images on your local Drupal site.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- servers
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
How to install and configure the [Stage File Proxy](https://www.drupal.org/project/stage_file_proxy) module to serve remote images on your local Drupal site.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
As this module is only going to be needed on pre-production sites, it would be better to configure this within your settings.php or settings.local.php file. We do this using the `$conf` array which removes the need to configure the module through the UI and store the values in the database.
|
||||
|
||||
```language-php
|
||||
|
@ -24,9 +21,8 @@ $conf['stage_file_proxy_hotlink'] = TRUE;
|
|||
$conf['stage_file_proxy_use_imagecache_root'] = FALSE;
|
||||
```
|
||||
|
||||
If the origin site is not publicly accessible yet, maybe it's a pre-live or staging site, and protected with a basic access authentication, you can include the username and password within the origin URL.
|
||||
If the origin site is not publicly accessible yet, maybe it's a pre-live or staging site, and protected with a basic access authentication, you can include the username and password within the origin URL.
|
||||
|
||||
```language-php
|
||||
$conf['stage_file_proxy_origin'] = 'http://user:password@prelive.example.com';
|
||||
```
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
---
|
||||
title: Include environment-specific settings files on Pantheon
|
||||
excerpt: How to load a different settings file per environment on Pantheon.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- pantheon
|
||||
- settings.php
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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).
|
||||
|
||||
The way that was recommended was by using a `switch()` function based on Pantheon's environment variable. For example:
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
```language-php
|
||||
switch ($_SERVER['PANTHEON_ENVIRONMENT']) {
|
||||
case 'dev':
|
||||
|
@ -81,4 +78,3 @@ $base_url = '';
|
|||
```
|
||||
|
||||
The environment specific files are also committed into Git and pushed to Pantheon, and are then included automatically on each environment.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Include a Local Drupal Settings file for Environment Configuration and Overrides
|
||||
excerpt: How to create and include a local settings file to define and override environment-specific variables.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-6
|
||||
|
@ -7,13 +8,9 @@ tags:
|
|||
- drupal-8
|
||||
- drupal-planet
|
||||
- settings.php
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
How to create and include a local settings file to define and override environment-specific variables, and keep sensitive things like your database credentials and API keys safe.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
At the bottom of settings.php, add the following code:
|
||||
|
||||
```language-php
|
||||
|
@ -45,4 +42,3 @@ sites/*/private
|
|||
```
|
||||
|
||||
This will allow for settings.php to be added to Git and committed, but not settings.local.php.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Configuring the Reroute Email Module
|
||||
excerpt: How to configure the Reroute Email module, to prevent sending emails to real users from your pre-production sites!
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-6
|
||||
|
@ -7,13 +8,9 @@ tags:
|
|||
- drupal-planet
|
||||
- email
|
||||
draft: true
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
[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.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
> This is useful in case where you do not want email sent from a Drupal site to reach the users. For example, if you copy a live site to a test site for the purpose of development, and you do not want any email sent to real users of the original site. Or you want to check the emails sent for uniform formatting, footers, ...etc.
|
||||
|
||||
As we don't need the module configured on production (we don't need to reroute any emails there), it's best to do this in code using settings.local.php (if you have one) or the standard settings.php file.
|
||||
|
@ -49,4 +46,3 @@ $conf['reroute_email_address'] = implode(';', array(
|
|||
```
|
||||
|
||||
In this example, person2@example.com and person3@example.com would receive their emails from the site as normal. Any emails to addresses not in the array would continue to be redirected to person1@example.com.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,18 +1,14 @@
|
|||
---
|
||||
title: 2014
|
||||
description: A look back at 2014.
|
||||
excerpt: A look back at 2014.
|
||||
tags:
|
||||
- drupal-association
|
||||
- drupalcamp-london
|
||||
- personal
|
||||
tweets: true
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
A lot happened in 2014. Here are some of the main things that I'd like to highlight.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
## Joined the Drupal Association
|
||||
|
||||
This was the main thing for me this year, in May I left [Precedent](http://precedent.com) and joined the [Drupal Association](https://assoc.drupal.org). I work on the Engineering team, focused mainly on [Drupal.org](https://www.drupal.org) but I've also done some theming work on the DrupalCon [Amsterdam](http://amsterdam2014.drupal.org) and [Latin America](http://latinamerica2015.drupal.org) websites, and some pre-launch work on [Drupal Jobs](https://jobs.drupal.org).
|
||||
|
@ -44,9 +40,8 @@ Attending this and [DrupalCon Prague](https://prague2013.drupal.org) in 2013 hav
|
|||
|
||||
## DrupalCon Amsterdam
|
||||
|
||||
I was also able to travel to Holland and attend [DrupalCon Amsterdam](https://amsterdam2014.drupal.org) along with other members of Association staff.
|
||||
I was also able to travel to Holland and attend [DrupalCon Amsterdam](https://amsterdam2014.drupal.org) along with other members of Association staff.
|
||||
|
||||
## DrupalCamp Bristol
|
||||
|
||||
In October, we started planning for [DrupalCamp Bristol](http://www.drupalcampbristol.co.uk). I'm one of the founding Committee members,
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
title: How to Define a Minimum Drupal Core Version
|
||||
description: How to define a minimum Drupal core version for your module or theme.
|
||||
excerpt: How to define a minimum Drupal core version for your module or theme.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-7
|
||||
|
@ -8,9 +8,8 @@ tags:
|
|||
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.'
|
||||
excerpt: 'How to define a minimum Drupal core version for your module or theme.'
|
||||
type: article
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
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).
|
||||
|
|
|
@ -1,23 +1,20 @@
|
|||
---
|
||||
title: Updating Forked Repositories on GitHub
|
||||
meta:
|
||||
description: I just had to update a repo that I forked on GitHub. This is how I did it. Did I do it the correct way?
|
||||
excerpt: I just had to update a repo that I forked on GitHub. This is how I did it. Did I do it the correct way?
|
||||
tags:
|
||||
- git
|
||||
- github
|
||||
- phpstorm
|
||||
- sculpin
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
I just had to update a repo that I forked on GitHub. This is how I did it. Did I do it the correct way?
|
||||
|
||||
## Sculpin
|
||||
|
||||
People may or may not know, but this site runs on [Sculpin](https://sculpin.io/), a PHP based static site generator (this may be the first time that I've mentioned it on this site). The source code is hosted on [GitHub](https://github.com/opdavies/oliverdavies.uk), and I've listed the site on the [Community page](https://sculpin.io/community/) on the Sculpin website.
|
||||
|
||||
To get it there, I forked the [main sculpin.io repository](https://github.com/sculpin/sculpin.io) so that I had [my own copy](https://github.com/opdavies/sculpin.io), created a branch, made my additions and submitted a pull request. Easy enough!
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
## New Domain
|
||||
|
||||
In the last week or so, I've changed this site URL from .co.uk to just .uk, and also updated the GitHub repo URL to match, so I wanted to update the Community page to use the correct URL.
|
||||
|
@ -83,4 +80,3 @@ It would be great to see something similar added to [hub](https://hub.github.com
|
|||
* [PhpStorm - Advanced GitHub Integration: Rebase My GitHub Fork (blog post)](http://blog.jetbrains.com/idea/2011/02/advanced-github-integration-rebase-my-github-fork/)
|
||||
* [Rebasing a GitHub fork inside PhpStorm (video)](https://www.youtube.com/watch?v=Twy-dhVgN4k)
|
||||
* [hub](https://hub.github.com) - makes Git better with GitHub
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,19 +1,14 @@
|
|||
---
|
||||
title: Sculpin and Twig Resources
|
||||
meta:
|
||||
description: A compiled list of resources relating to Sculpin and Twig.
|
||||
excerpt: A list of resources that I compiled whilst preparing for my Sculpin and Twig talk at DrupalCamp North.
|
||||
tags:
|
||||
- sculpin
|
||||
- drupalcamp
|
||||
- drupalcamp-north
|
||||
- twig
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
Here’s a list of resources that I compiled whilst preparing for my [Sculpin and Twig talk](http://drupalcampnorth.org/session/test-drive-twig-sculpin) at [DrupalCamp North](http://drupalcampnorth.org).
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
## General Information
|
||||
|
||||
* <https://sculpin.io>
|
||||
|
@ -47,4 +42,3 @@ Here’s a list of resources that I compiled whilst preparing for my [Sculpin an
|
|||
* <http://twig.sensiolabs.org/>
|
||||
* <http://twig.sensiolabs.org/doc/templates.html> - variables, filters, functions, template inheritance, expressions etc.
|
||||
* Go to http://twig.sensiolabs.org/{foo} to search for a tag, filter, test or function.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,15 +1,12 @@
|
|||
---
|
||||
title: Automating Sculpin Builds with Jenkins CI
|
||||
excerpt: How to use Jenkins to automate building Sculpin websites.
|
||||
tags:
|
||||
- sculpin
|
||||
- jenkins
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
As part of re-building this site with [Sculpin](http://sculpin.io), I wanted to automate the deployments, as in I wouldn't need to run a script like [publish.sh](https://raw.githubusercontent.com/sculpin/sculpin-blog-skeleton/master/publish.sh) locally and have that deploy my code onto my server. Not only did that mean that my local workflow was simpler (update, commit and push, rather than update, commit, push and deploy), but if I wanted to make a quick edit or hotfix, I could log into GitHub or Bitbucket (wherever I decided to host the source code) from any computer or my phone, make the change and have it deployed for me.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
I'd started using [Jenkins CI](http://jenkins-ci.org) during my time at the Drupal Association, and had since built my own Jenkins server to handle deployments of Drupal websites, so that was the logical choice to use.
|
||||
|
||||
## Installing Jenkins and Sculpin
|
||||
|
@ -130,4 +127,3 @@ fi
|
|||
```
|
||||
|
||||
I've been working on a `redirects.php` script that generates redirects from a .csv file, after seeing similar things in the [Pantheon Documentation](https://github.com/pantheon-systems/documentation) and [That Podcast](https://github.com/thatpodcast/thatpodcast.io) repositories. This checks if that file exists, and if so, runs it and generates the source file containing each redirect.
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,21 +1,16 @@
|
|||
---
|
||||
title: Programmatically Load an Entityform in Drupal 7
|
||||
excerpt: How to programmatically load, render and embed an entityform in Drupal 7.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-7
|
||||
- drupal-planet
|
||||
- entityform
|
||||
meta:
|
||||
description: How to programmatically load, render and embed an entityform in Drupal 7.
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
I recently had my first experience using the [Entityform module](https://www.drupal.org/project/entityform) in a project. It was quite easy to configure with different form types, but then I needed to embed the form into an overlay. I was expecting to use the `drupal_get_form()` function and render it, but this didn’t work.
|
||||
|
||||
Here are the steps that I took to be able to load, render and embed the form.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
## Loading the Form
|
||||
|
||||
The first thing that I needed to do to render the form was to load an empty instance of the entityform using `entityform_empty_load()`. In this example, `newsletter` is the name of my form type.
|
||||
|
@ -48,4 +43,3 @@ I could then pass this result into my theme function to render it successfully w
|
|||
|
||||
* [The entityform module](https://www.drupal.org/project/entityform)
|
||||
* [My issue and patch to add the type hint to the entityform_form_wrapper function](https://www.drupal.org/node/2639584)
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
---
|
||||
title: Announcing the Drupal VM Generator
|
||||
excerpt: For the past few weeks, I’ve been working on a personal side project based on Drupal VM - the Drupal VM Generator.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- drupal-vm
|
||||
- drupal-vm-generator
|
||||
- symfony
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
For the past few weeks I’ve been working on a personal side project, based on Drupal VM. It’s called the [Drupal VM Generator][1], and over the weekend I’ve added the final features and fixed the remaining issues, and tagged the 1.0.0 release.
|
||||
{% endblock %}
|
||||
For the past few weeks, I’ve been working on a personal side project based on Drupal VM. It’s called the [Drupal VM Generator][1], and over the weekend I’ve added the final features and fixed the remaining issues, and tagged the 1.0.0 release.
|
||||
|
||||
{% block content %}
|
||||
![](/images/blog/drupalvm-generate-repo.png)
|
||||
|
||||
## What is Drupal VM?
|
||||
|
@ -56,7 +53,6 @@ Please log any bugs or feature requests in the [GitHub issue tracker][11], and I
|
|||
If you’re interested in contributing, please feel free to fork the repository and start doing so, or contact me with any questions.
|
||||
|
||||
__Update 17/02/16:__ The autoloading issue is now fixed if you require the package via Composer, and this has been tagged as the [1.0.1 release][12]
|
||||
{% endblock %}
|
||||
|
||||
[1]: https://github.com/opdavies/drupal-vm-generator
|
||||
[2]: http://www.drupalvm.com
|
||||
|
|
|
@ -1,18 +1,15 @@
|
|||
---
|
||||
title: Simplifying Drupal Migrations with xautoload
|
||||
excerpt: How to use the xautoload module to autoload migration classes within your Drupal 7 migration modules.
|
||||
tags:
|
||||
- autoloading
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- drupal-7
|
||||
- php
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
How to use the [xautoload][1] module to autoload migration classes within your Drupal 7 migration modules.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
## What is xautoload?
|
||||
|
||||
[xautoload][1] is a Drupal module that enables the autoloading of PHP classes, in the same way that you would do so in a [Composer][2] based project such as Drupal 8 or Symfony.
|
||||
|
@ -104,8 +101,6 @@ $node_arguments['ArticleNode'] = array(
|
|||
* [PSR-0][3]
|
||||
* [PSR-4][4]
|
||||
|
||||
{% endblock %}
|
||||
|
||||
[1]: https://www.drupal.org/project/xautoload
|
||||
[2]: http://getcomposer.org
|
||||
[3]: http://www.php-fig.org/psr/psr-0/
|
||||
|
|
|
@ -1,17 +1,14 @@
|
|||
---
|
||||
title: Building Gmail Filters with PHP
|
||||
excerpt: How to use PHP to generate and export filters for Gmail.
|
||||
tags:
|
||||
- php
|
||||
- gmail
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
Earlier this week I wrote a small PHP library called [GmailFilterBuilder][0] that allows you to write Gmail filters in PHP and export them to XML.
|
||||
|
||||
I was already aware of a Ruby library called [gmail-britta][1] that does the same thing, but a) I’m not that familiar with Ruby so the syntax wasn’t that natural to me - it’s been a while since I wrote any Puppet manifests, and b) it seemed like a interesting little project to work on one evening.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
The library contains two classes - `GmailFilter` which is used to create each filter, and `GmailFilterBuilder` that parses the filters and generates the XML using a [Twig][2] template.
|
||||
|
||||
## Usage
|
||||
|
@ -75,7 +72,6 @@ For a working example, see my personal [gmail-filters][3] repository on GitHub.
|
|||
* [The GmailFilterBuilder library on Packagist][4]
|
||||
* [My Gmail filters on GitHub][3]
|
||||
* [My Twig Extensions on Packagist][5]
|
||||
{% endblock %}
|
||||
|
||||
[0]: https://github.com/opdavies/gmail-filter-builder
|
||||
[1]: https://github.com/antifuchs/gmail-britta
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
---
|
||||
title: Drupal VM Generator 2.9.1 Released
|
||||
excerpt: I’ve released some new versions of the Drupal VM Generator.
|
||||
tags: ['drupal-vm-generator', releases]
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
I spent some time yesterday working on the [Drupal VM Generator][0], and have released versions 2.8.1, 2.9.0 and 2.9.1.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
The main updates are:
|
||||
|
||||
- Fixed an `InvalidResponseException` that was thrown from within the `boolean_as_string` Twig filter from the opdavies/twig-extensions library when the `config:generate` command was run in non-interactive mode.
|
||||
|
@ -19,7 +14,6 @@ The main updates are:
|
|||
Currently the project is based on Drupal VM 3.0.0 which is an outdated version ([4.1.0][3] was released today). Adding updates and supporting the newer versions is a high priority, as well as keeping in sync with new releases. This will be easier with the test suite in place.
|
||||
|
||||
My initial thoughts are that version 2.10.0 will support Drupal VM 4.0.0, and if needed, 2.11.0 will ship shortly afterwards and support Drupal VM 4.1.0.
|
||||
{% endblock %}
|
||||
|
||||
[0]: http://www.drupalvmgenerator.com
|
||||
[1]: https://github.com/opdavies/drupal-vm-generator/tree/master/tests/Command
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
---
|
||||
title: Easier Sculpin Commands with Composer and NPM Scripts
|
||||
excerpt: In this video, I show you how I've simplied my Sculpin and Gulp workflow using custom Composer and NPM scripts.
|
||||
tags: [composer, gulp, sculpin]
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
In this video, I show you how I've simplied my Sculpin and Gulp workflow using custom Composer and NPM scripts.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
My website includes several various command line tools - e.g. [Sculpin][4], [Gulp][5] and [Behat][6] - each needing different arguments and options, depending on the command being run. For example, for Sculpin, I normally include several additional options when viewing the site locally - the full command that I use is `./vendor/bin/sculpin generate --watch --server --clean --no-interaction`. Typing this repeatedly is time consuming and could be easily mis-typed, forgotten or confused with other commands.
|
||||
|
||||
In this video, I show you how I've simplied my Sculpin and Gulp workflow using custom Composer and NPM scripts.
|
||||
|
@ -51,7 +48,6 @@ You can also take a look at the full [composer.json][1] and [package.json][2] fi
|
|||
- [Composer scripts][7]
|
||||
- [oliverdavies.uk composer.json][1]
|
||||
- [oliverdavies.uk package.json][2]
|
||||
{% endblock %}
|
||||
|
||||
[0]: https://github.com/paxtonhare/demo-magic
|
||||
[1]: https://github.com/opdavies/oliverdavies.uk/blob/master/composer.json
|
||||
|
|
|
@ -1,13 +1,10 @@
|
|||
---
|
||||
title: Nginx Redirects With Query String Arguments
|
||||
excerpt: How to redirect from an old domain to a new one, and also to redirect from the root example.com domain to the canonical www subdomain.
|
||||
tags: [nginx]
|
||||
use: [posts]
|
||||
---
|
||||
{% block excerpt %}
|
||||
This is an example of how my Nginx configuration looked to redirect from an old domain to a new one, and also to redirect from the root `example.com` domain to the canonical `www` subdomain.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
```language-nginx
|
||||
server {
|
||||
listen 80;
|
||||
|
@ -46,4 +43,3 @@ Here is an demo of it working on this website:
|
|||
|
||||
- [Query string](https://en.wikipedia.org/wiki/Query_string)
|
||||
- [Nginx ngx_http_core_module](http://nginx.org/en/docs/http/ngx_http_core_module.html)
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,22 +1,17 @@
|
|||
---
|
||||
title: Fixing Drupal SimpleTest issues inside Docker Containers
|
||||
excerpt: How I managed to get my Drupal SimpleTest tests to run and pass within Docker containers.
|
||||
tags:
|
||||
- docker
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- simpletest
|
||||
- testing
|
||||
meta:
|
||||
og:
|
||||
description: How I managed to get my Drupal SimpleTest tests to run and pass within Docker containers.
|
||||
---
|
||||
{% block excerpt %}
|
||||
I’ve been a Drupal VM user for a long time, but lately I’ve been using a combination Drupal VM and Docker for my local development environment. There were a couple of issues preventing me from completely switching to Docker - one of which being that when I tried running of my Simpletest tests, a lot of them would fail where they would pass when run within Drupal VM.
|
||||
|
||||
Here’s an excerpt from my `docker-compose.yml` file:
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
**TL;DR** You need to include the name of your web server container as the `--url` option to `run-scripts.php`.
|
||||
|
||||
I’ve been a [Drupal VM][1] user for a long time, but lately I’ve been using a combination Drupal VM and [Docker][0] for my local development environment. There were a couple of issues preventing me from completely switching to Docker - one of which being that when I tried running of my Simpletest tests, a lot of them would fail where they would pass when run within Drupal VM.
|
||||
|
@ -101,7 +96,6 @@ Test run duration: 2 min 31 sec
|
|||
**Note:** In this example I have separate `nginx` and `php` containers, but I've tried and had the same issue when running Nginx and PHP-FPM in the same container - e.g. called `app` - and still needed to add `--url http://app` in order for the tests to run successfully.
|
||||
|
||||
I don’t know if this issue is macOS specfic (I know that [Drupal CI][2] is based on Docker, and I don’t know if it’s an issue) but I’m going to test also on my Ubuntu Desktop environment and investigate further and also compare the test run times for Docker in macOS, Docker in Ubuntu and within Drupal VM. I’m also going to test this with PHPUnit tests with Drupal 8.
|
||||
{% endblock %}
|
||||
|
||||
[0]: https://www.docker.com
|
||||
[1]: https://www.drupalvm.com
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
title: Updating Override Node Options Tests
|
||||
excerpt: ~
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-modules
|
||||
|
@ -7,13 +8,10 @@ tags:
|
|||
- testing
|
||||
draft: true
|
||||
---
|
||||
{% block excerpt %}
|
||||
Recently, I reviewed [a patch][1] in the [Override Node Options][2] module issue queue. For those not familiar with it, the module adds extra permissions for node options like "authored by" and "published on" which are normally only available to users with the `administer nodes` permission. What the patch does is to optionally add another set of permissions that enable options for all content types - e.g. "override published option for all node types", in addition to or instead of the content type specific ones.
|
||||
|
||||
It was quite an old issue and the latest patch needed to be re-rolled due to merge conflicts, but the existing tests still passed. Though as no new tests were added for the new functionality, these needed to be added before I committed it.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
## Reviewing the Existing Tests
|
||||
|
||||
The first thing to do was to run the existing tests and check that they still passed. I do this on the command line by typing `php scripts/run-tests.sh --class OverrideNodeOptionsTestCase`.
|
||||
|
@ -194,7 +192,6 @@ Test run duration: 25 sec
|
|||
<img src="/images/blog/override-node-options-refactor-tests-new-passing.png" alt="">
|
||||
|
||||
[Here][3] are my full changes from the previous patch, where I added the new tests as well as some small refactors.
|
||||
{% endblock %}
|
||||
|
||||
[1]: https://www.drupal.org/node/974730
|
||||
[2]: https://www.drupal.org/project/override_node_options
|
||||
|
|
|
@ -1,26 +1,22 @@
|
|||
---
|
||||
title: DrupalCamp Bristol 2017 - Early Bird Tickets, Call for Sessions, Sponsors
|
||||
excerpt: In less than two months time, DrupalCamp Bristol will be back for our third year.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- drupalcamp
|
||||
- drupalcamp-bristol
|
||||
meta:
|
||||
og:
|
||||
image:
|
||||
url: /assets/image/blog/drupalcamp-bristol-17-logo.jpg
|
||||
height: 228
|
||||
width: 448
|
||||
type: image/jpg
|
||||
type: website
|
||||
image:
|
||||
url: /assets/image/blog/drupalcamp-bristol-17-logo.jpg
|
||||
height: 228
|
||||
width: 448
|
||||
type: image/jpg
|
||||
---
|
||||
{% block excerpt %}
|
||||
<p class="text-center" markdown="1">![DrupalCamp Bristol 2017 logo](/images/blog/drupalcamp-bristol-17-logo.jpg)</p>
|
||||
|
||||
In less than two months time, [DrupalCamp Bristol][0] will be back for our third year! (July seems to come around quicker each year). This is this year’s schedule and venues:
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
+ 30th June - CXO (Business) day - [Watershed][1]
|
||||
+ 1st July - Developer conference - [University of Bristol, School of Chemistry][2]
|
||||
+ 2nd July - Contribution sprints - Venue TBC
|
||||
|
@ -36,7 +32,6 @@ Not bought your tickets yet? [Early bird tickets][10] for the CXO and conference
|
|||
We still have [sponsorships opportunities][6] available (big thanks to [Microserve][7], [Deeson][8] and [Proctors][9]) who have already signed up), but be quick if you want to be included in our brochure so that we can get you added before our print deadline! Without our sponsors, putting on this event each year would not be possible.
|
||||
|
||||
Any other questions? Take a look at [our website][0] or get in touch via [Twitter][5] or [email][11].
|
||||
{% endblock %}
|
||||
|
||||
[0]: https://2017.drupalcampbristol.co.uk
|
||||
[1]: http://www.watershed.co.uk
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
---
|
||||
title: Turning Your Custom Drupal Module into a Feature
|
||||
excerpt: How to turn a custom Drupal module into a Feature.
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-7
|
||||
- drupal-planet
|
||||
- features
|
||||
---
|
||||
{% block excerpt %}
|
||||
Yesterday I was fixing a bug in an inherited Drupal 7 custom module, and I decided that I was going to add some tests to ensure that the bug was fixed and doesn’t get accidentially re-introduced in the future. The test though required me to have a particular content type and fields which are specific to this site, so weren’t present within the standard installation profile used to run tests.
|
||||
|
||||
I decided to convert the custom module into a [Feature][0] so that the content type and it’s fields could be added to it, and therefore present on the testing site once the module is installed.
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
To do this, I needed to expose the module to the Features API.
|
||||
|
||||
All that’s needed is to add this line to the `mymodule.info` file:
|
||||
|
@ -25,6 +22,5 @@ features[features_api][] = api:2
|
|||
After clearing the cache, the module is now visible in the Features list - and ready to have the appropriate configuration added to it.
|
||||
|
||||
!['The features list showing the custom module'](/images/blog/custom-module-as-a-feature.png)
|
||||
{% endblock %}
|
||||
|
||||
[0]: https://www.drupal.org/project/features
|
||||
|
|
|
@ -1,20 +1,17 @@
|
|||
---
|
||||
title: Introducing the Drupal Meetups Twitterbot
|
||||
excerpt: I’ve written a twitterbot for promoting Drupal meetups.
|
||||
tags:
|
||||
- twitter
|
||||
- php
|
||||
---
|
||||
{% block excerpt %}
|
||||
<p class="text-center" markdown="1">![](/images/blog/drupal-meetups-twitterbot.png)</p>
|
||||
|
||||
The [Drupal Meetups Twitterbot][0] is a small project that I worked on a few months ago, but hadn't got around to promoting yet. It’s intention is to provide [one Twitter account][1] where people can get the up to date news from various Drupal meetups.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
It works by having a whitelist of [Twitter accounts and hashtags][2] to search for, uses [Codebird][3] to query the Twitter API and retweets any matching tweets on a scheduled basis.
|
||||
|
||||
If you would like your meetup group to be added to the list of searched accounts, please [open an issue][4] on the GitHub repo.
|
||||
{% endblock %}
|
||||
|
||||
[0]: https://github.com/opdavies/drupal-meetups-twitterbot
|
||||
[1]: https://twitter.com/drupal_meetups
|
||||
|
|
|
@ -1,24 +1,20 @@
|
|||
---
|
||||
title: Publishing Sculpin Sites with GitHub Pages
|
||||
excerpt: How I moved my website to GitHub pages.
|
||||
tags: [sculpin, php, github]
|
||||
meta:
|
||||
description: 'How I moved my Sculpin site to GitHub Pages.'
|
||||
og:
|
||||
image:
|
||||
url: '/images/blog/jackson-octocat.png'
|
||||
type: 'image/png'
|
||||
height: 200
|
||||
width: 451
|
||||
image:
|
||||
url: '/images/blog/jackson-octocat.png'
|
||||
type: 'image/png'
|
||||
height: 200
|
||||
width: 451
|
||||
---
|
||||
{% block excerpt %}
|
||||
<p class="text-center" markdown="1">![](/images/blog/jackson-octocat.png)</p>
|
||||
|
||||
Earlier this week I moved this site from my personal Linode server to [GitHub Pages][0].
|
||||
|
||||
This made sense as I already kept the source code in [on GitHub][1], the issue was that GitHub Pages doesn’t know how to dynamically parse and generate a Sculpin site like it does with some other static site generators. It can though parse and serve HTML files, which is what Sculpin generates. It’s just a case of how those files are added to GitHub.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
I’ve seen different implementations of this, mostly where the Sculpin code is on one branch, and the generated HTML code is on a separate `gh-pages` or `master` branch (depending on your repository name). I’m not fond of this approach as it means automatically checking out and merging branches which can get messy, and also it’s weird to look at a repo’s branches page and see one branch maybe tens or hundreds of commits both ahead and behind the default branch.
|
||||
|
||||
This has been made simpler and tidier now that we can use a `docs` directory within the repository to serve content.
|
||||
|
@ -76,7 +72,6 @@ As the site was previously using HTTPS, I didn’t want to have to go back to HT
|
|||
- [Publishing your GitHub Pages site from a /docs folder on your master branch][2]
|
||||
- [Bypassing Jekyll on GitHub Pages][5]
|
||||
- [Secure and fast GitHub Pages with CloudFlare][6]
|
||||
{% endblock %}
|
||||
|
||||
[0]: https://pages.github.com
|
||||
[1]: https://github.com/opdavies/oliverdavies.uk
|
||||
|
|
|
@ -1,25 +1,18 @@
|
|||
---
|
||||
title: Writing a new Drupal 8 Module using Test Driven Development (TDD)
|
||||
tags: [drupal, testing, tdd, simpletest, phpunit]
|
||||
use: [posts]
|
||||
excerpt: How to write automated tests and follow test driven development for Drupal modules.
|
||||
meta:
|
||||
og:
|
||||
title: Writing a new Drupal 8 Module using Test Driven Development (TDD)
|
||||
description: "How to write tests and follow TDD for Drupal applications."
|
||||
type: website
|
||||
image:
|
||||
url: /images/talks/test-driven-drupal-development.png
|
||||
width: 2560
|
||||
height: 1440
|
||||
type: image/png
|
||||
image:
|
||||
url: /images/talks/test-driven-drupal-development.png
|
||||
width: 2560
|
||||
height: 1440
|
||||
type: image/png
|
||||
---
|
||||
{% block excerpt %}
|
||||
<p class="text-center" markdown="1">![](/images/blog/drupalcamp-dublin.jpg)</p>
|
||||
|
||||
I recently gave a [talk on automated testing in Drupal][0] talk at [DrupalCamp Dublin][1] and as a lunch and learn session for my colleagues at Microserve. As part of the talk, I gave an example of how to build a Drupal 8 module using a test driven approach. I’ve released the [module code on GitHub][2], and this post outlines the steps of the process.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
## Prerequisites
|
||||
|
||||
You have created a `core/phpunit.xml` file based on `core/phpunit.xml.dist`, and populated it with your database credentials so that PHPUnit can bootstrap the Drupal database as part of the tests. [Here is an example][5].
|
||||
|
@ -41,7 +34,7 @@ be enabled. In Drupal 8, this is the `.info.yml` file.
|
|||
# tdd_dublin.info.yml
|
||||
|
||||
name: 'TDD Dublin'
|
||||
description: 'A demo module for DrupalCamp Dublin to show test driven module development.'
|
||||
excerpt: 'A demo module for DrupalCamp Dublin to show test driven module development.'
|
||||
core: 8.x
|
||||
type: module
|
||||
```
|
||||
|
@ -139,7 +132,7 @@ dependencies:
|
|||
id: pages
|
||||
label: pages
|
||||
module: views
|
||||
description: ''
|
||||
excerpt: ''
|
||||
tag: ''
|
||||
base_table: node_field_data
|
||||
base_field: nid
|
||||
|
@ -574,8 +567,7 @@ They all pass, so we be confident that the code works as expected, we can contin
|
|||
|
||||
## Next Steps
|
||||
|
||||
I’ve started looking into whether some of the tests can be rewritten as kernel tests, which should result in quicker test execution. I will post any updated code to the [GitHub repository][3], and will also do another blog post highlighting the differences between functional and kernel tests and the steps taken to do the conversion.
|
||||
{% endblock %}
|
||||
I’ve started looking into whether some of the tests can be rewritten as kernel tests, which should result in quicker test execution. I will post any updated code to the [GitHub repository][3], and will also do another blog post highlighting the differences between functional and kernel tests and the steps taken to do the conversion.
|
||||
|
||||
[0]: {{site.url}}/talks/tdd-test-driven-drupal
|
||||
[1]: http://2017.drupal.ie
|
||||
|
|
|
@ -1,26 +1,20 @@
|
|||
---
|
||||
title: DrupalCamp Bristol 2018 Statement
|
||||
excerpt: Unfortunately, we won’t be running DrupalCamp Bristol this year.
|
||||
tags:
|
||||
- drupal-planet
|
||||
- drupalcamp-bristol
|
||||
use:
|
||||
- posts
|
||||
meta:
|
||||
og:
|
||||
title: DrupalCamp Bristol 2018 Statement
|
||||
description: 'It’s with heavy hearts that we are announcing there won’t be a DrupalCamp Bristol 2018.'
|
||||
type: website
|
||||
image:
|
||||
url: /images/blog/drupalcamp-bristol-17-logo.jpg
|
||||
width: 228
|
||||
height: 448
|
||||
type: image/img
|
||||
image:
|
||||
url: /images/blog/drupalcamp-bristol-17-logo.jpg
|
||||
width: 228
|
||||
height: 448
|
||||
type: image/img
|
||||
---
|
||||
{% block excerpt %}
|
||||
It’s with heavy hearts that we are announcing there won’t be a DrupalCamp Bristol 2018. The committee have looked at the amount of work required to put the camp on and the capacity we all have and the two numbers are irreconcilable.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
Seeing Drupalists from all over the country and from overseas come to Bristol to share knowledge and ideas is something we take pride in. The past three camps have been fantastic, but as a trend we have left it later and later to organise.
|
||||
|
||||
This year is the latest we have left to organise and we believe this is because we are all a bit fatigued right now, so it seems like a good place to stop and take stock.
|
||||
|
@ -34,4 +28,3 @@ We’ll take the gap this year to reevaluate who DrupalCamp Bristol is for and w
|
|||
The DrupalCamp Bristol organising committee
|
||||
|
||||
Tom, Ollie, Emily, Sophie, Rob, Mark
|
||||
{% endblock %}
|
||||
|
|
|
@ -1,20 +1,18 @@
|
|||
---
|
||||
title: Using Tailwind CSS in your Drupal Theme
|
||||
excerpt: What is Tailwind CSS, and how do I use it in Drupal theme?
|
||||
tags:
|
||||
- drupal
|
||||
- drupal-planet
|
||||
- drupal-theming
|
||||
- tailwind-css
|
||||
---
|
||||
{% block excerpt %}
|
||||
## What is Tailwind?
|
||||
|
||||
> Tailwind is a utility-first CSS framework for rapidly building custom user interfaces.
|
||||
|
||||
It generates a number of utility classes that you can add to your theme's markup to apply different styling, as well as the ability to apply classes to other markup and create components comprised of utility classes using a custom `@apply` PostCSS directive.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
## Initial Configuration
|
||||
|
||||
The installation and configuration steps are essentially the same as those outlined within the [Tailwind documentation][1], and should be performed within your custom theme's directory (e.g. `sites/all/themes/custom/mytheme` for Drupal 7 or `themes/custom/mytheme` for Drupal 8:
|
||||
|
@ -86,7 +84,6 @@ With the `!important` rule enabled though, the Tailwind’s class takes preceden
|
|||
## Example
|
||||
|
||||
For an example of Tailwind within a Drupal 8 theme, see the custom theme for the [Drupal Bristol website][0] on GitHub.
|
||||
{% endblock %}
|
||||
|
||||
[0]: https://github.com/drupalbristol/drupal-bristol-website/tree/master/web/themes/custom/drupalbristol
|
||||
[1]: https://tailwindcss.com/docs/installation
|
||||
|
|
|
@ -1,21 +1,14 @@
|
|||
---
|
||||
title: Looking forward to DrupalCamp London
|
||||
excerpt: This weekend is DrupalCamp London 2018. I’ll be there along with a number of my Microserve colleagues.
|
||||
tags:
|
||||
- drupal
|
||||
- drupalcamp
|
||||
- drupalcamp-london
|
||||
- speaking
|
||||
meta:
|
||||
og:
|
||||
title: Looking forward to DrupalCamp London
|
||||
description: ''
|
||||
type: website
|
||||
---
|
||||
{% block excerpt %}
|
||||
This weekend is [DrupalCamp London 2018][1]. I’ll be there along with a number of my [Microserve][2] colleagues.
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
I look forward to DrupalCamp London every year, partly because it was the first DrupalCamp that I attended back in 2014. It was also the first DrupalCamp that I [gave a talk][3] at, when I presented a session about Git Flow having given only one user group talk before.
|
||||
|
||||
I’ve presented sessions at every DrupalCamp London since (including two last year), and I’m lucky enough to be [speaking again this year][4] due to one of the originally announced speakers no longer being able to make it to the event.
|
||||
|
@ -41,7 +34,6 @@ I’m also looking forward to catching up with former colleagues, spending some
|
|||
For nostalgia, [here’s the blog post][0] that I wrote before I attended my first DrupalCamp London.
|
||||
|
||||
See everyone this weekend!
|
||||
{% endblock %}
|
||||
|
||||
[0]: {{site.url}}/blog/2014/02/09/drupalcamp-london-2014
|
||||
[1]: https://drupalcamp.london
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue