zuLIVE

zuLive is home to musings from the zuCrew, photos, and generally anything that interests us. Don’t expect anything too polished, this is where we let it all out.

Caching in Drupal 8

By on

Drupal 8 has evolved in many ways over its predecessor. Some of the prominent features are the inclusion of the widely used views module into core, configuration management, and an easy to use translation service. However, today we are going to dive into one of the other major updates of Drupal 8 that provides a huge boost to performance and perceived performance: the cache layer.

Caching in Drupal 8 has received a much needed overhaul. It has become highly customizable and dynamic, and now has the ability to cache individual blocks or items on a page. This means that we can control exactly when a block on a page has its cache cleared instead of clearing the entire page cache.

Diving Deeper into Caching

There are three main components to the cache layer in Drupal 8:

  • Cache tags
...
Read more

DrupalCon, Still Staying for the Community

By on

With another DrupalCon behind us, and all caught up from our week away from home, we’ve been taking some time to look back on the experience. The biggest takeaway from the conference for me still remains the wonderful community which has formed around Drupal as an open source project. The common Drupal saying, “come for the code, stay for the community” holds as true as ever.

The Community Experience

https://www.flickr.com/photos/142503742@N05/26873784761/in/photostream/

Anyone who has ever attended a convention or conference on a topic they are interested in knows that feeling - when you walk through the convention hall doors and you are suddenly surrounded by 3000 or more people who share your interest and are excited to talk about it. It’s an amazing atmosphere, isn’t it? I still

...
Read more

Migrating to Drupal 8 Part 3: Lessons

By on

Read part 1

Read part 2

In part two of our series we dove into Drupal 8’s templating system. We looked at how Twig functions, and how we can process our output in different ways. We also looked at how to debug and refine the data that Drupal is giving us. In part three we’ll talk through some things we learned while theming our first few Drupal 8 sites, using regions, manipulating our data within Twig, and controlling the output.

Outputting Regional Content

In most templates, the content can be directly output using the `{{ content }}` variable. Depending on the template, sometimes that has to be accessed through the `item` variable, using `{% for item in items %} {{ item.content }} {% endfor %}`. However, if you’re within a region template, you have to access individual blocks using

...
Read more

Migrating to Drupal 8 Part 2: Template Central

By on

Read part 1

In our last post, we started our new Drupal 8 site by building out our new theme. We set up the file structure and created the necessary files that allows us to enable our theme and begin building. In part two, we’re going to dive into the templating system and show you how to start coding with Twig.

In the theme we built in the last post, we defined our base class to be core’s stable theme. Stable is actually the default ‘base theme,’ however it’s worth choosing a base theme directly so that you’re never just using core directly. We can then use stable’s templates as a starting point for our own theme. Head into stable’s directory in `/core/themes/stable` and copy the `templates` folder into the theme’s folder. This will give us a foundation to start modifying and updating

...
Read more

Migrating to Drupal 8 Part 1: Embracing Change

By on

When we made the move to Drupal 8, we knew we had to start with a great foundation. Drupal 8 introduces a brand new theming system, something radically different than what was used in Drupal 7. Instead of using PHP templates, Drupal 8 uses the Twig markup language. It’s a welcome and much needed shift that will not only cater to front-end specialists, but users who are not programmers at all.

What we’re going to do in this three-part series is take a run through the setup and configuration of our base Drupal 8 theme, move into Twig and how it works, and finally we’ll talk about some things that we’ve learned after using Twig and Drupal 8 for a few months.

Defining Our Theme

The first thing we need to do is create a new folder for our theme, and define ourselves an `.info.yml` file

...
Read more