Feed aggregator

Drupal core announcements: Proposal: New release schedule for Drupal 7 core

Planet Drupal -

There is a discussion underway about adopting a similar release schedule for Drupal 7 that Drupal 8 is using (i.e., a six-month feature release schedule, with pseudo-semantic versioning).

This is not a major change to current policy, but it would mean that new features or other potentially disruptive patches to Drupal 7 core would be limited to two windows per year, with the corresponding releases given a round number (for example, Drupal 7.50, Drupal 7.60, etc.) to indicate their importance.

I'd like to bring the discussion to a close soon so that if we do adopt the new schedule, the first such release can be slated for April 20 (the same day as the Drupal 8.1.0 release).

If you have any feedback on this proposal, please try to comment within the next week here: https://www.drupal.org/node/2598382

PreviousNext: So many ways to hide

Planet Drupal -

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).

So as the developer you have a lot of ways to... pat the cat(?) But not all cats react the same to being patted :D

Pronovix: PDF is dead; long live PDF! New standards with new applications - PDF in Drupal part 2

Planet Drupal -

It’s strange but true: seven years after the PDF reference was published as an ISO standard (ISO-32000-1), there are still developers who think that the Portable Document Format is a closed document format owned by Adobe. PDF is often perceived as a strange, impenetrable document format. It’s high time we bury that idea and take a look at what’s going on in the world of PDF today...

Darren Mothersele: Drupal Predictions for 2016

Planet Drupal -

This will be a momentus year for Drupal.

David H, Drupal.org webmaster, was soliciting responses to this thread on Twitter. I kept my predictions brief, but thought I would post here to elaborate.

Some people may be predicting a year of security vulnerabilities. I believe we have a year of innovation ahead of us.

Drupal's ecosystem of contributed modules is playing catch-up since the release of version 8. It has been years since CCK and Views were just experiments in the contrib module space. They are now established as foundation of Drupal core. Contrib (the wider community of Drupal developers) can now get back to innovating.

"Get back to innovating" isn't much of a prediction. I thought about it some more and came up with three things I think are likely to happen in 2016...


The era of the monolythic, does-it-all, CMS is coming to an end. The Drupal community talk a lot about progressive decoupling [1] [2]. But, the idea of a fully decoupled backend is becoming established in other areas. Services like Contentful already provide a fully decoupled, headless CMS.

Systems become decoupled, we move to a microservice architecture, and evaluate server-less options. It is conceivable that a Content API could become part of the infrastructure. Amazon are the leading Infrastructure-as-a-Service provider. A Content API (or CMS-as-a-Service) would fit in their suite of cloud computing services.

I did an experiment recently where I put Amazon's API Gateway in front of an EC2 instance running Drupal. This gives a more robust API on top of Drupal 8's Rest support. Monitoring, traffic management, and flexible security controls are standard. This approach offers several advantages, including: Swagger support; CloudFront caching for performance; and input/output translation with data models defined with JSON schema.

Acquia IPO

Going public was always on the cards for Acquia, but they said they are in no rush to IPO. This could be the year. Adoption of D8 will being changes to the user base and continued adoption at the enterprise level.

This will be accompanied by more consolidation in the Drupal world. One of the biggest risks I see is with Drupal companies taking on bigger projects. A single client becomes a large contributer to their revenue, in some cases I've heard as much as 70%. This is a risky situation to be in, if you rely on one client for a majority of your business. The solution is for Drupal companies to come together to form larger entities.

This is just a continuation of an existing trend. Wunderkraut, was the most high-profile merger in the community. Followed by many more, involving companies such as FFW, MediaCurrent, Phase2, and i-Kos.

Composer Support and Decoupled Components

Composer support in Drupal needs some work. There are some big wins to be had by embracing the Composer (and Packagist) workflow.

Commerce Guys are leading the way with Drupal Commerce. They have been factoring out components into separate libraries. Other PHP projects beyond Drupal are making use of them, and contributing to their development. Expect more contrib projects to factor out separate PHP packages of re-usable code. Then Drupal modules become just a thin layer of glue.

