Introduction
Craft usage trends, security, data migrations and more.
This is a "trendy" issue. The biggest trend is the usage of Craft itself. It's surging. Language switchers was a hot trend in the past couple weeks. You'll find multiple links about this below.
We've got news too. Craft 2 got a big update just before this issue was sent out the door. Go go go Craft 2! There are also loads of Craft CMS tips and plugins.
Thank you to CraftQuest for sponsoring this issue. If you've been eyeing a lifetime subscription to CraftQuest, today, August 1 2018, is your opportunity. The intro offer ends at midnight.
Got a Craft link to share? Send it along.
Let's hit the links.
-John Morton
Top Stories

About "critical" notifications in your control panel.
The tweet linked above is about a security problem, a fixed security problem. If you don't know by now, if you're using SEOMatic on Craft 3 and you're under version 3.1.3, you need to update it today. The good news is that Craft's control panel differentiates "normal" updates from "critical" ones so you know quickly you need to move on updating your site. Developers can distiguish a security change in a plugin by keeping a well-formatted changelog.
Craft 2 is now compatible with PHP 7.2
Craft 2 got a big upgrade on July 31 making it compatible with PHP 7.2. It also now includes "the mcrypt_compat library, which provides a shim for servers that don’t have Mcrypt installed."
News
Craft 3.0.18 released
In the previous issue, Craft had reached version 3.0.15. We've had 5 releases since then. Among the updates:
- Craft no longer relies on ImageMagick or GD to define the image formats that should be considered manipulatable.
- The
{% js %}
tag now supports the following position params: atPOS_HEAD
, atPOS_BEGIN
, atPOS_END
, onPOS_READY
, and onPOS_LOAD
(e.g.{% js at POS_END %}
).
There are more. Check the change log for all of the details.
Featured Sponsor

CraftQuest: Unlimited Craft Training & Tutorials
Learn Craft CMS with the official Craft training partner. Get immediate access to unlimited courses, lessons, and livestreams. Today, August 1st, is the last day for lifetime memberships.
Tools, tips, and fundamentals
The Craft Mindset on CraftQuest
Before you throw a bunch of content at Craft, stop for a minute and learn how to approach content and Craft together.
How to check for undefined variables
The resources springing up for Craft CMS point to a strong and growing community. Welcome Cruftless Craft to the fold with its inaugural post on checking for undefined variables in your Twig templates.
Andrew's Tweet tip on Element::isFieldEmpty()
Andrew continues his tweeting of great Craft tips.
The Element::isFieldEmpty()
is useful for checking for the existence of a custom field and whether custom field is empty or not.
Reserved words in Craft
The FieldRecord.php
file from the Craft source code reveals some reserved words.
Language switcher for Craft 3
Jan D'Hollander has a nice write up on the topic of language switching too.
Craft 3 introduced some changes to locales and the multi-site setup. On top of that there are also a number of templating changes, so your old language switcher probably won't work anymore. So today we're building a brand new language switcher for Craft 3.
devMode.fm // Herding Clients Through The Great Migration
How do you get clients to move from an outdated site solution to an updated platform? That's the topic of the day on this episode of devMode.fm.
Inlining SVGs in Craft 3
Look at that, another helpful Craft tweet from Andrew. (Are you following his account yet?)
What is the best way to exclude an array of entries?
You might do this if you have a several featured posts at the top of a page and you wanted to show a more exhaustive list lower down while excluding those in the featured area.
Perfecting your technique
Craft CMS 3 Content Migration Examples
Great article from Mike Hudson. It's now even linked in the official Craft docs on migrations.
Designing a GraphQL API
This tutorial was created by Shopify for internal purposes. We've created a public version of it since we think it's useful to anyone creating a GraphQL API.
How can I cache a list of entries with pending postDates and have it automatically invalidate the cache appropriately?
Dang... that's a long question.
Craft CMS Docker Hub from urbantrout
You'll find a number of Docker images for Craft CMS. Here's one from "urbantrout" featuring:
- Automatically requires and removes additional plugins via DEPENDENCIES environment variable Import SQL files
- Automatically restores database backups located under ./backups (See volumes in docker-compose.yml below). To create a database backup use the built-in backup tool within the Craft CMS Control Panel.
- Completely non-interactive installation of Craft CMS and plugins
- redis
Atomic deployment with Deployer
How are you deploying your Craft 3 site? If git pull
isn’t doing it for you, look into atomic deployments. This article cover atomic deployments and Craft specifically.
Rather than just updating the currently running files, a brand new folder is created where the new files are placed, vendor folders are updated, any other tasks are completed and then once everything has successfully completed this new folder is symlinked to the folder your web server.
Sponsor

Pic Puller: The Instagram plugin for Craft CMS 2 & 3
Pic Puller brings your Instagram media into Craft CMS with one-click authorization. Full documentation and code samples get you up and running quickly. Learn more at picpuller.com or find it in the plugin store in your Craft 3 control panel.
Plugged In
Bookings
An advanced booking and events management plugin for Craft CMS and Craft Commerce.
Note: this is a "work in progress" plugin.
Workflow
Workflow is a Craft CMS plugin for a common publisher-editor scenario when it comes to content authoring.
Store Hours 2.1
The Craft team released Store Hours 2.1 with custom time slots and templating improvements.
The Craft Advantage
Thunder Nerds: Get to Know Craft CMS
Video overview of Craft CMS with Leah Stephenson, Leslie Camacho, Sam Hernandez, & Brandon Kelly.
Overheard
It’s not Craft, but it’s interesting.
GoAccess - Visual Web Log Analyzer
GoAccess is an open source real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.
Front-End-Performance-Checklist
The only Front-End Performance Checklist that runs faster than the others.