diff --git a/source/_posts/2012-04-19-custom-theme-templates.md b/source/_posts/2012-04-19-custom-theme-templates.md index 9d1a7a7f..33e78b12 100644 --- a/source/_posts/2012-04-19-custom-theme-templates.md +++ b/source/_posts/2012-04-19-custom-theme-templates.md @@ -15,10 +15,6 @@ I have previously seen it done this way by adding this into in a node.tpl.php fi {% endblock %} {% block content %} -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. - -I have previously seen it done this way by adding this into in a node.tpl.php file: - ```language-php if ($teaser) { // The teaser output. diff --git a/source/_posts/2012-05-23-apache-text-files.md b/source/_posts/2012-05-23-apache-text-files.md index 38993eca..5a270e4d 100644 --- a/source/_posts/2012-05-23-apache-text-files.md +++ b/source/_posts/2012-05-23-apache-text-files.md @@ -14,10 +14,6 @@ Rather than delete these files or change the file permissions manually for each {% endblock %} {% block content %} -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: - ```language-apacheconf Order deny,allow diff --git a/source/_posts/2012-05-24-dividing-drupals-process-and-preprocess-functions.md b/source/_posts/2012-05-24-dividing-drupals-process-and-preprocess-functions.md index ffbf71be..f37b60c9 100644 --- a/source/_posts/2012-05-24-dividing-drupals-process-and-preprocess-functions.md +++ b/source/_posts/2012-05-24-dividing-drupals-process-and-preprocess-functions.md @@ -10,16 +10,12 @@ tags: 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. -{% endblock %} - -{% block content %} 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. The first step is to use the default mytheme_process() and mytheme_preprocess() functions to utilise my custom function. So within my template.php file: +{% endblock %} +{% block content %} ```language-php . This post was accurate at the time of writing, whereas the documentation page will be kept up to date with any future changes.* -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. - ## Initial configuration ### Download the Library diff --git a/source/_posts/2012-07-27-linux-journal.md b/source/_posts/2012-07-27-linux-journal.md index 714855dc..256fc6d0 100644 --- a/source/_posts/2012-07-27-linux-journal.md +++ b/source/_posts/2012-07-27-linux-journal.md @@ -15,7 +15,7 @@ I'm absolutely delighted to announce that I'm going to be writing an article for {% endblock %} {% block content %} -I'm absolutely delighted to announce that I'm going to be writing an article for [Linux Journal](http://www.linuxjournal.com) magazine's upcoming Drupal special. The article is going to be entitled "Speeding Up Your Drupal Development Using Installation Profiles and Distributions" and will be mentioning existing distributions available on Drupal.org, but mainly focussing on the steps needed to create your own custom distribution. Needless to say, I'm quite excited about it! +The article is 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 2c751b21..bc16045d 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 @@ -15,8 +15,6 @@ For reference, this is the code needed to display a menu in a Drupal 7 template {% endblock %} {% block content %} -For reference, this is the code needed to display a menu in a Drupal 7 template file, including the navigation ARIA role. - ```language-php $menu_name = 'menu-footer-menu'; $menu_id = 'footer-menu'; diff --git a/source/_posts/2012-09-06-reflections-speaking-unifieddiff.md b/source/_posts/2012-09-06-reflections-speaking-unifieddiff.md index 1fe1911a..397fa609 100644 --- a/source/_posts/2012-09-06-reflections-speaking-unifieddiff.md +++ b/source/_posts/2012-09-06-reflections-speaking-unifieddiff.md @@ -11,8 +11,6 @@ Yesterday evening I went along and spoke at the [UnifiedDiff meetup](http://www. {% endblock %} {% block content %} -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. - 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". 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 d2954e65..614c6b0c 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 @@ -12,8 +12,6 @@ These preferences ensure that the code is compliant with [Drupal coding standard {% endblock %} {% block content %} -[Sublime Text 2](http://www.sublimetext.com/2) has been my text editor of choice for the past few months, and I use it at home, in work, and on any virtual machines that I run. So rather than having to manually re-enter my settings each time, I thought that I'd document them here for future reference. These preferences ensure that the code is compliant with [Drupal coding standards](http://drupal.org/coding-standards "Drupal coding standards on Drupal.org") - using two spaces instead of a tab, no trailing whitespace, blank line at the end of a file etc. - ## Preferences These can be changed by going to Preferences > Settings - User. diff --git a/source/_posts/2012-11-15-accessible-bristol-site.md b/source/_posts/2012-11-15-accessible-bristol-site.md index 28486327..65e84c96 100644 --- a/source/_posts/2012-11-15-accessible-bristol-site.md +++ b/source/_posts/2012-11-15-accessible-bristol-site.md @@ -8,13 +8,11 @@ tags: 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. +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 %} -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. +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-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 8396dfda..f2090db0 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 @@ -17,8 +17,6 @@ I've recently started using [SASS](http://sass-lang.com) rather than LESS to do {% endblock %} {% block content %} -I've recently started using [SASS](http://sass-lang.com) rather than LESS to do my CSS preprocessing - namely due to its integration with [Compass](http://compass-style.org) and it's built-in CSS3 mixins. There are three modules that provide the ability to use SASS within Drupal: - * [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") 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 a1c7f042..5b892a5f 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 @@ -15,8 +15,6 @@ I see this regularly when working on Drupal sites when someone wants to check wh {% endblock %} {% block content %} -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): - ```language-php global $user; if ($user->uid) { 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 764751f7..2a6ead53 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 @@ -13,8 +13,6 @@ This post outlines the steps required to create your own custom tokens in Drupal {% endblock %} {% block content %} -This post outlines the steps required to create your own custom tokens in Drupal. - 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. 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 9581cbab..5cd3255b 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 @@ -12,7 +12,7 @@ After reading numerous blog posts about how to install [Sublime Text 2](http://w {% endblock %} {% block content %} -After reading numerous blog posts about how to install [Sublime Text 2](http://www.sublimetext.com/2 "Sublime Text 2") in [Ubuntu](http://www.ubuntu.com/2 "Ubuntu"), this is definitely the quickest way! Just paste the following lines into your Terminal: +Just paste the following lines into your Terminal: ```language-bash $ sudo add-apt-repository ppa:webupd8team/sublime-text-2 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 320b2e98..811be408 100644 --- a/source/_posts/2013-04-20-leaving-nomensa-joining-precedent.md +++ b/source/_posts/2013-04-20-leaving-nomensa-joining-precedent.md @@ -12,8 +12,6 @@ Yesterday was my last day working at [Nomensa](http://www.nomensa.com "Nomensa") {% endblock %} {% block content %} -Yesterday was my last day working at [Nomensa](http://www.nomensa.com "Nomensa"). Next week, I'll be starting as a Senior Developer at [Precedent](http://www.precedent.co.uk "Precedent"). - The last 14 months that I've been working at Nomensa have been absolutely fantastic, and had allowed me to work on some great projects for great clients - mainly [unionlearn](http://www.unionlearn.org "unionlearn") and [Digital Theatre Plus](http://www.digitaltheatreplus.com "Digital Theatre Plus"). I've learned so much about accessibility and web standards, and have pretty much changed my whole approach to front-end development to accommodate best practices. I've also been involved with the Drupal Accessibility group since starting at Nomensa, and have written several accessibility-focused Drupal modules, including the [Nomensa Accessible Media Player](http://drupal.org/project/nomensa_amp "The Nomensa Accessible Media Player Drupal module") module and the [Accessibility Checklist](http://drupal.org/project/a11y_checklist "The accessibility checklist for Drupal"). I'll definitely be continuing my interest in accessibility, championing best practices, and incorporating it into my future work wherever possible. With that all said, I'm really looking forward to starting my new role at Precedent, tackling some new challenges, and I'm sure that it'll be as great a place to work as Nomensa was. 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 07ac1c22..7d946919 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 @@ -10,11 +10,11 @@ tags: 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. Here's how to do it. +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. {% endblock %} {% block content %} -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. +Here's how to do it. For example (with some slight modifications): 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 bdc314ab..8cbb910d 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 @@ -14,8 +14,6 @@ Here are some useful links that I've found when researching about unit testing i {% endblock %} {% block content %} -Here are some useful links that I've found when researching about unit testing in Drupal using SimpleTest: - * [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)") 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 c4c36cd3..52b2a5e6 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 @@ -12,14 +12,10 @@ 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. +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 %} -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: - ```language-bash live_domain local_domain diff --git a/source/_posts/2013-07-26-going-to-drupalcon.md b/source/_posts/2013-07-26-going-to-drupalcon.md index 7ee932a3..3e88dc0c 100644 --- a/source/_posts/2013-07-26-going-to-drupalcon.md +++ b/source/_posts/2013-07-26-going-to-drupalcon.md @@ -11,8 +11,6 @@ use: [posts] {% endblock %} {% block content %} -[Precedent](http://www.precedent.co.uk) are sending myself and two of our other Drupal Developers to [Drupalcon Prague](http://prague2013.drupal.org). - Having wanted to attend the last few Drupalcons (London, especially) but not being able to, I'm definitely looking forward to this one. See you there! 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 c141184b..22890a55 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 @@ -13,10 +13,6 @@ To bootstrap Drupal, you would need to add some additional lines of code to the {% endblock %} {% block content %} -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. Something like: - ```language-php 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. diff --git a/source/_posts/2015-03-20-2014.md b/source/_posts/2015-03-20-2014.md index caf8f692..0daa6205 100644 --- a/source/_posts/2015-03-20-2014.md +++ b/source/_posts/2015-03-20-2014.md @@ -13,8 +13,6 @@ A lot happened in 2014. Here are some of the main things that I'd like to highli {% endblock %} {% block content %} -A lot happened in 2014. Here are some of the main things that I'd like to highlight: - ## 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). diff --git a/source/_posts/2015-07-19-sculpin-resources.md b/source/_posts/2015-07-19-sculpin-resources.md index 3a256538..988fff9b 100644 --- a/source/_posts/2015-07-19-sculpin-resources.md +++ b/source/_posts/2015-07-19-sculpin-resources.md @@ -16,8 +16,6 @@ Here’s a list of resources that I compiled whilst preparing for my [Sculpin an {% endblock %} {% block content %} -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). - ## General Information * diff --git a/source/_posts/2015-12-22-entityform.md b/source/_posts/2015-12-22-entityform.md index 004b09e8..9f8eea18 100644 --- a/source/_posts/2015-12-22-entityform.md +++ b/source/_posts/2015-12-22-entityform.md @@ -16,10 +16,6 @@ Here are the steps that I took to be able to load, render and embed the form. {% endblock %} {% block content %} -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. - ## 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. 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 9dd372e2..ff89bdc1 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 @@ -13,8 +13,6 @@ For the past few weeks I’ve been working on a personal side project, based on {% endblock %} {% block content %} -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. - ![](/assets/images/blog/drupalvm-generate-repo.png) ## What is Drupal VM?