There has been a trend for PHP Frameworks to decouple their core components. The Symfony Components split from the full stack framework has meant much wider adoption. They are used in many PHP projects, including Drupal.

PHP-FIG exists to promote interoperability between frameworks. This year will see further initiatives to clean up Drupal's code. Such as, removal of anti-patterns like service locator. The eventual aim will be to decoupling components from Drupal core.

Can you imagine using Views on a non-drupal project?

Matt Glaman: Profiling Drupal Commerce with Blackfire

Planet Drupal -

The process of debugging can be a difficult one, and the process of troubleshooting performance even more so. Luckily there are some great tools out there to help with improving the performance of web applications. Previously I wrote about to visual stacktraces and identify bottlenecks. Flamegraphs are very helpful, but still require you to setup XHProf, download the tools for making the flamegraph SVG, and appropriately change your code to save the XHProf data. Luckily there is one of my favorite tools, , that provides continuous PHP performance testing.

One second can define a conversion or not, and this is highly critical when it comes to eCommerce. Bottlenecks can happen in your catalog, viewing products, or even the Drupal Commerce order's life cycle. A great example can be found on this Drupal commerce issue: https://www.drupal.org/node/2653904. It's a patch to improve the deletion of line item references from orders to cut down on number of saves for orders. There's profiling done with both XHProf and Blackfire.

What is Blackfire?

What about Blackfire makes it my favorite? Blackfire provides on-demand profiling, unlike XHProf, which is always collecting data. Blackfire has a PHP extension called Probe that collects raw performance data when requested. Then the Agent sends that data to Blackfire's website for processing and viewing. Companion is a browser extension (Chrome only currently) that will trigger the Probe to collect performance data on a page.

What you get

It speaks for itself. Here is a Blackfire profiling result from a catalog page in the Commerce Kickstart 2 demo store (Drupal without caches enabled.)

As you can see, we spend a lot of time in Views. Enabling Views cache for our catalog (and anonymous page cache) would greatly speed up our page's load time. Here are results with page caching enabled, and search based Views caching. From 1.88s to 55ms!

How to get started

While there is some Blackfire's components, I'll provide a quick start guide. Well, it's a quick start if you use Docker! Blackfire provides an image for their probe and agent. All you need to do is link it to your php-fpm (or whatever container serves your PHP.) 

 If you use Docker Compose, you would need to add the following configuration, and add a new link to this container from your PHP container. You will just need to get your API credentials from your Blackfire account. Restart your app and you're good to go!

blackfire: image: blackfire/blackfire ports: ['8707'] environment: BLACKFIRE_SERVER_ID: xx-xx-xx-xx-xxxx BLACKFIRE_SERVER_TOKEN: dsfsd! BLACKFIRE_LOG_LEVEL: 4

See the full documentation for Docker integration: https://blackfire.io/docs/integrations/docker

Acquia Developer Center Blog: Drupal 8 Module of the Week: Scheduled Updates

Planet Drupal -

Jeffrey A. "jam" McGuire

Each day, more Drupal 7 modules are being migrated over to Drupal 8 and new ones are being created for the Drupal community’s latest major release. In this series, the Acquia Developer Center is profiling some of the most prominent, useful modules available for Drupal 8. This week: Scheduled Updates.

Tags: acquia drupal planetscheduled updatedrupal 8

ThinkShout: Drupal Global Events in Portland

Planet Drupal -

There are two exciting Drupal community events happening in Portland soon. The first is the Drupal Global Sprint Day on January 30th - this coming Saturday - which is a day focused on bringing together volunteers to contribute work such as documentation, testing, code, and design to the Drupal project. The project needs improvements from a wide variety of skill sets, and it’s a great way for new folks to contribute to Drupal. The second is Drupal Global Training Day, a free Drupal 8 training for new community members. We’re thrilled to be involved with both!

Drupal Global Sprint

