03 328 8646

Blog

Drupal 8 Redirect to Latest Node

Problem: The website has a blog, events or something similar and it would greatly benefit editors, and external sites, to be able to simply link to the page for the most recent, or current, entity rather than having to update their links every time new content is generated.

Drupal 8 Address Fields and Google Maps

The Address module by Commerce Guys is a great piece of work, offering the right entry format for the entire world's addresses, and the underlying codebase can be used by any php project - not just Drupal.

Hide nodes without access permissions from manage content in Drupal 7

Once you have removed a site editors permission to edit & delete a page it will still show on the admin/content page of the site, and that can be useful for users to see the site structure.

Other times it can be confusing, and often causes at least a momentary thought glitch for the user before they go on to edit whatever it is they logged in for.

You can remove the node from the content listing page altogether if the current user doesn't have permission to perform any operations on it.

Just drop the following into your module and you're good to go.

Using LetsEncryt.com

We've started doing some SEO work on a long time client's site and one of the quick easy wins was to shift it to SSL. It was an opportunity to try out Let's Encrypt to keep the price down in both cert cost ( which is pretty low these days anyway ) and developer time ( always expensive! ). Let's Encrypt is still in public beta at the moment but the process for Apache on Ubuntu is well documented on their site and very easy to follow.

Related items in Drupal Commerce (Commerce Kickstart)

There are two main ways to handle related items - without getting into complex matching - that apply as much in Drupal Commerce as any other system.

  1. Manually selecting items that relate to a given item
  2. Automatically selecting them by the grouping they belong to. In Drupal terms this is likely to be by their Taxonomy term(s) and this is the method we use below

Both are pretty simple to set up.

Style & Class attributes in Drupal CK Editor

Even with the Full CKEditor input profile/filter classes and styles get removed from elements. Sometimes clients need to add styles or classes to elements and having them stripped all the time is pretty frustrating.

Luckily there's a simple fix that can be added to the Custom JavaScript configuration under Advanced options at admin/config/content/ckeditor/edit/Full

Paste in :

config.extraAllowedContent = '*(*){*}';

Contributing to the community

A little landmark was reached at BlueFusion the other day - we made it onto the DrupalCommerce forum leaderboard!

Contributing to the Drupal community has been a big discussion point within the Drupal community over the past few months. We, and our clients, benefit from the massive number of hours put into building Drupal by developers, designers, documentation writers and others around the world and it's important to us that we share the solutions we find & the code we write with the community.

Mobile is everything*

*almost.

For the first time Shopify has reported seeing more mobile than desktop traffic  on their platform. At the end of 2014 it's 50.3% to 49.7% - huge growth for a platform that didn't exist in any meaningful volumes until recently.

Creating a Drupal Commerce order form

Note: there's probably a lot more to think through on a site with larger numbers of products, the site we built this for has 3, so we don't have to deal with large forms, big cart updates or paginated views. This site also has Add To Cart Extras enabled, which changes the add to cart form.

Sometimes it would be nice to present your buyers with a view of their cart that both lets them add new products and update existing quantities.

Migrating Shopify to Drupal Commerce

We're doing our first Shopify to Drupal Commerce migration. With the need to differentiate between retail vs wholesale customers (pricing) and within wholesale (differing ranges) Shopify just isn't going to cut it for this client anymore. Shopify was perfect for the original spec - simple, quick to set up, cost effective to maintain and a range of great off-the-shelf templates to tweak.