From ff9f0a7b0b92a728b9c239e9759259ed7b5b41f7 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Mon, 31 Dec 2018 12:13:05 +0000 Subject: [PATCH] Fix excerpts on blog posts --- assets/sass/components/button.sass | 8 +++--- source/_layouts/post.html.twig | 4 +-- ...al-6s-taxonomy-lists-php-css-and-jquery.md | 8 ++---- ...g-imagecache-and-imagecrop-my-portfolio.md | 16 +++++------- ...-06-conditional-email-addresses-webform.md | 2 +- source/_posts/2010-05-10-zenophile.md | 2 +- ...eshow-multiple-images-using-fancy-slide.md | 6 +---- ...es-images-using-imagefieldimport-module.md | 6 +---- ...ove-jpg-quality-imagecache-and-imageapi.md | 6 +---- ...dia-icons-using-cck-views-and-nodequeue.md | 8 ++---- .../2010-06-25-useful-drupal-6-modules.md | 6 +---- ...photo-gallery-using-feeds-cck-and-views.md | 6 +---- ...e-content-type-multiple-nodes-using-sql.md | 6 +---- ...rtual-hosts-mac-os-x-using-virtualhostx.md | 6 +---- ...-taxonomy-term-multiple-nodes-using-sql.md | 7 +---- .../2010-07-12-review-teleport-module.md | 6 +---- .../2010-08-10-review-adminhover-module.md | 2 +- ...eate-better-photo-gallery-drupal-part-1.md | 10 +++---- ...eate-better-photo-gallery-drupal-part-2.md | 10 +++---- .../2010-08-20-review-image-caption-module.md | 6 +---- ...010-09-26-south-wales-drupal-user-group.md | 4 +-- .../2010-10-10-create-and-apply-patches.md | 6 +---- ...eate-better-photo-gallery-drupal-part-3.md | 6 +---- ...ate-better-photo-gallery-drupal-part-21.md | 6 +---- ...ons-search-and-replace-coda-or-textmate.md | 9 ++----- ...embed-typekit-fonts-your-drupal-website.md | 2 +- ...-03-15-display-number-facebook-fans-php.md | 6 +---- source/_posts/2011-03-31-proctor-stevenson.md | 2 +- ...-20-proctors-hosting-next-drupal-meetup.md | 2 +- .../2011-05-23-imagefield-import-archive.md | 2 +- ...groups-drupal-7-using-field-collections.md | 6 +---- ...-configure-subversion-svn-server-ubuntu.md | 6 +---- .../2012-01-04-site-upgraded-drupal-7.md | 3 ++- ...keys-create-passwordless-ssh-connection.md | 12 +++------ ...reprocessor-using-omega-tools-and-drush.md | 6 +---- .../2012-04-17-installing-nagios-centos.md | 2 +- ...-adding-custom-theme-templates-drupal-7.md | 3 +-- ...-23-add-date-popup-calendar-custom-form.md | 6 +---- ...kout-specific-revision-svn-command-line.md | 7 +---- ...n-another-using-modrewrite-and-htaccess.md | 6 +---- ...isplaying-text-files-within-web-browser.md | 6 +---- ...-05-23-writing-info-file-drupal-7-theme.md | 8 +----- ...and-preprocess-functions-separate-files.md | 3 +-- .../2012-07-12-my-new-drupal-modules.md | 7 +---- ...-14-install-nomensa-media-player-drupal.md | 6 +---- ...012-07-27-writing-article-linux-journal.md | 7 +---- ...ustom-menu-drupal-7-theme-template-file.md | 7 +---- ...-09-06-reflections-speaking-unifieddiff.md | 7 +---- .../2012-10-25-my-sublime-text-2-settings.md | 3 +-- .../2012-11-15-accessible-bristol-site.md | 7 +---- ...en-sublime-text-2-mac-os-x-command-line.md | 6 +---- ...e-sass-and-compass-drupal-7-using-sassy.md | 6 +---- ...hecking-if-user-logged-drupal-right-way.md | 3 +-- ...eating-and-using-custom-tokens-drupal-7.md | 6 +---- ...ckest-way-install-sublime-text-2-ubuntu.md | 6 +---- ...04-20-leaving-nomensa-joining-precedent.md | 3 +-- ...it-branch-or-tag-names-your-bash-prompt.md | 3 +-- ...me-useful-links-using-simpletest-drupal.md | 8 +----- ...ing-sites-drupals-domain-module-enabled.md | 6 +---- source/_posts/2013-07-26-going-drupalcon.md | 6 +---- ...-09-06-create-zen-sub-theme-using-drush.md | 7 +---- ...3-11-19-dont-bootstrap-drupal-use-drush.md | 8 ++---- .../2013-11-27-useful-vagrant-commands.md | 3 +-- ...pply-patches-using-git-and-curl-or-wget.md | 3 +-- ...ownload-different-versions-drupal-drush.md | 3 +-- .../2014-01-15-some-useful-git-aliases.md | 6 +---- .../2014-02-09-drupalcamp-london-2014.md | 7 +---- source/_posts/2014-03-03-what-git-flow.md | 7 +---- .../_posts/2014-05-03-drupal-association.md | 6 +---- source/_posts/2014-05-06-thanks.md | 2 +- source/_posts/2014-05-21-git-format-patch.md | 7 +---- ...x-vagrant-loading-wrong-virtual-machine.md | 8 +----- ...tures-and-adding-components-using-drush.md | 6 +---- ...-include-css-fonts-using-sass-each-loop.md | 3 +-- ...eloping-locally-stage-file-proxy-module.md | 8 ++---- .../2014-11-27-pantheon-settings-files.md | 6 +---- ...environment-configuration-and-overrides.md | 6 +---- ...22-configuring-the-reroute-email-module.md | 6 +---- source/_posts/2015-03-20-2014.md | 9 ++----- .../_posts/2015-04-03-minimum-core-version.md | 5 ++-- ...2015-06-18-updating-forked-github-repos.md | 10 +++---- .../2015-07-19-sculpin-twig-resources.md | 8 +----- .../2015-07-21-automating-sculpin-jenkins.md | 6 +---- source/_posts/2015-12-22-entityform.md | 8 +----- ...2-15-announcing-the-drupal-vm-generator.md | 8 ++---- ...ifying-drupal-migrations-with-xautoload.md | 7 +---- ...016-07-15-building-gmail-filters-in-php.md | 6 +---- .../2016-12-30-drupal-vm-generator-updates.md | 8 +----- ...-commands-with-composer-and-npm-scripts.md | 6 +---- ...x-redirects-with-query-string-arguments.md | 6 +---- ...7-05-05-fixing-drupal-simpletest-docker.md | 8 +----- ...05-updating-override-node-options-tests.md | 5 +--- ...ol-early-bird-tickets-sessions-sponsors.md | 17 +++++------- ...5-20-turning-drupal-module-into-feature.md | 6 +---- ...troducing-the-drupal-meetups-twitterbot.md | 5 +--- ...lishing-sculpin-sites-with-github-pages.md | 17 +++++------- ...upal-module-test-driven-development-tdd.md | 26 +++++++------------ .../2018-01-30-drupalcamp-bristol-2018.md | 19 +++++--------- ...using-tailwind-css-in-your-drupal-theme.md | 5 +--- ...27-looking-forward-to-drupalcamp-london.md | 10 +------ ...27-queuing-private-messages-in-drupal-8.md | 10 +------ ...18-02-28-building-the-new-phpsw-website.md | 5 +--- ...-mediacurrent-contrib-half-hour-is-back.md | 9 +++---- .../2018-03-04-tweets-drupalcamp-london.md | 5 +--- .../_posts/2018-03-09-drupal-8-5-released.md | 6 +---- ...-splitting-new-drupal-project-from-repo.md | 5 +--- .../2018-03-12-php-apps-subdirectory-nginx.md | 5 +--- ...04-23-back-to-the-future-git-diff-apply.md | 9 ++++--- ...-05-06-creating-custom-docksal-commands.md | 4 ++- ...-environment-variables-settings-docksal.md | 5 +--- ...8-06-28-drupal-bristol-testing-workshop.md | 6 +---- ...-running-phpunit-tests-docksal-phpstorm.md | 5 +--- .../2018-08-01-croeso-php-south-wales.md | 5 +--- ...-commerce-fixing-error-on-user-checkout.md | 5 +--- ...6-null-users-and-system-users-in-drupal.md | 5 +--- ...1-experimenting-with-events-in-drupal-8.md | 11 +++----- ...amples-of-laravel-collections-in-drupal.md | 5 +--- ...-04-quick-project-switching-in-phpstorm.md | 5 +--- ...merce-promotions-illiminate-collections.md | 5 +--- ...18-11-20-drupalcamp-london-2019-tickets.md | 5 +--- ...building-bartik-with-vuejs-tailwind-css.md | 4 +-- ...18-12-16-published-my-first-npm-package.md | 5 +--- ...g-bartik-with-vuejs-tailwind-css-part-2.md | 4 +-- ...cquia-dashboard-with-vuejs-tailwind-css.md | 4 +-- 124 files changed, 187 insertions(+), 604 deletions(-) diff --git a/assets/sass/components/button.sass b/assets/sass/components/button.sass index e9079381..898282f3 100644 --- a/assets/sass/components/button.sass +++ b/assets/sass/components/button.sass @@ -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 diff --git a/source/_layouts/post.html.twig b/source/_layouts/post.html.twig index d025bb07..d03a8fd4 100644 --- a/source/_layouts/post.html.twig +++ b/source/_layouts/post.html.twig @@ -7,8 +7,8 @@ - -{% if page.meta.description %}{% endif %} + + {% endblock %} {% block content_wrapper %} diff --git a/source/_posts/2010-04-05-style-drupal-6s-taxonomy-lists-php-css-and-jquery.md b/source/_posts/2010-04-05-style-drupal-6s-taxonomy-lists-php-css-and-jquery.md index 2a906bd2..56f41eff 100644 --- a/source/_posts/2010-04-05-style-drupal-6s-taxonomy-lists-php-css-and-jquery.md +++ b/source/_posts/2010-04-05-style-drupal-6s-taxonomy-lists-php-css-and-jquery.md @@ -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
@@ -60,4 +57,3 @@ This code finds the last item in the list, uses **.prev** to select the one befo content: " and"; } ``` -{% endblock %} diff --git a/source/_posts/2010-04-28-using-imagecache-and-imagecrop-my-portfolio.md b/source/_posts/2010-04-28-using-imagecache-and-imagecrop-my-portfolio.md index 3acf17c0..f7b79556 100644 --- a/source/_posts/2010-04-28-using-imagecache-and-imagecrop-my-portfolio.md +++ b/source/_posts/2010-04-28-using-imagecache-and-imagecrop-my-portfolio.md @@ -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 %} diff --git a/source/_posts/2010-05-06-conditional-email-addresses-webform.md b/source/_posts/2010-05-06-conditional-email-addresses-webform.md index 4d314035..732078b0 100644 --- a/source/_posts/2010-05-06-conditional-email-addresses-webform.md +++ b/source/_posts/2010-05-06-conditional-email-addresses-webform.md @@ -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: diff --git a/source/_posts/2010-05-10-zenophile.md b/source/_posts/2010-05-10-zenophile.md index fa13c9e3..bc8d78cf 100644 --- a/source/_posts/2010-05-10-zenophile.md +++ b/source/_posts/2010-05-10-zenophile.md @@ -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! diff --git a/source/_posts/2010-05-25-create-slideshow-multiple-images-using-fancy-slide.md b/source/_posts/2010-05-25-create-slideshow-multiple-images-using-fancy-slide.md index 6a4d9fc2..c59e6d54 100644 --- a/source/_posts/2010-05-25-create-slideshow-multiple-images-using-fancy-slide.md +++ b/source/_posts/2010-05-25-create-slideshow-multiple-images-using-fancy-slide.md @@ -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 %} diff --git a/source/_posts/2010-05-29-quickly-import-multiples-images-using-imagefieldimport-module.md b/source/_posts/2010-05-29-quickly-import-multiples-images-using-imagefieldimport-module.md index f9f5939f..43566957 100644 --- a/source/_posts/2010-05-29-quickly-import-multiples-images-using-imagefieldimport-module.md +++ b/source/_posts/2010-05-29-quickly-import-multiples-images-using-imagefieldimport-module.md @@ -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 %} diff --git a/source/_posts/2010-06-02-improve-jpg-quality-imagecache-and-imageapi.md b/source/_posts/2010-06-02-improve-jpg-quality-imagecache-and-imageapi.md index fac0162b..3f86d5d9 100644 --- a/source/_posts/2010-06-02-improve-jpg-quality-imagecache-and-imageapi.md +++ b/source/_posts/2010-06-02-improve-jpg-quality-imagecache-and-imageapi.md @@ -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 %} diff --git a/source/_posts/2010-06-23-create-block-social-media-icons-using-cck-views-and-nodequeue.md b/source/_posts/2010-06-23-create-block-social-media-icons-using-cck-views-and-nodequeue.md index 7ac56673..72b1d9df 100644 --- a/source/_posts/2010-06-23-create-block-social-media-icons-using-cck-views-and-nodequeue.md +++ b/source/_posts/2010-06-23-create-block-social-media-icons-using-cck-views-and-nodequeue.md @@ -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 %} diff --git a/source/_posts/2010-06-25-useful-drupal-6-modules.md b/source/_posts/2010-06-25-useful-drupal-6-modules.md index dba186c9..5e6ac2e8 100644 --- a/source/_posts/2010-06-25-useful-drupal-6-modules.md +++ b/source/_posts/2010-06-25-useful-drupal-6-modules.md @@ -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):**
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):
**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):
**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):**
What this module aims to accomplish is the ability to quickly find the module you are looking for without having to rely on the browsers search feature which more times than not shows you the module name in the 'Required by' or 'Depends on' sections of the various modules or even some other location on the page like a menu item. * **[Zenophile](http://drupal.org/project/zenophile):**
Quickly create Zen subthemes. * **[Add Another](http://drupal.org/project/addanother):**
Add another displays a message after a user creates a node, and/or displays an "Add another" tab on nodes allowing them to make another node of the same type. You can control what roles and node types see this feature. -{% endblock %} diff --git a/source/_posts/2010-06-28-create-flickr-photo-gallery-using-feeds-cck-and-views.md b/source/_posts/2010-06-28-create-flickr-photo-gallery-using-feeds-cck-and-views.md index 9d149ef0..2bdefc96 100644 --- a/source/_posts/2010-06-28-create-flickr-photo-gallery-using-feeds-cck-and-views.md +++ b/source/_posts/2010-06-28-create-flickr-photo-gallery-using-feeds-cck-and-views.md @@ -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 %} diff --git a/source/_posts/2010-07-01-change-content-type-multiple-nodes-using-sql.md b/source/_posts/2010-07-01-change-content-type-multiple-nodes-using-sql.md index 5147aaf4..77ff28f8 100644 --- a/source/_posts/2010-07-01-change-content-type-multiple-nodes-using-sql.md +++ b/source/_posts/2010-07-01-change-content-type-multiple-nodes-using-sql.md @@ -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 %} diff --git a/source/_posts/2010-07-02-create-virtual-hosts-mac-os-x-using-virtualhostx.md b/source/_posts/2010-07-02-create-virtual-hosts-mac-os-x-using-virtualhostx.md index 11635d7d..96b2f5ca 100644 --- a/source/_posts/2010-07-02-create-virtual-hosts-mac-os-x-using-virtualhostx.md +++ b/source/_posts/2010-07-02-create-virtual-hosts-mac-os-x-using-virtualhostx.md @@ -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 %} diff --git a/source/_posts/2010-07-07-add-taxonomy-term-multiple-nodes-using-sql.md b/source/_posts/2010-07-07-add-taxonomy-term-multiple-nodes-using-sql.md index 0444dd81..6739e033 100644 --- a/source/_posts/2010-07-07-add-taxonomy-term-multiple-nodes-using-sql.md +++ b/source/_posts/2010-07-07-add-taxonomy-term-multiple-nodes-using-sql.md @@ -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 %} diff --git a/source/_posts/2010-07-12-review-teleport-module.md b/source/_posts/2010-07-12-review-teleport-module.md index afc17317..4c0564af 100644 --- a/source/_posts/2010-07-12-review-teleport-module.md +++ b/source/_posts/2010-07-12-review-teleport-module.md @@ -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 %} diff --git a/source/_posts/2010-08-10-review-adminhover-module.md b/source/_posts/2010-08-10-review-adminhover-module.md index 1e5eae93..29a66a15 100644 --- a/source/_posts/2010-08-10-review-adminhover-module.md +++ b/source/_posts/2010-08-10-review-adminhover-module.md @@ -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! diff --git a/source/_posts/2010-08-11-create-better-photo-gallery-drupal-part-1.md b/source/_posts/2010-08-11-create-better-photo-gallery-drupal-part-1.md index ae4cf69e..79a43e35 100644 --- a/source/_posts/2010-08-11-create-better-photo-gallery-drupal-part-1.md +++ b/source/_posts/2010-08-11-create-better-photo-gallery-drupal-part-1.md @@ -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 There are currently ' . $selected_gallery_total . ' photos in this gallery.'; +if ($selected_gallery_total != 0) { + $output = 'There are currently ' . $selected_gallery_total . ' photos in this gallery.'; $output .= 'Last one added on ' . date("l, jS F, Y", $latest_photo) . '.'; print $output; } @@ -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 %} diff --git a/source/_posts/2010-08-17-create-better-photo-gallery-drupal-part-2.md b/source/_posts/2010-08-17-create-better-photo-gallery-drupal-part-2.md index e8c6a9ae..8c8784d0 100644 --- a/source/_posts/2010-08-17-create-better-photo-gallery-drupal-part-2.md +++ b/source/_posts/2010-08-17-create-better-photo-gallery-drupal-part-2.md @@ -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 , I can enter the required date in its readable format, and it will give me the equivilent UNIX timestamp. To keep things relatively simple, I'll set all photos within this gallery to the same time. +When I look back at the old photo gallery, I can see that the previous 'last added' date was June 27, 2008. So, how do I update my new photos to reflect that date? Using , I can enter the required date in its readable format, and it will give me the equivilent UNIX timestamp. To keep things relatively simple, I'll set all photos within this gallery to the same time. -The result that I'm given is '1217149200'. I can now use an UPDATE statement within another SQL query to update the created and modified dates. +The result that I'm given is '1217149200'. I can now use an UPDATE statement within another SQL query to update the created and modified dates. ```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. diff --git a/source/_posts/2010-08-20-review-image-caption-module.md b/source/_posts/2010-08-20-review-image-caption-module.md index e169f5a2..aa860b7f 100644 --- a/source/_posts/2010-08-20-review-image-caption-module.md +++ b/source/_posts/2010-08-20-review-image-caption-module.md @@ -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 %} diff --git a/source/_posts/2010-09-26-south-wales-drupal-user-group.md b/source/_posts/2010-09-26-south-wales-drupal-user-group.md index 4e295f78..871b7b2a 100644 --- a/source/_posts/2010-09-26-south-wales-drupal-user-group.md +++ b/source/_posts/2010-09-26-south-wales-drupal-user-group.md @@ -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: diff --git a/source/_posts/2010-10-10-create-and-apply-patches.md b/source/_posts/2010-10-10-create-and-apply-patches.md index 41292010..57336fee 100644 --- a/source/_posts/2010-10-10-create-and-apply-patches.md +++ b/source/_posts/2010-10-10-create-and-apply-patches.md @@ -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 . 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 %} diff --git a/source/_posts/2010-10-13-create-better-photo-gallery-drupal-part-3.md b/source/_posts/2010-10-13-create-better-photo-gallery-drupal-part-3.md index 211b2e49..3f1936e7 100644 --- a/source/_posts/2010-10-13-create-better-photo-gallery-drupal-part-3.md +++ b/source/_posts/2010-10-13-create-better-photo-gallery-drupal-part-3.md @@ -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 %} diff --git a/source/_posts/2010-10-22-create-better-photo-gallery-drupal-part-21.md b/source/_posts/2010-10-22-create-better-photo-gallery-drupal-part-21.md index 262c6c93..30c5942e 100644 --- a/source/_posts/2010-10-22-create-better-photo-gallery-drupal-part-21.md +++ b/source/_posts/2010-10-22-create-better-photo-gallery-drupal-part-21.md @@ -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 . 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 . -{% endblock %} diff --git a/source/_posts/2011-03-31-proctor-stevenson.md b/source/_posts/2011-03-31-proctor-stevenson.md index 5cb1077b..270c2de8 100644 --- a/source/_posts/2011-03-31-proctor-stevenson.md +++ b/source/_posts/2011-03-31-proctor-stevenson.md @@ -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. diff --git a/source/_posts/2011-05-20-proctors-hosting-next-drupal-meetup.md b/source/_posts/2011-05-20-proctors-hosting-next-drupal-meetup.md index 72c4720e..1280d1d7 100644 --- a/source/_posts/2011-05-20-proctors-hosting-next-drupal-meetup.md +++ b/source/_posts/2011-05-20-proctors-hosting-next-drupal-meetup.md @@ -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. diff --git a/source/_posts/2011-05-23-imagefield-import-archive.md b/source/_posts/2011-05-23-imagefield-import-archive.md index b2e85156..7b21777d 100644 --- a/source/_posts/2011-05-23-imagefield-import-archive.md +++ b/source/_posts/2011-05-23-imagefield-import-archive.md @@ -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! diff --git a/source/_posts/2011-08-28-create-multigroups-drupal-7-using-field-collections.md b/source/_posts/2011-08-28-create-multigroups-drupal-7-using-field-collections.md index 87b687d4..9926a08b 100644 --- a/source/_posts/2011-08-28-create-multigroups-drupal-7-using-field-collections.md +++ b/source/_posts/2011-08-28-create-multigroups-drupal-7-using-field-collections.md @@ -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 %} diff --git a/source/_posts/2011-10-19-install-and-configure-subversion-svn-server-ubuntu.md b/source/_posts/2011-10-19-install-and-configure-subversion-svn-server-ubuntu.md index 30726a73..2333ad1b 100644 --- a/source/_posts/2011-10-19-install-and-configure-subversion-svn-server-ubuntu.md +++ b/source/_posts/2011-10-19-install-and-configure-subversion-svn-server-ubuntu.md @@ -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 %} diff --git a/source/_posts/2012-01-04-site-upgraded-drupal-7.md b/source/_posts/2012-01-04-site-upgraded-drupal-7.md index 007397e9..2ab7683a 100644 --- a/source/_posts/2012-01-04-site-upgraded-drupal-7.md +++ b/source/_posts/2012-01-04-site-upgraded-drupal-7.md @@ -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. diff --git a/source/_posts/2012-02-01-use-authorized-keys-create-passwordless-ssh-connection.md b/source/_posts/2012-02-01-use-authorized-keys-create-passwordless-ssh-connection.md index 421bae0b..07cd5a28 100644 --- a/source/_posts/2012-02-01-use-authorized-keys-create-passwordless-ssh-connection.md +++ b/source/_posts/2012-02-01-use-authorized-keys-create-passwordless-ssh-connection.md @@ -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 %} diff --git a/source/_posts/2012-04-16-create-omega-subtheme-less-css-preprocessor-using-omega-tools-and-drush.md b/source/_posts/2012-04-16-create-omega-subtheme-less-css-preprocessor-using-omega-tools-and-drush.md index 9ba36dc9..cf7080d3 100644 --- a/source/_posts/2012-04-16-create-omega-subtheme-less-css-preprocessor-using-omega-tools-and-drush.md +++ b/source/_posts/2012-04-16-create-omega-subtheme-less-css-preprocessor-using-omega-tools-and-drush.md @@ -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 %} diff --git a/source/_posts/2012-04-17-installing-nagios-centos.md b/source/_posts/2012-04-17-installing-nagios-centos.md index ea923f3c..96915860 100644 --- a/source/_posts/2012-04-17-installing-nagios-centos.md +++ b/source/_posts/2012-04-17-installing-nagios-centos.md @@ -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. diff --git a/source/_posts/2012-04-19-adding-custom-theme-templates-drupal-7.md b/source/_posts/2012-04-19-adding-custom-theme-templates-drupal-7.md index 345ab61a..c5098dfd 100644 --- a/source/_posts/2012-04-19-adding-custom-theme-templates-drupal-7.md +++ b/source/_posts/2012-04-19-adding-custom-theme-templates-drupal-7.md @@ -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. diff --git a/source/_posts/2012-05-23-add-date-popup-calendar-custom-form.md b/source/_posts/2012-05-23-add-date-popup-calendar-custom-form.md index 2568d34a..1f4b723b 100644 --- a/source/_posts/2012-05-23-add-date-popup-calendar-custom-form.md +++ b/source/_posts/2012-05-23-add-date-popup-calendar-custom-form.md @@ -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 %} diff --git a/source/_posts/2012-05-23-checkout-specific-revision-svn-command-line.md b/source/_posts/2012-05-23-checkout-specific-revision-svn-command-line.md index 45c44987..d07a7edd 100644 --- a/source/_posts/2012-05-23-checkout-specific-revision-svn-command-line.md +++ b/source/_posts/2012-05-23-checkout-specific-revision-svn-command-line.md @@ -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 %} diff --git a/source/_posts/2012-05-23-forward-one-domain-another-using-modrewrite-and-htaccess.md b/source/_posts/2012-05-23-forward-one-domain-another-using-modrewrite-and-htaccess.md index c0f06b8f..57abf1da 100644 --- a/source/_posts/2012-05-23-forward-one-domain-another-using-modrewrite-and-htaccess.md +++ b/source/_posts/2012-05-23-forward-one-domain-another-using-modrewrite-and-htaccess.md @@ -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 %} diff --git a/source/_posts/2012-05-23-prevent-apache-displaying-text-files-within-web-browser.md b/source/_posts/2012-05-23-prevent-apache-displaying-text-files-within-web-browser.md index 2ee07ed7..d2256356 100644 --- a/source/_posts/2012-05-23-prevent-apache-displaying-text-files-within-web-browser.md +++ b/source/_posts/2012-05-23-prevent-apache-displaying-text-files-within-web-browser.md @@ -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 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 %} diff --git a/source/_posts/2012-05-23-writing-info-file-drupal-7-theme.md b/source/_posts/2012-05-23-writing-info-file-drupal-7-theme.md index 9754e4cf..1b592fa0 100644 --- a/source/_posts/2012-05-23-writing-info-file-drupal-7-theme.md +++ b/source/_posts/2012-05-23-writing-info-file-drupal-7-theme.md @@ -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 %} diff --git a/source/_posts/2012-05-24-dividing-drupals-process-and-preprocess-functions-separate-files.md b/source/_posts/2012-05-24-dividing-drupals-process-and-preprocess-functions-separate-files.md index a59ae25e..0add226f 100644 --- a/source/_posts/2012-05-24-dividing-drupals-process-and-preprocess-functions-separate-files.md +++ b/source/_posts/2012-05-24-dividing-drupals-process-and-preprocess-functions-separate-files.md @@ -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. diff --git a/source/_posts/2012-07-12-my-new-drupal-modules.md b/source/_posts/2012-07-12-my-new-drupal-modules.md index fd0300b7..55674880 100644 --- a/source/_posts/2012-07-12-my-new-drupal-modules.md +++ b/source/_posts/2012-07-12-my-new-drupal-modules.md @@ -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 %} diff --git a/source/_posts/2012-07-14-install-nomensa-media-player-drupal.md b/source/_posts/2012-07-14-install-nomensa-media-player-drupal.md index d4b2e260..1d8ba75c 100644 --- a/source/_posts/2012-07-14-install-nomensa-media-player-drupal.md +++ b/source/_posts/2012-07-14-install-nomensa-media-player-drupal.md @@ -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 . 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>
-{% endblock %} diff --git a/source/_posts/2012-07-27-writing-article-linux-journal.md b/source/_posts/2012-07-27-writing-article-linux-journal.md index 6fbfbe24..04524e56 100644 --- a/source/_posts/2012-07-27-writing-article-linux-journal.md +++ b/source/_posts/2012-07-27-writing-article-linux-journal.md @@ -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 %} diff --git a/source/_posts/2012-08-18-display-custom-menu-drupal-7-theme-template-file.md b/source/_posts/2012-08-18-display-custom-menu-drupal-7-theme-template-file.md index 236d0277..d8f5567c 100644 --- a/source/_posts/2012-08-18-display-custom-menu-drupal-7-theme-template-file.md +++ b/source/_posts/2012-08-18-display-custom-menu-drupal-7-theme-template-file.md @@ -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 %} diff --git a/source/_posts/2012-09-06-reflections-speaking-unifieddiff.md b/source/_posts/2012-09-06-reflections-speaking-unifieddiff.md index 43b1cd49..49798412 100644 --- a/source/_posts/2012-09-06-reflections-speaking-unifieddiff.md +++ b/source/_posts/2012-09-06-reflections-speaking-unifieddiff.md @@ -1,18 +1,13 @@ --- title: Reflections on speaking at UnifiedDiff -description: Yesterday evening I went to and spoke at the UnifiedDiff meetup in Cardiff, having offered previously to do a presentation providing an introduction to Drupal. +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 %} diff --git a/source/_posts/2012-10-25-my-sublime-text-2-settings.md b/source/_posts/2012-10-25-my-sublime-text-2-settings.md index 614c6b0c..6aba44d7 100644 --- a/source/_posts/2012-10-25-my-sublime-text-2-settings.md +++ b/source/_posts/2012-10-25-my-sublime-text-2-settings.md @@ -1,9 +1,8 @@ --- title: My Sublime Text 2 settings -description: Sublime Text 2 has been my text editor of choice for the past few months, and I use it at home, in work, and on any virtual machines that I run. So rather than having to manually re-enter my settings each time, I thought that I'd document them here for future reference. +excerpt: Sublime Text 2 has been my text editor of choice for the past few months, and I use it at home, in work, and on any virtual machines that I run. So rather than having to manually re-enter my settings each time, I thought that I'd document them here for future reference. tags: - sublime-text -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. diff --git a/source/_posts/2012-11-15-accessible-bristol-site.md b/source/_posts/2012-11-15-accessible-bristol-site.md index 65e84c96..0435a151 100644 --- a/source/_posts/2012-11-15-accessible-bristol-site.md +++ b/source/_posts/2012-11-15-accessible-bristol-site.md @@ -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 or go to to register. -{% endblock %} diff --git a/source/_posts/2012-11-17-open-sublime-text-2-mac-os-x-command-line.md b/source/_posts/2012-11-17-open-sublime-text-2-mac-os-x-command-line.md index d7aa2e3f..178dd472 100644 --- a/source/_posts/2012-11-17-open-sublime-text-2-mac-os-x-command-line.md +++ b/source/_posts/2012-11-17-open-sublime-text-2-mac-os-x-command-line.md @@ -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 ` 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 %} diff --git a/source/_posts/2012-12-06-use-sass-and-compass-drupal-7-using-sassy.md b/source/_posts/2012-12-06-use-sass-and-compass-drupal-7-using-sassy.md index ad978b85..012523ed 100644 --- a/source/_posts/2012-12-06-use-sass-and-compass-drupal-7-using-sassy.md +++ b/source/_posts/2012-12-06-use-sass-and-compass-drupal-7-using-sassy.md @@ -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 %} diff --git a/source/_posts/2013-01-09-checking-if-user-logged-drupal-right-way.md b/source/_posts/2013-01-09-checking-if-user-logged-drupal-right-way.md index 9500d090..2c03506b 100644 --- a/source/_posts/2013-01-09-checking-if-user-logged-drupal-right-way.md +++ b/source/_posts/2013-01-09-checking-if-user-logged-drupal-right-way.md @@ -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). diff --git a/source/_posts/2013-02-16-creating-and-using-custom-tokens-drupal-7.md b/source/_posts/2013-02-16-creating-and-using-custom-tokens-drupal-7.md index c31163b3..7e89398d 100644 --- a/source/_posts/2013-02-16-creating-and-using-custom-tokens-drupal-7.md +++ b/source/_posts/2013-02-16-creating-and-using-custom-tokens-drupal-7.md @@ -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 %} diff --git a/source/_posts/2013-03-02-quickest-way-install-sublime-text-2-ubuntu.md b/source/_posts/2013-03-02-quickest-way-install-sublime-text-2-ubuntu.md index 4532b0e5..f5fca307 100644 --- a/source/_posts/2013-03-02-quickest-way-install-sublime-text-2-ubuntu.md +++ b/source/_posts/2013-03-02-quickest-way-install-sublime-text-2-ubuntu.md @@ -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 %} diff --git a/source/_posts/2013-04-20-leaving-nomensa-joining-precedent.md b/source/_posts/2013-04-20-leaving-nomensa-joining-precedent.md index 811be408..5a539940 100644 --- a/source/_posts/2013-04-20-leaving-nomensa-joining-precedent.md +++ b/source/_posts/2013-04-20-leaving-nomensa-joining-precedent.md @@ -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"). diff --git a/source/_posts/2013-04-27-display-git-branch-or-tag-names-your-bash-prompt.md b/source/_posts/2013-04-27-display-git-branch-or-tag-names-your-bash-prompt.md index 22d92963..e42fe6f9 100644 --- a/source/_posts/2013-04-27-display-git-branch-or-tag-names-your-bash-prompt.md +++ b/source/_posts/2013-04-27-display-git-branch-or-tag-names-your-bash-prompt.md @@ -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. diff --git a/source/_posts/2013-06-13-some-useful-links-using-simpletest-drupal.md b/source/_posts/2013-06-13-some-useful-links-using-simpletest-drupal.md index 3faa4412..68171bce 100644 --- a/source/_posts/2013-06-13-some-useful-links-using-simpletest-drupal.md +++ b/source/_posts/2013-06-13-some-useful-links-using-simpletest-drupal.md @@ -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 %} diff --git a/source/_posts/2013-07-17-creating-local-and-staging-sites-drupals-domain-module-enabled.md b/source/_posts/2013-07-17-creating-local-and-staging-sites-drupals-domain-module-enabled.md index 5c77ecc1..ecbb2d32 100644 --- a/source/_posts/2013-07-17-creating-local-and-staging-sites-drupals-domain-module-enabled.md +++ b/source/_posts/2013-07-17-creating-local-and-staging-sites-drupals-domain-module-enabled.md @@ -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 %} diff --git a/source/_posts/2013-07-26-going-drupalcon.md b/source/_posts/2013-07-26-going-drupalcon.md index b9df6a50..61949ab3 100644 --- a/source/_posts/2013-07-26-going-drupalcon.md +++ b/source/_posts/2013-07-26-going-drupalcon.md @@ -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 %} diff --git a/source/_posts/2013-09-06-create-zen-sub-theme-using-drush.md b/source/_posts/2013-09-06-create-zen-sub-theme-using-drush.md index a0b58108..ca6ae453 100644 --- a/source/_posts/2013-09-06-create-zen-sub-theme-using-drush.md +++ b/source/_posts/2013-09-06-create-zen-sub-theme-using-drush.md @@ -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 %} diff --git a/source/_posts/2013-11-19-dont-bootstrap-drupal-use-drush.md b/source/_posts/2013-11-19-dont-bootstrap-drupal-use-drush.md index 22890a55..31a293dc 100644 --- a/source/_posts/2013-11-19-dont-bootstrap-drupal-use-drush.md +++ b/source/_posts/2013-11-19-dont-bootstrap-drupal-use-drush.md @@ -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 Vagrant. +excerpt: Here are the basic commands that you need to adminster a virtual machine using Vagrant. 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. diff --git a/source/_posts/2013-12-24-quickly-apply-patches-using-git-and-curl-or-wget.md b/source/_posts/2013-12-24-quickly-apply-patches-using-git-and-curl-or-wget.md index b91ef500..f78f2ec1 100644 --- a/source/_posts/2013-12-24-quickly-apply-patches-using-git-and-curl-or-wget.md +++ b/source/_posts/2013-12-24-quickly-apply-patches-using-git-and-curl-or-wget.md @@ -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. diff --git a/source/_posts/2013-12-31-download-different-versions-drupal-drush.md b/source/_posts/2013-12-31-download-different-versions-drupal-drush.md index b05ca527..8d78aff9 100644 --- a/source/_posts/2013-12-31-download-different-versions-drupal-drush.md +++ b/source/_posts/2013-12-31-download-different-versions-drupal-drush.md @@ -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. diff --git a/source/_posts/2014-01-15-some-useful-git-aliases.md b/source/_posts/2014-01-15-some-useful-git-aliases.md index 8bf5069f..9ee998a2 100644 --- a/source/_posts/2014-01-15-some-useful-git-aliases.md +++ b/source/_posts/2014-01-15-some-useful-git-aliases.md @@ -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 %} diff --git a/source/_posts/2014-02-09-drupalcamp-london-2014.md b/source/_posts/2014-02-09-drupalcamp-london-2014.md index 69cefc57..173d3057 100644 --- a/source/_posts/2014-02-09-drupalcamp-london-2014.md +++ b/source/_posts/2014-02-09-drupalcamp-london-2014.md @@ -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 %} diff --git a/source/_posts/2014-03-03-what-git-flow.md b/source/_posts/2014-03-03-what-git-flow.md index 25b34c46..7874a73f 100644 --- a/source/_posts/2014-03-03-what-git-flow.md +++ b/source/_posts/2014-03-03-what-git-flow.md @@ -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: '

Great talk on git flow @opdavies #dclondon

— Curve Agency (@CurveAgency) March 2, 2014' } %} -{% endblock %} diff --git a/source/_posts/2014-05-03-drupal-association.md b/source/_posts/2014-05-03-drupal-association.md index 6bad64c6..8bcc662d 100644 --- a/source/_posts/2014-05-03-drupal-association.md +++ b/source/_posts/2014-05-03-drupal-association.md @@ -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 %} diff --git a/source/_posts/2014-05-06-thanks.md b/source/_posts/2014-05-06-thanks.md index 49aed0db..a976b604 100644 --- a/source/_posts/2014-05-06-thanks.md +++ b/source/_posts/2014-05-06-thanks.md @@ -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. diff --git a/source/_posts/2014-05-21-git-format-patch.md b/source/_posts/2014-05-21-git-format-patch.md index b02eaebb..9e401da9 100644 --- a/source/_posts/2014-05-21-git-format-patch.md +++ b/source/_posts/2014-05-21-git-format-patch.md @@ -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 %} diff --git a/source/_posts/2014-10-06-fix-vagrant-loading-wrong-virtual-machine.md b/source/_posts/2014-10-06-fix-vagrant-loading-wrong-virtual-machine.md index 1fe6e36b..6880dd7a 100644 --- a/source/_posts/2014-10-06-fix-vagrant-loading-wrong-virtual-machine.md +++ b/source/_posts/2014-10-06-fix-vagrant-loading-wrong-virtual-machine.md @@ -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 %} diff --git a/source/_posts/2014-10-21-updating-features-and-adding-components-using-drush.md b/source/_posts/2014-10-21-updating-features-and-adding-components-using-drush.md index 2e5a7664..faecaa3f 100644 --- a/source/_posts/2014-10-21-updating-features-and-adding-components-using-drush.md +++ b/source/_posts/2014-10-21-updating-features-and-adding-components-using-drush.md @@ -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 %} diff --git a/source/_posts/2014-11-18-include-css-fonts-using-sass-each-loop.md b/source/_posts/2014-11-18-include-css-fonts-using-sass-each-loop.md index 30fe253f..3154fd73 100644 --- a/source/_posts/2014-11-18-include-css-fonts-using-sass-each-loop.md +++ b/source/_posts/2014-11-18-include-css-fonts-using-sass-each-loop.md @@ -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. diff --git a/source/_posts/2014-11-20-using-remote-files-when-developing-locally-stage-file-proxy-module.md b/source/_posts/2014-11-20-using-remote-files-when-developing-locally-stage-file-proxy-module.md index daf95b09..cbc1cced 100644 --- a/source/_posts/2014-11-20-using-remote-files-when-developing-locally-stage-file-proxy-module.md +++ b/source/_posts/2014-11-20-using-remote-files-when-developing-locally-stage-file-proxy-module.md @@ -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 %} diff --git a/source/_posts/2014-11-27-pantheon-settings-files.md b/source/_posts/2014-11-27-pantheon-settings-files.md index 7ac934e1..3202c901 100644 --- a/source/_posts/2014-11-27-pantheon-settings-files.md +++ b/source/_posts/2014-11-27-pantheon-settings-files.md @@ -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 %} diff --git a/source/_posts/2014-12-20-include-local-drupal-settings-file-environment-configuration-and-overrides.md b/source/_posts/2014-12-20-include-local-drupal-settings-file-environment-configuration-and-overrides.md index e71f24dc..e22c0bcd 100644 --- a/source/_posts/2014-12-20-include-local-drupal-settings-file-environment-configuration-and-overrides.md +++ b/source/_posts/2014-12-20-include-local-drupal-settings-file-environment-configuration-and-overrides.md @@ -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 %} diff --git a/source/_posts/2014-12-22-configuring-the-reroute-email-module.md b/source/_posts/2014-12-22-configuring-the-reroute-email-module.md index 1e70833f..bbfc658b 100644 --- a/source/_posts/2014-12-22-configuring-the-reroute-email-module.md +++ b/source/_posts/2014-12-22-configuring-the-reroute-email-module.md @@ -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 %} diff --git a/source/_posts/2015-03-20-2014.md b/source/_posts/2015-03-20-2014.md index 0daa6205..b6384a90 100644 --- a/source/_posts/2015-03-20-2014.md +++ b/source/_posts/2015-03-20-2014.md @@ -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 %} diff --git a/source/_posts/2015-04-03-minimum-core-version.md b/source/_posts/2015-04-03-minimum-core-version.md index 9a48c3bd..0d5a58ec 100644 --- a/source/_posts/2015-04-03-minimum-core-version.md +++ b/source/_posts/2015-04-03-minimum-core-version.md @@ -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). diff --git a/source/_posts/2015-06-18-updating-forked-github-repos.md b/source/_posts/2015-06-18-updating-forked-github-repos.md index bb5f9760..819b9820 100644 --- a/source/_posts/2015-06-18-updating-forked-github-repos.md +++ b/source/_posts/2015-06-18-updating-forked-github-repos.md @@ -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 %} diff --git a/source/_posts/2015-07-19-sculpin-twig-resources.md b/source/_posts/2015-07-19-sculpin-twig-resources.md index 48464b6b..99ed9d25 100644 --- a/source/_posts/2015-07-19-sculpin-twig-resources.md +++ b/source/_posts/2015-07-19-sculpin-twig-resources.md @@ -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 * @@ -47,4 +42,3 @@ Here’s a list of resources that I compiled whilst preparing for my [Sculpin an * * - variables, filters, functions, template inheritance, expressions etc. * Go to http://twig.sensiolabs.org/{foo} to search for a tag, filter, test or function. -{% endblock %} diff --git a/source/_posts/2015-07-21-automating-sculpin-jenkins.md b/source/_posts/2015-07-21-automating-sculpin-jenkins.md index 65040926..c93b07ce 100644 --- a/source/_posts/2015-07-21-automating-sculpin-jenkins.md +++ b/source/_posts/2015-07-21-automating-sculpin-jenkins.md @@ -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 %} diff --git a/source/_posts/2015-12-22-entityform.md b/source/_posts/2015-12-22-entityform.md index 9f8eea18..901ac21d 100644 --- a/source/_posts/2015-12-22-entityform.md +++ b/source/_posts/2015-12-22-entityform.md @@ -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 %} diff --git a/source/_posts/2016-02-15-announcing-the-drupal-vm-generator.md b/source/_posts/2016-02-15-announcing-the-drupal-vm-generator.md index 21b689a2..554ffaa9 100644 --- a/source/_posts/2016-02-15-announcing-the-drupal-vm-generator.md +++ b/source/_posts/2016-02-15-announcing-the-drupal-vm-generator.md @@ -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 diff --git a/source/_posts/2016-05-03-simplifying-drupal-migrations-with-xautoload.md b/source/_posts/2016-05-03-simplifying-drupal-migrations-with-xautoload.md index 5801401c..6c3b1230 100644 --- a/source/_posts/2016-05-03-simplifying-drupal-migrations-with-xautoload.md +++ b/source/_posts/2016-05-03-simplifying-drupal-migrations-with-xautoload.md @@ -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/ diff --git a/source/_posts/2016-07-15-building-gmail-filters-in-php.md b/source/_posts/2016-07-15-building-gmail-filters-in-php.md index 06be6d97..5d79d634 100644 --- a/source/_posts/2016-07-15-building-gmail-filters-in-php.md +++ b/source/_posts/2016-07-15-building-gmail-filters-in-php.md @@ -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 diff --git a/source/_posts/2016-12-30-drupal-vm-generator-updates.md b/source/_posts/2016-12-30-drupal-vm-generator-updates.md index 35c0d310..45d08df8 100644 --- a/source/_posts/2016-12-30-drupal-vm-generator-updates.md +++ b/source/_posts/2016-12-30-drupal-vm-generator-updates.md @@ -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 diff --git a/source/_posts/2017-01-07-easier-sculpin-commands-with-composer-and-npm-scripts.md b/source/_posts/2017-01-07-easier-sculpin-commands-with-composer-and-npm-scripts.md index cd7d79cc..7d8bebbb 100644 --- a/source/_posts/2017-01-07-easier-sculpin-commands-with-composer-and-npm-scripts.md +++ b/source/_posts/2017-01-07-easier-sculpin-commands-with-composer-and-npm-scripts.md @@ -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 diff --git a/source/_posts/2017-01-31-nginx-redirects-with-query-string-arguments.md b/source/_posts/2017-01-31-nginx-redirects-with-query-string-arguments.md index bda09cab..4464f8ee 100644 --- a/source/_posts/2017-01-31-nginx-redirects-with-query-string-arguments.md +++ b/source/_posts/2017-01-31-nginx-redirects-with-query-string-arguments.md @@ -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 %} diff --git a/source/_posts/2017-05-05-fixing-drupal-simpletest-docker.md b/source/_posts/2017-05-05-fixing-drupal-simpletest-docker.md index 1214b55d..3286d05f 100644 --- a/source/_posts/2017-05-05-fixing-drupal-simpletest-docker.md +++ b/source/_posts/2017-05-05-fixing-drupal-simpletest-docker.md @@ -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 diff --git a/source/_posts/2017-05-05-updating-override-node-options-tests.md b/source/_posts/2017-05-05-updating-override-node-options-tests.md index 8cc05e0a..8202f7c9 100644 --- a/source/_posts/2017-05-05-updating-override-node-options-tests.md +++ b/source/_posts/2017-05-05-updating-override-node-options-tests.md @@ -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 [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 diff --git a/source/_posts/2017-05-15-drupalcamp-bristol-early-bird-tickets-sessions-sponsors.md b/source/_posts/2017-05-15-drupalcamp-bristol-early-bird-tickets-sessions-sponsors.md index e1c6164e..a87869bc 100644 --- a/source/_posts/2017-05-15-drupalcamp-bristol-early-bird-tickets-sessions-sponsors.md +++ b/source/_posts/2017-05-15-drupalcamp-bristol-early-bird-tickets-sessions-sponsors.md @@ -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 %}

![DrupalCamp Bristol 2017 logo](/images/blog/drupalcamp-bristol-17-logo.jpg)

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 diff --git a/source/_posts/2017-05-20-turning-drupal-module-into-feature.md b/source/_posts/2017-05-20-turning-drupal-module-into-feature.md index 360a2c1a..dc86617e 100644 --- a/source/_posts/2017-05-20-turning-drupal-module-into-feature.md +++ b/source/_posts/2017-05-20-turning-drupal-module-into-feature.md @@ -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 diff --git a/source/_posts/2017-06-09-introducing-the-drupal-meetups-twitterbot.md b/source/_posts/2017-06-09-introducing-the-drupal-meetups-twitterbot.md index 364b0ad9..75f72483 100644 --- a/source/_posts/2017-06-09-introducing-the-drupal-meetups-twitterbot.md +++ b/source/_posts/2017-06-09-introducing-the-drupal-meetups-twitterbot.md @@ -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 %}

![](/images/blog/drupal-meetups-twitterbot.png)

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 diff --git a/source/_posts/2017-07-13-publishing-sculpin-sites-with-github-pages.md b/source/_posts/2017-07-13-publishing-sculpin-sites-with-github-pages.md index ee656cbc..bf9caab9 100644 --- a/source/_posts/2017-07-13-publishing-sculpin-sites-with-github-pages.md +++ b/source/_posts/2017-07-13-publishing-sculpin-sites-with-github-pages.md @@ -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 %}

![](/images/blog/jackson-octocat.png)

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 diff --git a/source/_posts/2017-11-07-writing-drupal-module-test-driven-development-tdd.md b/source/_posts/2017-11-07-writing-drupal-module-test-driven-development-tdd.md index 27d47549..5d8cc6be 100644 --- a/source/_posts/2017-11-07-writing-drupal-module-test-driven-development-tdd.md +++ b/source/_posts/2017-11-07-writing-drupal-module-test-driven-development-tdd.md @@ -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 %}

![](/images/blog/drupalcamp-dublin.jpg)

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 diff --git a/source/_posts/2018-01-30-drupalcamp-bristol-2018.md b/source/_posts/2018-01-30-drupalcamp-bristol-2018.md index 8df129c9..eb4718c2 100644 --- a/source/_posts/2018-01-30-drupalcamp-bristol-2018.md +++ b/source/_posts/2018-01-30-drupalcamp-bristol-2018.md @@ -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 %} diff --git a/source/_posts/2018-02-05-using-tailwind-css-in-your-drupal-theme.md b/source/_posts/2018-02-05-using-tailwind-css-in-your-drupal-theme.md index de7d55e3..006165fb 100644 --- a/source/_posts/2018-02-05-using-tailwind-css-in-your-drupal-theme.md +++ b/source/_posts/2018-02-05-using-tailwind-css-in-your-drupal-theme.md @@ -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 diff --git a/source/_posts/2018-02-27-looking-forward-to-drupalcamp-london.md b/source/_posts/2018-02-27-looking-forward-to-drupalcamp-london.md index 1971a2ff..a416259e 100644 --- a/source/_posts/2018-02-27-looking-forward-to-drupalcamp-london.md +++ b/source/_posts/2018-02-27-looking-forward-to-drupalcamp-london.md @@ -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 diff --git a/source/_posts/2018-02-27-queuing-private-messages-in-drupal-8.md b/source/_posts/2018-02-27-queuing-private-messages-in-drupal-8.md index 1c5d07c0..1ee3f25b 100644 --- a/source/_posts/2018-02-27-queuing-private-messages-in-drupal-8.md +++ b/source/_posts/2018-02-27-queuing-private-messages-in-drupal-8.md @@ -1,24 +1,17 @@ --- title: Queuing Private Messages in Drupal 8 +excerpt: Introducing the Private Message Queue module for Drupal 8. tags: - drupal - drupal-8 - drupal-modules - drupal-planet - open-source -meta: - og: - title: Queuing Private Messages in Drupal 8 - description: How to queue private messages in Drupal 8 with the Private Message Queue module. - type: website --- -{% block excerpt %} My current project at [Microserve][0] is a Drupal 8 website that uses the [Private Message][1] module for users to send messages to each other. In some cases though, the threads could contain hundreds of recipients so I decided that it would be good to queue the message requests so that they can be processed as part of a background process for better performance. The Private Message module does not include this, so I've written and released a separate [Private Message Queue][2] module. -{% endblock %} -{% block content %} ## Queuing a Message The module provices a `PrivateMessageQueuer` service (`private_message_queue.queuer`) which queues the items via the `queue()` method. @@ -60,7 +53,6 @@ You can also process the queue manually with Drush using the `drush queue-run @@ -20,7 +18,6 @@ It’s built with Symfony so it’s naturally using Twig for templating. I’ve We have an integration with Meetup.com which we’re using to pull all of our previous event data and store them as JSON files for Symfony to parse and render, which it then uses to generate static HTML to upload onto the server. We’re in the process of populating all of the past data, but look out for a v1 launch soon. In the meantime, feel free to take a peek at our [GitHub repository][3]. -{% endblock %} [0]: https://phpsw.uk [1]: https://tailwindcss.com diff --git a/source/_posts/2018-03-02-mediacurrent-contrib-half-hour-is-back.md b/source/_posts/2018-03-02-mediacurrent-contrib-half-hour-is-back.md index b82a5f82..c757a15e 100644 --- a/source/_posts/2018-03-02-mediacurrent-contrib-half-hour-is-back.md +++ b/source/_posts/2018-03-02-mediacurrent-contrib-half-hour-is-back.md @@ -1,16 +1,14 @@ --- title: Yay, the Mediacurrent Contrib Half Hour is Back! +excerpt: Mediacurrent’s "contrib half hour sessions" are back. tags: - contribution - drupal - open-source has_tweets: true --- -{% block excerpt %} Back in November, [Mediacurrent introduced][1] the contrib half hour - a weekly online meeting to provide guidance and assistance on contributing to Drupal and Drupal projects. A range of topics were covered in the first few sessions, including finding and testing bug fixes, Composer, Drush, and how to re-roll patches. -{% endblock %} -{% block content %} From Damien's [introductory blog post][2]: > Not sure what this whole "patch" thing is? Have a core change that you can't quite finish? Running into a problem with a contrib module, or a theme, or a 3rd party library, and not sure how to fix it? New to maintaining a module and unsure of what to do next? Wondering how to get your module through the security opt-in process? Is your project's issue queue getting you down? Join us every Thursday at noon EST for the Mediacurrent Contrib Half Hour where we'll be available to help solve contrib challenges. @@ -19,9 +17,9 @@ From Damien's [introductory blog post][2]: There is also an [updates blog post][3] that continues to show the latest information, and the video recordings are [uploaded to YouTube][0] after the session. Here is the first one from November: -
+ I enjoyed watching the first few videos, as I’m always interested in contribution to Drupal and open-source and how to encourage it, but then no new videos were uploaded for a while and I hoped that it hadn’t faded away. @@ -34,7 +32,6 @@ I’m glad to see today that it’s back and that all of the previous videos hav I do enjoy watching these, and I like both the presentation and Q&A format that they alternate between. I’ll look forward to catching up over the next few days, and to hopefully seeing them continue to be uploaded after future meetings. Thanks Damien and Mediacurrent! -{% endblock %} [0]: https://www.youtube.com/playlist?list=PLu-MxhbnjI9rHroPvZO5LEUhr58Yl0j_F [1]: https://www.mediacurrent.com/blog/introducing-mediacurrent-contrib-half-hour diff --git a/source/_posts/2018-03-04-tweets-drupalcamp-london.md b/source/_posts/2018-03-04-tweets-drupalcamp-london.md index d4742409..cc75585f 100644 --- a/source/_posts/2018-03-04-tweets-drupalcamp-london.md +++ b/source/_posts/2018-03-04-tweets-drupalcamp-london.md @@ -1,20 +1,18 @@ --- title: Tweets from DrupalCamp London +excerpt: I wasn’t able to make it to DrupalCamp London, but here are some of the tweets that I saw. tags: - drupal - drupalcamp - drupalcamp-london has_tweets: true --- -{% block excerpt %} In the end, I wasn’t able to make it to DrupalCamp London because of the heavy snow that’s hit the UK over the last few days. I did though keep a close eye on Twitter and still had good conversations with some of the attendees, so it did feel that in some ways I was still part of the conference. Thanks to [@ChandeepKhosa](https://twitter.com/ChandeepKhosa), [@OrangePunchUK](https://twitter.com/OrangePunchUK), [@hussainweb](https://twitter.com/hussainweb), [@littlepixiez](https://twitter.com/littlepixiez), [@cferthorney](https://twitter.com/cferthorney) and others for taking the time to tweet whilst enjoying the event. Here are some of my favourites that I saw, and no snow next year, please! -{% endblock %} -{% block content %}
@@ -59,4 +57,3 @@ Here are some of my favourites that I saw, and no snow next year, please!
-{% endblock %} diff --git a/source/_posts/2018-03-09-drupal-8-5-released.md b/source/_posts/2018-03-09-drupal-8-5-released.md index 2abfea36..bbf6a57c 100644 --- a/source/_posts/2018-03-09-drupal-8-5-released.md +++ b/source/_posts/2018-03-09-drupal-8-5-released.md @@ -1,17 +1,14 @@ --- title: 'Drupal 8.5.0 Released' +excerpt: This week, the latest version of Drupal 8 was released. tags: - drupal - drupal-core --- -{% block excerpt %} This week the latest minor version of Drupal 8, 8.5.0, was released. > This new version makes Media module available for all, improves migrations significantly, stabilizes the Content Moderation and Settings Tray modules, serves dynamic pages faster with BigPipe enabled by default, and introduces a new experimental entity layout user interface. The release includes several very important fixes for workflows of content translations and supports running on PHP 7.2. -{% endblock %} - -{% block content %} I’ve been very impressed by the new release cycle Drupal 8 and the usage of semantic versioning. Though it adds a greater maintenance overhead for module, theme, installation profile and distribution developers to ensure that our projects are still working properly, having the ability to add new modules into Drupal core as well as new installation profiles like the [Unami demonstration profile][2] is pretty cool! For example, in addition to Unami, 8.5 alone adds media in core, two experimental modules have been marked as stable, an experimental new layout builder has been added and lots of PHP 7.2 improvements have been committed to make 8.5 fully PHP 7.2 compatible. @@ -19,7 +16,6 @@ For example, in addition to Unami, 8.5 alone adds media in core, two experimenta I’m already looking forward to see what’s coming in 8.6 later this year! For more information on the 8.5 release, see the [blog post on Drupal.org][1]. -{% endblock %} [0]: https://dri.es/drupal-8-5-0-released [1]: https://www.drupal.org/blog/drupal-8-5-0 diff --git a/source/_posts/2018-03-10-splitting-new-drupal-project-from-repo.md b/source/_posts/2018-03-10-splitting-new-drupal-project-from-repo.md index 3a1146a2..ce2ddfc5 100644 --- a/source/_posts/2018-03-10-splitting-new-drupal-project-from-repo.md +++ b/source/_posts/2018-03-10-splitting-new-drupal-project-from-repo.md @@ -1,5 +1,6 @@ --- title: How to split a new Drupal contrib project from within another repository +excerpt: How to use Git to split a directory from within an existing repository into it’s own. tags: - drupal - drupal-7 @@ -8,13 +9,10 @@ tags: - git - open-source --- -{% block excerpt %} Yay! You’ve written a new Drupal module, theme or installation profile as part of your site, and now you’ve decided to open source it and upload it to Drupal.org as a new contrib project. But how do you split it from the main site repository into it’s own? Well, there are a couple of options. -{% endblock %} -{% block content %} ## Does it need to be part of the site repository? An interesting thing to consider is, does it _need_ to be a part of the site repository in the first place? @@ -114,7 +112,6 @@ Here is a screenshot of example module that I’ve split and pushed to GitLab. N ![Screenshot of a split project repo on GitLab](/images/blog/subtree-split-drupal-module.png) Also, as this is standard Git functionality, you can follow the same process to extract PHP libraries, Symfony bundles, WordPress plugins or anything else. -{% endblock %} [0]: https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt [1]: https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt#L101-L108 diff --git a/source/_posts/2018-03-12-php-apps-subdirectory-nginx.md b/source/_posts/2018-03-12-php-apps-subdirectory-nginx.md index 981baec4..87cf4556 100644 --- a/source/_posts/2018-03-12-php-apps-subdirectory-nginx.md +++ b/source/_posts/2018-03-12-php-apps-subdirectory-nginx.md @@ -1,14 +1,12 @@ --- title: How to put your PHP application in a subdirectory of another site with Nginx +excerpt: How to configure Nginx to serve a PHP application from within a subdirectory of another. tags: - nginx - php --- -{% block excerpt %} In January, [Chris Fidao][0] posted a video to [Servers for Hackers][1] showing how to put different PHP applications in different subdirectories and have them serving on different paths with Nginx. I’ve had to do this a few times previously, and it’s great to have this video as a reference. -{% endblock %} -{% block content %} > In this video, we work through how to put your PHP application in a subdirectory of another site. > > For example, we may have an application running at example.org but need a second application running at example.org/blog. @@ -16,7 +14,6 @@ In January, [Chris Fidao][0] posted a video to [Servers for Hackers][1] showing > This feels like it should be simple, but it turns out to be more complex and fraught with confusing Nginx configurations! To make matter worse (or, perhaps, to illustrate this point), a quick Google search reveals a TON of confusing, non-working examples. -{% endblock %} [0]: https://twitter.com/fideloper [1]: https://serversforhackers.com diff --git a/source/_posts/2018-04-23-back-to-the-future-git-diff-apply.md b/source/_posts/2018-04-23-back-to-the-future-git-diff-apply.md index 98138362..5f2e4bba 100644 --- a/source/_posts/2018-04-23-back-to-the-future-git-diff-apply.md +++ b/source/_posts/2018-04-23-back-to-the-future-git-diff-apply.md @@ -1,12 +1,13 @@ --- title: Back to the future with Git’s diff and apply commands -summary: | - This is one of those “there’s probably already a better way to do this” situations, but it worked. - - I was having some issues this past weekend where, despite everything working fine locally, a server was showing a “500 Internal Server” after I pushed some changes to a site. In order to bring the site back online, I needed to revert the site files back to the previous version, but as part of a new commit. +excerpt: How to revert files using Git, but as a new commit to prevent force pushing. tags: - git --- +This is one of those “there’s probably already a better way to do this” situations, but it worked. + +I was having some issues this past weekend where, despite everything working fine locally, a server was showing a “500 Internal Server” after I pushed some changes to a site. In order to bring the site back online, I needed to revert the site files back to the previous version, but as part of a new commit. + The `git reset` commands removed the interim commits which meant that I couldn’t push to the remote (force pushing, quite rightly, isn’t allowed for the production branch), and using `git revert` was resulting in merge conflicts in `composer.lock` that I’d rather have avoided if possible. This is what `git log --oneline -n 4` was outputting: diff --git a/source/_posts/2018-05-06-creating-custom-docksal-commands.md b/source/_posts/2018-05-06-creating-custom-docksal-commands.md index cdbc6475..598b2c14 100644 --- a/source/_posts/2018-05-06-creating-custom-docksal-commands.md +++ b/source/_posts/2018-05-06-creating-custom-docksal-commands.md @@ -1,6 +1,6 @@ --- title: Creating a Custom PHPUnit Command for Docksal -summary: This week I’ve started writing some custom commands for my Drupal projects that use Docksal, including one to easily run PHPUnit tests in Drupal 8. This is the process of how I created this command. +excerpt: How to write custom commands for Docksal, including one to easily run PHPUnit tests in Drupal 8. tags: - docksal - drupal @@ -9,6 +9,8 @@ tags: - phpunit - testing --- +This week I’ve started writing some custom commands for my Drupal projects that use Docksal, including one to easily run PHPUnit tests in Drupal 8. This is the process of how I created this command. + ## What is Docksal? Docksal is a local Docker-based development environment for Drupal projects and other frameworks and CMSes. It is our standard tool for local environments for projects at [Microserve][0]. diff --git a/source/_posts/2018-06-04-using-environment-variables-settings-docksal.md b/source/_posts/2018-06-04-using-environment-variables-settings-docksal.md index 516febc5..b177b9bf 100644 --- a/source/_posts/2018-06-04-using-environment-variables-settings-docksal.md +++ b/source/_posts/2018-06-04-using-environment-variables-settings-docksal.md @@ -1,11 +1,11 @@ --- title: How to Use Environment Variables for your Drupal Settings with Docksal +excerpt: How to leverage environment variables with Drupal and Docksal. tags: - drupal - drupal-planet - docksal --- -{% block excerpt %} Within the [Docksal documentation for Drupal settings][0], the example database settings include hard-coded credentials to connect to the Drupal database. For example, within a `settings.php` file, you could add this: ```language-php @@ -25,9 +25,7 @@ Also if one of these values were to change, then Drupal wouldn't be aware of tha It also means that the file can’t simply be re-used on another project as it contains project-specific credentials. We can improve this by using the environment variables within the settings file. -{% endblock %} -{% block content %} The relevant environment variables are `MYSQL_DATABASE` for the database name, and `MYSQL_USER` and `MYSQL_PASSWORD` for the MySQL username and password. These can be set in `.docksal/docksal.env`, and will need to be present for this to work. For example: @@ -70,6 +68,5 @@ services: ``` After changing this file, run `fin start` to rebuild the project containers and try to load the site again. -{% endblock %} [0]: https://docksal.readthedocs.io/en/master/advanced/drupal-settings diff --git a/source/_posts/2018-06-28-drupal-bristol-testing-workshop.md b/source/_posts/2018-06-28-drupal-bristol-testing-workshop.md index 3d84198b..126f3bb7 100644 --- a/source/_posts/2018-06-28-drupal-bristol-testing-workshop.md +++ b/source/_posts/2018-06-28-drupal-bristol-testing-workshop.md @@ -1,14 +1,11 @@ --- title: Drupal Bristol Testing Workshop +excerpt: Yesterday evening, I did my first workshop, held at the Drupal Bristol user group. tags: [composer, docksal, drupal, drupal-8, drupal-bristol, php, phpunit, testing] --- -{% block excerpt %} Yesterday evening, I did [my first workshop][16] (and I believe, the first workshop) held at the [{{ site.events['drupal_bristol'].name }}][14] user group. The subject was automated testing with PHPUnit in Drupal 8, in preparation for my talk at [{{ site.events['drupal_dev_days_18'].name }}][12] next week and to help process some ideas for my [testing book][15]. Here are some details about what we covered, and some of my thoughts in review. -{% endblock %} - -{% block content %} ## Local Environment @@ -46,7 +43,6 @@ I was very happy with how my first workshop went, it was a great experience for A couple of people mentioned about providing handouts to refer the code examples whilst working on the exercises, rather than relying on the slides and avoiding the need to sometimes switch back and forth between slides. I’ve found that I can export the slide deck as PNGs or JPGs from Deckset, so I’ll definitely do that next time. I’m giving the [Test Driven Drupal][9] talk at the [Drupal Dev Days conference][12] next week, and I’m hoping to give it again at other meetups and events in the UK. If you’d like me to do either at your meetup or event, [get in touch][13]. -{% endblock %} [0]: https://github.com/opdavies/drupal-testing-workshop [1]: https://github.com/drupal-composer/drupal-project diff --git a/source/_posts/2018-07-19-running-phpunit-tests-docksal-phpstorm.md b/source/_posts/2018-07-19-running-phpunit-tests-docksal-phpstorm.md index d8fb6809..bdee9a3a 100644 --- a/source/_posts/2018-07-19-running-phpunit-tests-docksal-phpstorm.md +++ b/source/_posts/2018-07-19-running-phpunit-tests-docksal-phpstorm.md @@ -1,5 +1,6 @@ --- title: How to run Drupal 8 PHPUnit Tests within Docksal from PhpStorm +excerpt: How to configure PhpStorm to run automated tests within Docksal. tags: - docksal - drupal @@ -8,13 +9,10 @@ tags: - phpunit - testing --- -{% block excerpt %} I’ve recently re-watched [A Clean PHPUnit Workflow in PHPStorm][0] on [Laracasts][1], where Jeffrey configures PhpStorm to run tests from within the IDE. With Drupal 8 using PHPUnit too, I decided to try and do the same with a local D8 site. Though because I’m using [Docksal][4] for my local development environment which, at least on a Mac, runs Docker containers within a virtual machine, there were some additional steps needed to achieve this and to have the tests run within the Docksal virtual machine and using the correct containers. -{% endblock %} -{% block content %} In this post, I’ll be using my [Drupal Testing Workshop codebase][2] as an example, which is based on the [Drupal Composer project][3] with some pre-configured Docksal configuration. This post is separated into a few different sections: @@ -155,7 +153,6 @@ if (file_exists('/.dockerenv') && file_exists(__DIR__ . '/docksal.settings.php') With this extra condition, the database credentials are loaded correctly and the functional tests run properly. Happy testing! -{% endblock %} [0]: https://laracasts.com/series/php-bits/episodes/2 [1]: https://laracasts.com diff --git a/source/_posts/2018-08-01-croeso-php-south-wales.md b/source/_posts/2018-08-01-croeso-php-south-wales.md index 8d222d11..c5ea83d8 100644 --- a/source/_posts/2018-08-01-croeso-php-south-wales.md +++ b/source/_posts/2018-08-01-croeso-php-south-wales.md @@ -1,16 +1,14 @@ --- title: Croeso PHP South Wales! +excerpt: Last night was the first meetup of Cardiff’s PHP South Wales user group. tags: - php - php-south-wales - meetups has_tweets: true --- -{% block excerpt %} Last night was the first meetup of Cardiff’s [PHP South Wales user group][0]! It was a great first event, and it was great to meet a lot of new people as well as catch up some familiars within the 36 (according to meetup.com) attendees - including some [PHP South West][9] regulars. -{% endblock %} -{% block content %} Organised by Steve and Amy McDougall, it was held in Barclays’ [Eagle Lab][1] which was a great space, and it was cool to be back in Brunel House having worked in that building previously whilst at Appnovation. {% include 'tweet' with { @@ -48,7 +46,6 @@ Thanks again to Steve and Amy for organising, Eagle Labs for hosting, the sponso It would be great to see even more people at the next one. If you’re interested, take a look at the [group’s website][0], [meetup.com group][7] and [Twitter profile][8]. Alternatively, get in touch with myself or one of the organisers for more information. **Croeso ac iechyd da PHP South Wales!** -{% endblock %} [0]: https://www.phpsouthwales.uk [1]: https://labs.uk.barclays/locations/cardiff-en diff --git a/source/_posts/2018-08-15-drupal-8-commerce-fixing-error-on-user-checkout.md b/source/_posts/2018-08-15-drupal-8-commerce-fixing-error-on-user-checkout.md index 408448d6..6f25e1b5 100644 --- a/source/_posts/2018-08-15-drupal-8-commerce-fixing-error-on-user-checkout.md +++ b/source/_posts/2018-08-15-drupal-8-commerce-fixing-error-on-user-checkout.md @@ -1,18 +1,16 @@ --- title: "Drupal 8 Commerce: Fixing 'No Such Customer' error on checkout" +excerpt: Fixing a Drupal Commerce error when a user tries to complete a checkout. tags: - drupal - drupal-8 - drupal-commerce - stripe --- -{% block excerpt %} Recently I was experiencing an issue on the Drupal 8 website I’m working on, where a small number of users were not able to complete the checkout process and instead got a generic `The site has encountered an unexpected error` message. Looking at the log, I was able to see the error being thrown (the customer ID has been redacted): -{% endblock %} -{% block content %} > Stripe\Error\InvalidRequest: No such customer: cus_xxxxxxxxxxxxxx in Stripe\ApiRequestor::_specificAPIError() (line 124 of /var/www/vendor/stripe/stripe-php/lib/ApiRequestor.php). Logging in to the Stripe account, I was able to confirm that the specified customer ID did not exist. So where was it coming from, and why was Drupal trying to retrieve a non-existent customer? @@ -79,4 +77,3 @@ private static function _specificAPIError($rbody, $rcode, $rheaders, $resp, $err ## Solution After confirming that it was the correct user ID, simply removing that row from the database allowed the new Stripe customer to be created and for the user to check out successfully. -{% endblock %} diff --git a/source/_posts/2018-08-16-null-users-and-system-users-in-drupal.md b/source/_posts/2018-08-16-null-users-and-system-users-in-drupal.md index 67314f5b..fc7cb232 100644 --- a/source/_posts/2018-08-16-null-users-and-system-users-in-drupal.md +++ b/source/_posts/2018-08-16-null-users-and-system-users-in-drupal.md @@ -1,5 +1,6 @@ --- title: Null Users and System Users in Drupal +excerpt: wwww tags: - drupal - drupal-7 @@ -8,15 +9,12 @@ tags: - drupal-planet - php --- -{% block excerpt %} Have you ever needed to have a 'special user' to perform tasks on your Drupal site, such as performing actions based on an API request, or for sending an internal site message? If you just create a new user, how do you identify that user going forward? Do you hard-code the 'magic' user ID in your custom code? What if the user has a different ID on different environments of your site? You could declare it in each environment’s settings file and retrieve it from there, but what then if you need to do the same on another site? That would mean some duplication of code - and something that could have been abstracted and re-used. I had to do this recently, and rather than just duplicate the code I decided to make it into it’s own module - which then became two modules. -{% endblock %} -{% block content %} ## System users The [System User module][1] provides a re-usable, generic way to denote users as 'system users', which is not specific to a certain site or environment as this is value is stored against each individual user in the database. @@ -102,7 +100,6 @@ System User module is the only one that I’m aware of that makes use of Null Us - [Null object pattern][3] - [Null User module][2] - [System User module][1] -{% endblock %} [1]: https://www.drupal.org/project/system_user [2]: https://www.drupal.org/project/null_user diff --git a/source/_posts/2018-08-21-experimenting-with-events-in-drupal-8.md b/source/_posts/2018-08-21-experimenting-with-events-in-drupal-8.md index fcf93182..2834a30f 100644 --- a/source/_posts/2018-08-21-experimenting-with-events-in-drupal-8.md +++ b/source/_posts/2018-08-21-experimenting-with-events-in-drupal-8.md @@ -1,5 +1,6 @@ --- title: Experimenting with events in Drupal 8 +excerpt: Trying a different way of structuring Drupal modules, using event subscribers and autowiring. tags: - drupal - drupal-8 @@ -7,11 +8,8 @@ tags: - php - symfony --- -{% block excerpt %} -I’ve been experimenting with moving some of the code to Drupal 8, and I’m quite intrigued by a different way that I’ve tried to structure it - building on some of the takeaways from Drupal Dev Days. -{% endblock %} +I’ve been experimenting with moving some code to Drupal 8, and I’m quite intrigued by a different way that I’ve tried to structure it - using event subscribers, building on some of the takeaways from Drupal Dev Days. -{% block content %} Here is how this module is currently structured: ![](/images/blog/events-drupal-8/1.png){.border .p-1} @@ -20,7 +18,7 @@ Note that there is no `opdavies_blog.module` file, and rather than calling actio This means that there are no long `hook_entity_update` functions, and instead there are descriptive, readable event subscriber class names, simpler action code that is responsibile only for performing one task, and you’re able to inject and autowire dependencies into the event subscriber classes as services - making it easier and cleaner to use dependency injection, and simpler write tests to mock dependencies when needed. -The additional events are provided by the [Hook Event Dispatcher module][0]. +The additional events are provided by the [Hook Event Dispatcher module](https://www.drupal.org/project/hook_event_dispatcher). ## Code @@ -68,6 +66,3 @@ class SendTweet implements EventSubscriberInterface { } ``` -{% endblock %} - -[0]: https://www.drupal.org/project/hook_event_dispatcher diff --git a/source/_posts/2018-08-23-examples-of-laravel-collections-in-drupal.md b/source/_posts/2018-08-23-examples-of-laravel-collections-in-drupal.md index cca85315..a967736a 100644 --- a/source/_posts/2018-08-23-examples-of-laravel-collections-in-drupal.md +++ b/source/_posts/2018-08-23-examples-of-laravel-collections-in-drupal.md @@ -1,5 +1,6 @@ --- title: Examples of using Laravel Collections in Drupal +excerpt: Some examples of using Laravel’s Illuminate Collections within Drupal projects. tags: - drupal - drupal-7 @@ -10,15 +11,12 @@ tags: - php has_tweets: true --- -{% block excerpt %} Since starting to work with Laravel as well as Drupal and Symfony, watching Adam Wathan’s [Refactoring to Collections][0] course as well as [lessons on Laracasts][6], I’ve become a fan of [Laravel’s Illuminate Collections][1] and the object-orientated pipeline approach for interacting with PHP arrays. In fact I’ve given a talk on [using Collections outside Laravel][2] and have written a [Collection class module][3] for Drupal 7. I’ve also tweeted several examples of code that I’ve written within Drupal that use Collections, and I thought it would be good to collate them all here for reference. -{% endblock %} -{% block content %} Thanks again to [Tighten][4] for releasing and maintaining the [tightenco/collect library][5] that makes it possible to pull in Collections via Composer.
@@ -52,7 +50,6 @@ Thanks again to [Tighten][4] for releasing and maintaining the [tightenco/collec content: '

Some more #Drupal 8 fun with Laravel Collections. Loading the tags for a post and generating a formatted string of tweetable hashtags. pic.twitter.com/GbyiRPzIRo

— Oliver Davies (@opdavies) August 23, 2018', } %}
-{% endblock %} [0]: https://adamwathan.me/refactoring-to-collections [1]: https://laravel.com/docs/collections diff --git a/source/_posts/2018-09-04-quick-project-switching-in-phpstorm.md b/source/_posts/2018-09-04-quick-project-switching-in-phpstorm.md index e2c2ce31..b59b7eee 100644 --- a/source/_posts/2018-09-04-quick-project-switching-in-phpstorm.md +++ b/source/_posts/2018-09-04-quick-project-switching-in-phpstorm.md @@ -1,14 +1,12 @@ --- title: Quick Project Switching in PhpStorm +excerpt: How to quickly switch between projects in PhpStorm. tags: - phpstorm has_tweets: true --- -{% block excerpt %} Following a recent conversation on Twitter with [socketwench](https://twitter.com/socketwench) about project switching in PhpStorm, I thought I’d document my workflow here. -{% endblock %} -{% block content %} Here is the original tweet and my initial response. I also have a lot of PhpStorm projects, and as I’m always working on multiple projects I regularly need to switch between them. {% include 'tweet' with { @@ -44,4 +42,3 @@ We can make this easier by adding a new keyboard shortcut. Within the Keymap pre ![Assigning a keyboard shortcut](/images/blog/quick-project-switching-phpstorm/adding-keyboard-shortcut-2.png){.with-border .with-padding} This this shortcut added, you can now use it to instantly bring up your recent projects list, filter it and switch project. -{% endblock %} diff --git a/source/_posts/2018-10-24-debugging-drupal-commerce-promotions-illiminate-collections.md b/source/_posts/2018-10-24-debugging-drupal-commerce-promotions-illiminate-collections.md index caee1437..dd8c9576 100644 --- a/source/_posts/2018-10-24-debugging-drupal-commerce-promotions-illiminate-collections.md +++ b/source/_posts/2018-10-24-debugging-drupal-commerce-promotions-illiminate-collections.md @@ -1,5 +1,6 @@ --- title: Debugging Drupal Commerce Promotions and Adjustments using Illuminate Collections (Drupal 8) +excerpt: Using Laravel’s Illuminate Collections to debug an issue with a Drupal Commerce promotion. tags: - drupal - drupal-8 @@ -9,11 +10,8 @@ tags: - laravel-collections - php --- -{% block excerpt %} Today I found another instance where I decided to use [Illuminate Collections][0] within my Drupal 8 code; whilst I was debugging an issue where a [Drupal Commerce][1] promotion was incorrectly being applied to an order. -{% endblock %} -{% block content %} No adjustments were showing in the Drupal UI for that order, so after some initial investigation and finding that `$order->getAdjustments()` was empty, I determined that I would need to get the adjustments from each order item within the order. If the order were an array, this is how it would be structured in this situation: @@ -113,7 +111,6 @@ collect($order->getItems()) This returns a Collection containing just the relevant promotion IDs being applied to the order that I can use for debugging. Now just to find out why the incorrect promotion was applying! -{% endblock %} [0]: https://laravel.com/docs/collections [1]: https://drupalcommerce.org diff --git a/source/_posts/2018-11-20-drupalcamp-london-2019-tickets.md b/source/_posts/2018-11-20-drupalcamp-london-2019-tickets.md index f11c1ae1..d3a77144 100644 --- a/source/_posts/2018-11-20-drupalcamp-london-2019-tickets.md +++ b/source/_posts/2018-11-20-drupalcamp-london-2019-tickets.md @@ -1,5 +1,6 @@ --- title: DrupalCamp London 2019 - Tickets Available and Call for Sessions +excerpt: DrupalCamp London early-bird tickets are now available, and their call for sessions is open. date: 2018-11-20 23:00 tags: - conferences @@ -8,11 +9,8 @@ tags: - drupalcamp-london has_tweets: true --- -{% block excerpt %} It was announced this week that [early-bird tickets are now available][0] for [DrupalCamp London 2019][1], as well as their [call for sessions being open][2]. -{% endblock %} -{% block content %} {% include 'tweet' with { content: '

The time is finally here. You can now purchase your tickets. Early Bird finishes on 2nd January 2019 - https://t.co/aG6jstmWzv #Drupal

— DrupalCamp London (@DrupalCampLDN) November 19, 2018 ', @@ -27,7 +25,6 @@ _Note: I am not an organiser of DrupalCamp London, nor am I involved with the se Hopefully there will be no [#uksnow][3] this year! DrupalCamp London is the 1-3 March 2019. Early bird tickets are available until 2 January 2019, and the call for sessions is open until 21 January. -{% endblock %} [0]: https://twitter.com/DrupalCampLDN/status/1064584179113971712 [1]: https://drupalcamp.london diff --git a/source/_posts/2018-11-20-rebuilding-bartik-with-vuejs-tailwind-css.md b/source/_posts/2018-11-20-rebuilding-bartik-with-vuejs-tailwind-css.md index fea66f26..a0b35ee9 100644 --- a/source/_posts/2018-11-20-rebuilding-bartik-with-vuejs-tailwind-css.md +++ b/source/_posts/2018-11-20-rebuilding-bartik-with-vuejs-tailwind-css.md @@ -1,8 +1,6 @@ --- title: Rebuilding Bartik (Drupal’s Default Theme) with Vue.js and Tailwind CSS -meta: - description: How I rebuilt Drupal’s Bartik theme using Vue.js and Tailwind CSS. - image: ~ +excerpt: How I rebuilt Drupal’s Bartik theme using Vue.js and Tailwind CSS. tags: - drupal - tailwind-css diff --git a/source/_posts/2018-12-16-published-my-first-npm-package.md b/source/_posts/2018-12-16-published-my-first-npm-package.md index d8db8178..f34b410b 100644 --- a/source/_posts/2018-12-16-published-my-first-npm-package.md +++ b/source/_posts/2018-12-16-published-my-first-npm-package.md @@ -1,15 +1,13 @@ --- title: Published my first NPM package +excerpt: Yesterday I published my first module onto NPM, and it’s a plugin for Tailwind CSS to be used alongside Vue.js. tags: - npm - tailwind-css - vuejs --- -{% block excerpt %} Yesterday I published my first module onto NPM, and it’s a plugin for [Tailwind CSS][tailwind] to be used alongside [Vue.js](https://vuejs.org). -{% endblock %} -{% block content %} The plugin adds classes for showing and hiding elements in different display variations in combination with Vue's [v-cloak directive](https://vuejs.org/v2/api/#v-cloak), which I originally saw in [the first 'Building Kitetail' video](https://youtu.be/XUXpcbYQ_iQ?t=2360). These are useful for when you want an element to be visible whilst Vue is compiling, and hidden afterwards. Here is the compiled CSS that is added by the plugin: @@ -88,7 +86,6 @@ Within my `navbar.html.twig` partial, I have a placeholder div that also contain I was originally surprised that these classes weren’t included as part of Tailwind or as part of an existing plugin, but as I’ve already used these styles on several projects that include Vue.js with Symfony or Sculpin, it made sense to extract it into a plugin and make it available as a npm package which I can easily add to any project - as well as making it easier to maintain if I need to add additional variations at a later point. **You can view [the package on npmjs.com][npm], and [the code repository on GitHub][github].** -{% endblock %} [github]: https://github.com/opdavies/tailwindcss-vuejs [npm]: https://www.npmjs.com/package/tailwindcss-vuejs diff --git a/source/_posts/2018-12-27-rebuilding-bartik-with-vuejs-tailwind-css-part-2.md b/source/_posts/2018-12-27-rebuilding-bartik-with-vuejs-tailwind-css-part-2.md index 5a347b90..d04154c2 100644 --- a/source/_posts/2018-12-27-rebuilding-bartik-with-vuejs-tailwind-css-part-2.md +++ b/source/_posts/2018-12-27-rebuilding-bartik-with-vuejs-tailwind-css-part-2.md @@ -1,8 +1,6 @@ --- title: Rebuilding Bartik (Drupal’s Default Theme) with Vue.js and Tailwind CSS - part 2 -meta: - description: How I rebuilt Drupal’s Bartik theme using Vue.js and Tailwind CSS. - image: ~ +excerpt: A follow-up to my original post on rebuilding Bartik with Tailwind and Vue.js. tags: - drupal - tailwind-css diff --git a/source/_posts/2018-12-29-rebuilding-acquia-dashboard-with-vuejs-tailwind-css.md b/source/_posts/2018-12-29-rebuilding-acquia-dashboard-with-vuejs-tailwind-css.md index cc3d7dd2..8e50b3ba 100644 --- a/source/_posts/2018-12-29-rebuilding-acquia-dashboard-with-vuejs-tailwind-css.md +++ b/source/_posts/2018-12-29-rebuilding-acquia-dashboard-with-vuejs-tailwind-css.md @@ -1,8 +1,6 @@ --- title: Rebuilding Acquia’s Dashboard with Vue.js and Tailwind CSS -meta: - description: How I rebuilt Acquia’s dashboard using Vue.js and Tailwind CSS. - image: ~ +excerpt: How I rebuilt Acquia’s dashboard using Vue.js and Tailwind CSS. tags: - drupal - tailwind-css