We’re hosting the Portland sprint at our office. Bring your projects and come code with us! If you've wanted to contribute to Drupal 8, but don't know how to begin, we’re happy to help you get started. New contributors are encouraged to attend, as we will be providing sprint training and new contributor onboarding, so don't worry if you've never contributed to Drupal before. The sprint starts at 9:00 am and goes until 5:00 pm. Programming help, snacks, coffee, tables, and wifi will all be provided by ThinkShout.

Drupal 8 Training

February 6th is the Drupal Global Training Day. We will be leading the Portland training at the Drupal Association headquarters, and it's open to everyone. This free training is ideal for new community members and people who are new to Drupal – but PHP developers not familiar with Drupal should also find the training valuable. The training includes coffee and snacks. Participants need only bring a laptop. Everything you need to know to get started will be discussed in detail at the event. We’ll cover:

  • An introduction to CMS
  • File management and databases
  • Site building basics with content types, fields, and views
  • Installation of modules and themes
  • Deploying to your web host with Git
  • Introduction to Drupal 8 theming with Twig templates
  • Drupal 8 configuration management

These two global Drupal events offer something for Drupal folks of all skill levels, helping us to tap into Portland’s strong Drupal community. I hope you’ll join us for either (or both!) of these great events.

Issue 224

The Weekly Drop -

Issue 224 - January, 28th 2016 From Our Sponsor Deploy and manage your Drupal websites across any servers! Try Wodby for FREE!

Short list of features:
* Organize dev > stage > prod workflow with your own servers
* Connect your own git
* Spin up and deploy new instances of Drupal to any server or your local Vagrant in few clicks
* Auto and manual backups of every instance
* Team management with access control

DrupalCon Application Period Open for Grants and Scholarships to DrupalCon New Orleans DrupalCon New Orleans Registration Is Open! Get Your Ticket Today. Articles Should Drupal Add (Another) JS Framework Into Core? Not in the Name of UX.

Please, please read this post from Lewis Nyman about the JS framework for Drupal discussion. It's right on target and really pushes us to apply what we tell our clients to this discussion.

Get Issues You Care About Ready for Global Sprint Weekend

As usual, great tips from YesCT.

Ultimate Guide to Drupal 8: Everything You Need to Know Sponsored

Architected for developer productivity with support for object-oriented web development, PHP, Symfony, and more, Drupal 8 makes development easier than ever before. With 200+ new features and improvements, it’s the most advanced version of Drupal yet - read Acquia’s Ultimate Guide to Drupal 8 to get up to speed on all of the exciting changes.

Web Services 101

"In this 4-part series, Larry Garfield ... will discuss what you can do with Web services in Drupal 8. This includes capabilities that are in Drupal 8 core, and those that are in contributed modules."

Tutorials Per Environment Config in Drupal 8

As we are all learning how to work with Drupal 8 be sure to check out this great tip on managing your configuration from Dave Hall.

Composer Dependencies in Drupal Contrib

Tim Millwood discusses multiple ways to handle dependencies in Drupal 8 including the Composer Manager module.

Configuring CloudFlare with Drupal 8 to Protect the Pi Dramble

Jeff Geerling is doing some interesting things with Drupal 8 and this post is a cool byproduct.

Creating a Deployable Docker Image with Jenkins - Part 4 - ActiveLAMP Drupal 8, hook_form_alter()

A simple example of a form_alter in Drupal 8 from Jordan White.

Entity Reference Views Help Drupal Content Creators

Steve Burge highlights a contrib module that helps you make the most of related content with your views.

How to Create Powerful Container Paragraphs in Drupal 8

Ivan Zugec demonstrates one of my new favorite modules in Drupal 8. The Paragraphs module.

How to Subscribe Users to MailChimp Lists in a Drupal Custom Module

A good example of when to not use a contributed module.

How to Successfully Use Branching and Development Workflow Strategies Sponsored

As your software project expands, it’s important to ensure that you can still deploy code with confidence while multiple project contributors are working on many stories at the same time. Git and the branch-per-feature strategy make it easy to do this. Register for this webinar to learn how software development teams can use branch-per-feature to build release candidates that can be easily pushed into production or rebuilt as necessary, all while keeping your deployed code clean.

