background preloader

Drupal code

Facebook Twitter

Switching Drush Versions. I combed the web for instructions on how to switch Drush versions on a Mac and didn’t find what I needed.

Switching Drush Versions

But I did find several articles that had parts of the answer. So I stitched things together and came up with the following system based on Composer. 1) Install Composer Composer is the recommended method of installing Drush these days, certainly for the bleeding edge version. PHP Environment setup. Drupal 7 Node Access Grants. Here we can see that hook_node_access will explicitly allow or deny access to a specific node for the given user if they have the permission.

Drupal 7 Node Access Grants

If any hook_node_access() implementation returns NODE_ACCESS_DENY for a given node then the user will not be able to see it. If at least one hook_node_access() implementation returns NODE_ACCESS_ALLOW for a given node then the user will be able to see it, as long as noone has returned NODE_ACCESS_DENY. If no module returns NODE_ACCESS_ALLOW then the default behaviour applies which is normally to allow access if its published but depends on what Grants are defined (more on this later). Decouple from Frameworks. Frameworks solve infrastructure problems, for example how to create a HTTP or CLI application.

Decouple from Frameworks

While necessary, those concerns don't add any value to your project: the business need will not be fulfilled by creating an empty application. As always, different responsibilities mean also different reasons to change: frameworks have a history of Backward Compatibility (BC) breaks and they do so regardless of your project. Take for example Symfony: it only started to follow Semantic Versioning from version 2.3. The upgrade to version 3 has been made easier by allowing developers to know what was deprecated, but the removal of those features still means a lot of work in your application. Migrating Symfony applications (from symfony1, from symfony 2.0, etc) is so hard that it is a business on its own. Does that mean that we shouldn't use any frameworks? Why You Should now Start Developing with Drupal 8 - Liip Blog Liip. 11 Liipers attended the DrupalCon Barcelona in September 2015.

Why You Should now Start Developing with Drupal 8 - Liip Blog Liip

We learned a lot about Drupal 8. And heard over and over again: “Start working with Drupal 8 now!”. But let’s have a look back: The development of Drupal 8 took more than 4 years and for me as a developer it sometimes seems, like no stone was left unturned. Almost everything has changed. Processing expensive back-end operations. In this article, I will explain how you can organize these operations in order to avoid the pitfalls related to them.

Processing expensive back-end operations

I created a GitHub repository with the code of every step in this article. You will see how we can use update hooks, drush commands or Drupal queues to solve this. Depending on the situation you’ll learn to use one or the other. Scenario The UX team at the Great Shows TV channel has come up with an idea to improve the user experience on their Drupal website. Your job as the lead back-end developer at Great Shows is to import the episode information from Nuts For TV. The Command Line API for Fun and Profit. The Command Line API is a collection of aliases, convenience functions, and shortcuts to interact with your web page right from within the JavaScript console.

The Command Line API for Fun and Profit

In this article, we will have a look at some of those helpers and how you can leverage them for a better developing and debugging experience. You can access your browser’s JavaScript console in a variety of ways. A simple contact form in Node.js. As mentioned earlier: a headless Drupal install has its challenges.

A simple contact form in Node.js

Take for example forms: Drupal has a fantastic form api, where Drupal really distincts itself from other cms's. That form api isn't directly available, when you have a decoupled frontend in node.js. Managing users with Drush. Dealing with user accounts is an essential part of Drupal development.

Managing users with Drush

You’ll find yourself needing to: Change the password for a userChange the password for the admin account on your local site so you can login as adminBlock a user to prevent them from logging inCreate new user accountsAdd a role to a user account so you can test permissions You can do all of this in the Drupal admin interface, but it takes time. Goodbye Drush Make, Hello Composer! I was a little worried about changing the process I’ve used for a long time, but my worries were for nothing.

Goodbye Drush Make, Hello Composer!

Anyone who’s used to Drush would probably find it pretty easy to get this up and running. TLDR: How to go from an empty directory to a fully functional Drupal site in two command lines: Install Composer Let's talk through the whole process, step by step. Creating Patches for Drupal Projects - Jacine Luisi. This guide will show you what patches are and how to work with them in the context of the Drupal project (though it will likely be useful for any project).

