Web Development

The Importance of Real Data

March 13, 2018
Web Development

At the start of a project there are many different objectives and everyone involved has their own sense of priorities or tasks they wish to a tackle first. For me that is generally sorting the backend into a nicely organised structure that will allow flexibility in the output both now and in the future. A big part of this is getting real data in so the front end output is as close to final content as possible. ...

Drupal 8 Workflow Notifications with Rules Part 3

March 6, 2018
Web Development
Drupal, drupal8, Rules, Workflow

In previous posts I’ve covered enabling and editing a Workflow and then sending an email when a new content moderation state has been saved. In this post we will complete the loop by sending emails when a content moderation state has been updated. In this example an editor will publish the node and the rule will email the node creator to tell them it has been published. Head to the Rules admin page /admin/config/workflow/rules and click Add reaction rule ...

Changing the Default Content Moderation State in Drupal 8

February 27, 2018
Web Development
Drupal, drupal8

I have been working with the Content Moderation module in Drupal 8 and one slight niggle we came across was the default option for the Moderation state. If the current state was In Review we would like the Change to option to also be In Review rather than Draft. This means the default is to keep the entity in it’s current state rather than switching to a new state. ...

Drupal 8 Workflow Notifications with Rules Part 2

February 20, 2018
Web Development
Drupal, drupal8, Rules, Workflow

In my previous post I talked through setting up Content Moderation with a review state. In this post we will complete the process by sending email notifications via the Rules module when the moderation state is changed. Install Rules # To enable the Rules module we first need to require it via Composer. Run the following from the command line in the root of your project composer require drupal/rules ...

Drupal 8 Workflow Notifications with Rules Part 1

February 13, 2018
Web Development
Drupal, drupal8, Rules, Workflow

For Drupal projects I’ve always used the comprehensive suite of tools provided by Workbench. But when I started a new project and saw that Workflow is hopefully making it’s way into core it felt like a good time to try it out. One part of the project was the addition of notifications when Workflow states were changed. With the Rules module also receiving lots of attention I decided combining the two modules was the best approach. ...

Coding With Pen and Paper

February 6, 2018
My work, Web Development
Web Development

Producing a rough sketch on a piece of paper may seem more like the realms of a designer desperately trying to get an idea out of their head into a physical form to share with others but I find it can also help me develop backend code. Planning # When starting a new bit of work I normally have the rough idea in my head of how I’m going to modularise the code and what functionality each piece will need. ...

Curse of the Redesign: Moving to the Live Environment

January 30, 2018
My work, Web Development
Web Development

When we develop sites we start off locally and in a development environment. During the development process we continue this process as we evolve the design and functionality. But there comes a point where the site we’re working moves to the stage where it will become the live site. At this point it’s preferable to move it to the live environment. Configuration # We try and match development and live environments as much as possible but it’s not always possible to get exact matches due to various constraints. ...

Curse of the Redesign: Handling Existing Content

January 23, 2018
My work, Web Development
Database, Web Development

As I spoke about in the previous post about redesigns my work generally focuses on clients who have existing sites that need to be moved to a new Content Management System and have a new design applied to them. Whilst this can have it’s advantages for design work by allowing the front end developers far more freedom with markup it has some challenges for the backend. Discovery # Every database I have received have been from a different CMS, some have been MySQL and some have been Microsoft SQL database but all have required some discovery. ...

Curse of the Redesign: Existing Content vs New Ideas

January 17, 2018
Web Development
CMS, Web Development

I can’t remember the last time I was involved in making a brand new website rather than an update or redesign. Maybe it’s just the sort of work we are suited to at Headscape and you may find differently. A redesign often brings with it different challenges to making a site from scratch, one of these is challenging the client to provide new types of content. By sharing a vision of how their site could be it encourages clients to improve their site rather than continue with the same old processes. ...

Drupal 7 Views Sort by Two Date Fields

October 31, 2017
Web Development
Drupal

To achieve this you will need to implement hook_views_query_alter() in a custom module. I did not do this in Views UI. A recent project at Headscape required me to build view listing two different content types that would use two different date fields to sort by. For examples I’ll use the default basic page and article content types. The Problem # Some content types need to be sorted on the node created date and others on the display date field. ...