Manage Drupal 7 Configurations Using Features Built with Features Builder

Not sure how or why I haven't heard of or used Features Builder module before but I recommend this post from Jim Birch as in introduction.

Projects Commerce 2.0 Alpha2 Released

Keep in mind that these alphas are not ready for production but still, it's pretty great to see the progress so quickly.

Drupal 8 Module of the Week: BigPipe

"The BigPipe module speeds up page delivery times by sending unchanging parts of a page to the browser immediately while rendering and streaming other, dynamic parts as soon as they are ready."

Entity Relationships Graph

Gizra's Brice Lenfant introduces a new module that purports to help you visualize your data relationships on existing Drupal sites. Haven't tried this out yet but I plan to very very soon.

Releases editor_file 8.x-1.1 Metatag 7.x-1.11 Oauth 8.x-2.0 Services 7.x-3.13 user_expire 7.x-1.4 views_autocomplete_filters 8.x-1.0 Podcasts 152 What to Do About Drupal 6 End of Life on Feb 24th 2016 with David Snopek - Modules Unraveled Podcast Acquia U: "Jump in and Own It. Kickstart Your Career." - Meet Amy Parker - Acquia Podcast Acquia U: "Making the World a Better Place, One Drupalist at a Time." - with Amy Parker - Acquia Podcast The Secret Sauce Podcast, Ep. 01

A brand new podcast from Palantir.net.

News BigPipe in Drupal 8.1: Please Test!

You've likely heard of BigPipe. Even if you haven't there is a need to test it out since it's going into core in 8.1.

Coding Standards Proposals for Final Discussion

If you care about community code(and you should) be sure to check this out and add your 2 cents.

Attend a Sprint at One of the 40 Drupal Global Sprint Weekend Locations, January 30 and 31! Jobs List Your Job on Drupal Jobs

Wanna get the word out about your great Drupal job? Get your job in front of hundreds of Drupal job seekers every day at Jobs.Drupal.Org.

Featured Jobs Minnesota-based Junior Drupal Developer

Origin Eight Minneapolis/MN/US

Drupal Architect (Backend)

PDR4 Inc Chicago/IL/US

Drupal Quality Assurance Analyst

Mediacurrent Anywhere

Drupal Global Sprint Weekend @ TEN7 (Saturday only)

Twin Cities Drupal Group -

Start:  2016-01-30 10:00 - 16:00 America/Chicago Organizers:  Les Lim stpaultim Event type:  Sprint

Drupal Global Sprint Weekend 2016 is almost here! Here in the Twin Cities, we'll gather at TEN7 and join communities from all over the world to work on Drupal 8 improvements, updating contributed modules for Drupal 8, and other related projects.

Saturday, January 30, 2016 - 10 AM to 4 PM
718 Washington Ave N
Suite 301
Minneapolis, MN 55401

Free parking spots available behind building, on 2nd Ave: parking map

This event is for experienced sprinters and novices alike. Everyone is welcome; if you have built a site in Drupal, you can contribute. We will split into groups and work on Drupal core issues. Bring your laptop. For new folks: you can get a head start also by making an account on Drupal.org, getting some contribution tools, and developers can install git before coming and git clone Drupal 8 core.

Read more about Drupal Global Sprint Weekend here: https://groups.drupal.org/node/488988

drunken monkey: Great progress in the Search API D8 version

Planet Drupal -

The last two months finally saw rapid progress in the development of the Search API module's Drupal 8 version. Acquia generously agreed to fund all available time for both Joris Vercammen (borisson_) and me in December and January to work on this port and related modules (especially Facets).

What we did

With this backing, we were able to make a lot of head-way and got a lot of large blocking issues out of the way, among them a overhaul for the fields UI, some necessary major internal refactorings and most of the Views integration. All of this is now baked into the new Alpha 12 release, created today. Over the next couple of days, we will then also create releases for the other related modules with a working D8 version: Facets, Search API Solr Search, Search API attachments (Alpha 2) and maybe also Search API pages.
That way, we should be able to avoid a confusion of versions and conflicts for any users interested in trying out the current state of work of this module suite, or already starting to build a new site using them.
Going forth, we will also try to keep this system of creating a set of compatible releases for future Alpha versions.