Creating Patches for Drupal Projects - Jacine Luisi

When you’re finished reading, you’ll be able to create, apply and revert patches like a pro. Here’s what we’ll cover: The Anatomy of a Patch. Dynamic field group titles. The Field Group module is a much used way to group the display of fields. Groups can have titles which give context to the fields in this group and can act as links to open or close the group. For this use case we have the comments inside a collapsible group (done with Display Suite). The title of this group should include the number of comments. To dynamically change the title of a group is something that is not very well documented, so here’s an attempt. An omission in the documentation is which hooks the Field Group module provides, so check the source (filed_group.api.php) for this. As we are using this in a theme, we use the alter-hook. How to Write a Drupal 8 Installation Profile.

Last updated May 6, 2015. Created on March 4, 2014.Edited by moshe weitzman, tstoeckler, Kristen Pol, amool. Log in to edit this page. This article is being written based on the Spark distribution. Installation profiles are like modules All installation profiles must have: Drupal informatie van Wizzlern, de Drupal trainers. Configuration Management in Drupal 8: The Key Concepts. In this article I highlight nine concepts that are key to understanding the configuration system. This article is light on details and heavy on links to additional resources. It is called the “configuration system.” The Configuration Management Initiative (CMI) is, by most reasonable measures, feature complete.

The number of CMI critical issues was reduced to zero back in the Spring and the #drupal-cmi IRC channel has been very quiet over the past few months. Drupal Performance Optimization Checklist. You must have read plenty of articles on how to tune your Drupal site to improve its page load times. This post assembles an exhaustive list of all the configurations and tweaks you can do to improve Drupal's performance. Caching Enable block cache. Drupal 8 Cheatsheet for Developers. It has been a few months since Drupal 8 was released and sites built with it are starting to crop up. I myself have had the pleasure of working with it, and more Drupal 8 projects are certainly on the horizon. From a developer's perspective, this version is substantially different from the previous one, and we will need to learn a handful of new ways of doing things.

Drupal Development and Server Environment Best Practices. When starting a new project we often outline our development process with our clients. The explanation helps our clients understand how important each aspect is to the immediate- and long-term success of their projects. So many ways to hide. Generally speaking hiding content goes alongside a bit of javascript that unhides the content under certain circumstances (think hamburger menu). Sometimes the content improves accessibility but is considered visual noise (says the designer).

Upping our game in accessibility, openness and signature technology - PDF in Drupal part 1. In the web community, PDF has become synonym for a range of accessibility bad practices. Some people even think that we would all be better off if PDF would finally die, just like Flash and Internet Explorer. As a result PDF is not very sexy in the Drupal and wider PHP community and this has negatively impacted our tooling. This is a shame: when properly implemented, the PDF standard doesn’t need to suffer from the accessibility issues that a lot of online PDF documents are plagued with. PDF also holds a unique position in the digital world, it is a widely accepted standard that enables a range of applications for which there are no real alternatives. Drupol/openlayers. How to set up auto posting from a Drupal site to Facebook — Internetdevels official blog.

Useful tips by the developers of our Drupal development company make social networks closer and your life easier ;) Once we told you about Drupal modules for social network integration. Understanding the Drupal Way - Hooks. Building great websites with Drupal. Over the past few months (since Drupalcon LA), I have been actively diving in to the world of decoupled Drupal, in particular using AngularJS as a front end. Drupal Development with Docker Compose. Using virtualized environments for development is smart. You can create accurate replicas of arbitrary systems, safely isolated from your host OS and other development environments.

The overhead, however, is significant, both in terms of system and development resources. Developers need higher-end hardware with sufficient memory and storage and the necessary skills or help to build systems. Vagrant made virtualized environments configurable and portable and made sharing environments popular. The definitive introduction to D8 and Composer – Bojan Živanović. Drupal Development with Docker Compose.