As noted in the release notes, though, be careful when building sites already with this module version, as there will be no upgrade paths until Beta and some changes until then are still likely to break the storage structure (and would thus lead to loss of configuration, unless handled correctly). Also, this release (like all other non-stable releases for any module) will not be covered by Drupal's Security Team, so any discovered security vulnerabilities would be reported, worked on and fixed publicly.

That being said, though, one of the greatest improvements in the module's D8 version, at least under the hood, is it's vastly improved test coverage. That, along with Drupal.org's automated testing, enables us to be very confident in each new feature we add and each bug we fix, thus also improving the maintainability and speed of feature development in the future. And it hopefully makes it much less likely that any major bugs go unnoticed for long.
But there are also lots of improvements visible right on the surface: we carefully reviewed all major encountered problems and pitfalls with the module's D7 version and worked to make the new D8 version another large leap forward to support as many search use cases as possible, while still becoming much more user-friendly than the D7 version – probably one of the largest points of criticism overall.

Still to do

So, how does it look for the further path towards a stable D8 release for the Search API (and, subsequently, for its numerous add-on modules)?
Currently, there are no immediate plans for further funding, so while I will of course still work on the port whenever I can, the pace will necessarily slack down a bit again. I also neglected maintenance of my various D7 modules in the last months, so there's also a lot of catching-up to do there. (Incidentally, a great way to help this effort if you are not comfortable with D8 yet: just go into any of my modules' issue queues and try to answer support requests, reproduce or fix bugs, test patches, etc., there.)
However, while there are still a lot of beta blockers left, most of them are relatively minor compared to the ones we now resolved, so I think a first Beta release in March should be within reach. Then it will be a matter of determining the MVP for an initial stable release and working towards that – but I expect a much shorter period for Beta than it has been for Alpha, maybe only a month or two.

If you want to help with this in any way, please either ask around in the Search API IRC channel (#drupal-search-api on Freenode) or send me a message – or just jump into any issue and get cracking!

DrupalEasy: DrupalEasy is Proudly Sponsoring Florida DrupalCamp (again!)

Planet Drupal -

News item

Florida DrupalCamp is coming up on March 5th, and DrupalEasy is happy to be involved as a sponsor and organizer. This year's event will be better than ever, with three amazing featured speakers flying in from three different countries! Karen Stevenson, Morten DK, and Jesus Manuel Olivas will be presenting double-length sessions on the lastest Druapl 8-related topics.


read more

DrupalCon News: Meet the DrupalCon Asia Media Partners

Planet Drupal -

Media partners are an important part of any DrupalCon. They help us spread the word about the event to people who might not have heard of it otherwise, and get to attend (and report on) the events. Our media partners are critical to DrupalCon's success, so we'd like to say a big thank you to all of our partners for DrupalCon Asia.

roomify.us: Speeding up Behat tests for Drupal on the Travis environment

Planet Drupal -

Background Implementing continuous integration of behaviorally-driven tests is a fairly heavy-weight process. In order to run a comprehensive battery of test cases, it’s necessary to set up a complete testing environment for each commit. This involves things like:  downloading: a browser executable drush Drupal core  all dependent modules Behat itself Selenium installing Drupal instantiating an HTTP server Making this process as efficient as possible has many benefits, including preserving shared resources for public repos (or your money, for private repos!) and speeding up one’s entire development workflow. Below we will describe some of the tactics we employ to make testing on Travis faster.

Modules Unraveled: 153 Protecting Drupal 8 Sites From Spam Using Honeypot with Jeff Geerling - Modules Unraveled Podcast

Planet Drupal -

Published: Wed, 01/27/16Download this episodeHoneypot
  • What is the Honeypot module?
  • What prompted you to contribute the Honeypot module? Why was it originally created?
    Flocknote (two employers ago) user registration
    A bunch of my blogs / comments
  • What methods or techniques does honeypot use to detect bots?
    A literal ‘honeypot’
    Time delay
  • What types of foms can it protect?
  • What’s different about Honeypot vs. other spam prevention modules like CAPTCHA and Mollom?
    Avoid punishing the user (explain)
Drupal 8 and Future of Honeypot
  • How did the port of Honeypot to Drupal 8 go?
  • Have you started developing new sites in Drupal 8? And if so, how’s that going?
  • How have spammers adapted to tools like Honeypot, and how do you try to keep ahead of them?” “More spam getting through Honeypot lately” (https://www.drupal.org/node/2646380)
Community Issues
  • You’re also involved a bit in other open source communities for projects like Ansible. How does the Drupal community compare? What are some things you would like to see improved?
  • Is there anything you’ve done to make sure you can continue to maintain this open source project among many others both on drupal.org and github, and not get burned out?
Episode Links: Jeff Geerling on drupal.orgJeff Geerling on TwitterHoneypotAnsible for DevOpsDrupal VMTags: SpamDrupal 8planet-drupal

DrupalCon News: Submit a Session for DrupalCon New Orleans

Planet Drupal -

Think you’ve got Drupal or web smarts? We’re seeking mind-blowingly good sessions for DrupalCon New Orleans, and want to hear from you about what you know best.

We have a lot of opportunities to get your experience as part of the DrupalCon program and invite you to check out the multiple ways that you can share your knowledge and passion for Drupal after you look over our tips on how to get your proposal selected.

Sharing Breakpoints Between Drupal 8 and Sass

Lullabot -

Among the many great new features in Drupal 8 is the Breakpoint module. This module allows you to define sets of media queries that can be used in a Drupal site. The most notable place that Drupal core uses breakpoints is the Responsive Image module.

To add and configure breakpoints, you create a file named *theme-name*.breakpoints.yml in the root directory of your theme, replacing *theme-name* with the theme’s machine name. Modules can also have *module-name*.breakpoints.yml configuration files at their root. In this file you define each breakpoint by these properties:

  • label - the human readable name of the breakpoint
  • mediaQuery - a valid @media query
  • weight - where the breakpoint is ordered in relation to other breakpoints: the breakpoint targeting the smallest viewport size should have a smaller weight, and larger breakpoints should have larger weight values
  • multiplier - the ratio between the physical pixel size of the active device and the device-independent pixel size

Exposing all this information to Drupal from a single file is great. But having this file creates a problem. The breakpoints defined here are not exposed to the Sass code used to style our site.

A solution

One best practice in software development is avoiding repetition whenever possible, often called keeping things DRY (Don’t Repeat Yourself). To apply the DRY method to the breakpoints.yml file and Sass, I wrote drupal-sass-breakpoints. This is an Eyeglass module that allows importing breakpoints from our theme’s breakpoints.yml into our Sass code.

In this article we are going to setup Drupal Sass Breakpoint in a minimal Drupal 8 theme. If you would like an introduction to creating a Drupal 8 theme, I recommend going through John Hannah’s article on Drupal 8 Theming Fundamentals. For this article's example (neelix), we are going to start with the following files:

├── scss │ └── style.scss ├── css ├── neelix.libraries.yml ├── neelix.info.yml ├── neelix.breakpoints.yml

This gives us a directory for our Sass, a directory for the compiled CSS, a file to declare a library for our CSS, an *.info.yml file, and our breakpoints.yml file. Inside the neelix.breakpoints.yml file add the following:

neelix.small: label: small mediaQuery: '' weight: 0 multipliers: - 1x neelix.medium: label: medium mediaQuery: 'screen and (min-width: 560px)' weight: 1 multipliers: - 1x neelix.wide: label: wide mediaQuery: 'screen and (min-width: 600px)' weight: 2 multipliers: - 1x neelix.xwide: label: xwide mediaQuery: 'screen and (min-width: 860px)' weight: 2 multipliers: - 1x

Now that we have a starting point for the new theme and some breakpoints in place, we need to install drupal-sass-breakpoints. For the example here, we are going to use Grunt to compile Sass. But It is important to mention that drupal-sass-breakpoints can work with Gulp or any other task runner that supports Eyeglass modules. To get started with Grunt, we first need to set up dependencies. This can be done by defining the dependencies in a file named package.json in the root directory of the neelix theme:

{ "devDependencies": { "breakpoint-sass": "^2.6.1", "drupal-sass-breakpoints": "^1.0.1", "eyeglass": ^"0.7.1", "grunt": "^0.4.5", "grunt-contrib-watch": "^0.6.1", "grunt-sass": "^1.0.0" } }

Then run npm install this from the command line while in the theme’s root directory.

This installs all the necessary dependencies we need, which were defined in package.json. Next, we need to define Grunt tasks. Do so by adding the following in a Gruntfile.js file in the root directory of the theme:

'use strict'; var eyeglass = require("eyeglass"); module.exports = function(grunt) { grunt.initConfig({ watch: { sass: { files: ['scss/*.{scss,sass}', 'Gruntfile.js', 'neelix.breakpoints.yml'], tasks: ['sass:dist'] }, }, sass: { options: require("eyeglass").decorate({ outputStyle: 'expanded' }), dist: { files: { 'css/style.css': 'scss/style.scss' } } } }); grunt.registerTask('default', ['sass:dist', 'watch']); grunt.loadNpmTasks('grunt-sass'); grunt.loadNpmTasks('grunt-contrib-watch'); };

This creates all that we need to compile Sass with Eyeglass. Now we can set up a test case to our scss/style.scss file by adding the following:

@import "drupal-sass-breakpoints"; body { @include media('medium') { content: "Styles that apply to our 'medium' breakpoint"; } }

In the above example we are using the media() mixin. This is a mixin added by drupal-sass-breakpoints. The argument we pass to it is the label for the media query we are targeting ( medium). Now run this from the command line in the root directory of our theme to compile Sass:


Now check out the compiled results inside css/style.css:

@media (min-width: 560px) { body { content: "Styles that apply to our 'medium' breakpoint"; } }

That is it! We now have Sass importing the media queries from our theme’s breakpoints.yml file.

What about srcset and sizes?

If you find you're overwhelmed by the number of breakpoints in your theme, remember that there are many instances where you only need to use srcset for responsive image styles. The srcset attribute is particulary useful when used in conjunction with the sizes attribute. I recommend this article on CSS-Tricks which outlines the scenarios which srcset and sizes are best for. In these cases, it may not be necessary to define all of our breakpoints in the .breakpoints.yml file.


Do have any feature requests or suggestions for improving drupal-sass-breakpoints? Feel free to contribute on GitHub.

You can find a fully working example of this article here. Happy styling!

I Fix Drupal: I Have Enabled Page Caching But No Pages Are Getting Cached. Why?

Planet Drupal -

Recently we received a call for help. The client had produced a new website that was great to look at, packed with fresh content and ready to launch. There was just one problem, performance. Some pages, in particular those driven by Views that were returning a large amount of data, were taking way too long to load. Interestingly the client had found that enabling page caching was not helping, yet enabling Views caching did help, a lot. This observation led us to believe that something was telling Drupal that it should not cache pages. So over an IRC session we asked the client to search their...

DrupalCon News: Announcing the DrupalCon Asia Developer Contest

Planet Drupal -

Vroom vroom! Love Adventure? Love Drupal? Want to win a Royal Enfield Classic motorcycle? You're in luck!

The DrupalCon Asia Developer Contest is being sponsored by the great folks over at Azri Solutions and they've come up with one of the coolest developer contests we've heard of thus far. The challenge, should you choose to accept it, is this: create a beautiful, interactive visualization of the data found at https://www.drupal.org/drupalorg/api, and submit it via github no later than 11:59 PM IST on Thursday, February 18.


Subscribe to Cruiskeen Consulting LLC aggregator