Drupal Planet

Subscribe to Drupal Planet feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 1 day 14 hours ago

DrupalEasy: DrupalEasy Podcast 195 - Reservoir

July 11, 2017 - 11:24pm

Direct .mp3 file download.

Ted Bowman and Mike Anello take some time (less than an hour!) to talk about Reservoir, a new Drupal 8 distribution focused on decoupling.

Interview DrupalEasy News Sponsors Upcoming Events Follow us on Twitter Subscribe

Subscribe to our podcast on iTunes, Google Play or Miro. Listen to our podcast on Stitcher.

If you'd like to leave us a voicemail, call 321-396-2340. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or corrections. If you'd rather just send us an email, please use our contact page.

Categories: Blogs

Enzolutions: How I Got My First Million…

July 11, 2017 - 9:00pm

Sadly, this is not about how I made my first million dollars, but rather a short story about how a project, I poured my heart soul and time into, got to 1 million downloads and helped thousands of people, all over the world, learn and build Drupal applications.

Most of the time, we ask ourselves what our purpose in life is, we feel the need to create something new while trying to chase after the infamous concept of ‘making an impact’ through innovation, often forgetting that we can achieve the same impact faster and better through collaboration and community driven initiatives.

My personal experience with the Drupal Console can be summarized in two words: Collaborator and Location.

Collaborator

Often times being a good collaborator is as impactful as being an innovator. I didn’t come up with the Drupal Console, but I saw the potential to make an impact from very early on. So I joined the team to learn and contribute my two cents. Despite the high pressure to come up with a high quality technology solution, you always felt the satisfaction of contributing to something bigger than yourself. This solution was going to help a community, and you could feel it in every line of code, conversation, and fix.

Location

With the focus and spotlights aimed at Silicon Valley and all the other major tech hubs, developers located outside feel alienated and look at location as a barrier to make technological breakthroughs. Sure, being located in these technology hubs can facilitate a lot of things, and the concentration of talent is a boost. However, personally the Drupal Console project eliminated that mental barrier. Creating and leading the project from Latin America proved that your location does not determine the quality of the job; we live in the same world, same internet and most importantly, opportunities to innovate and make an impact are open to everybody.

Today I look back and I’m happy with all the time and effort I poured into the Drupal Console. I take solace in the fact that so many people's lives are easier because they chose to use the Drupal Console.

Categories: Blogs

Glassdimly tech Blog: Remove Extra Metatags on Node Form, Drupal 8

July 11, 2017 - 7:10pm

Personally, I feel overwhelmed looking at the ocean of metatags presented on the node edit page when the metatag module is installed.

How much more overwhelmed would a regular ol' user feel?

I created a small modules to hide the extra form elements from the metatag module:

metatag_limit.module:

Categories: Blogs

Flocon de toile | Freelance Drupal: Inserting attachments into a body with Drupal 8

July 11, 2017 - 6:50pm

Drupal 8 natively allows to insert images within a body field, of course if the format text used allows this functionality. But can we do the same and easily insert documents, attachments, within a body text ? We have many solutions with Drupal 8 to associate documents with content.

Categories: Blogs

Drupal Association blog: How you can help during our membership campaign

July 11, 2017 - 5:47pm

Join in the fun during the Drupal Association membership campaign happening now through August 4. We're providing personalized certificates of membership to individual and organization members who join or renew during the campaign and we need your help spreading the word.

The campaign has two goals: help us deliver 500 certificates and raise $18,250 during July 10-August 4. By sharing and encouraging Drupal users and people in the community to join us, you'll help us meet these goals. If we are told by 5 or more members that you referred them to us during this campaign, we'll thank you on social media.

Grab words and graphics from this post and share away. If you are a member who would like your own certificate let us know and we'll send one your way. Post your selfie or hang your certificate on the wall. Thanks for sharing!

Social

Share why you are a member.

Share

Tweet

Graphics

Use these with https://www.drupal.org/association/campaign/certificate-2017


300 x 250px


440 x 220px (good for Twitter)


300 x 140px

Thank you for supporting the Drupal Association and for being part of our community.

File attachments:  mem_campaign_2017_q3_300x140.jpg mem_campaign_2017_q3_300x250.jpg mem_campaign_2017_q3_twitter_1.jpg
Categories: Blogs

Ben's SEO Blog: Lessons Learned as a DrupalCon Presenter

July 11, 2017 - 1:57pm

DrupalCon Baltimore was my 14th DrupalCon and it was a very interesting and eye-opening experience. The Drupal community is maturing just as Drupal as a content management system is maturing. I saw a lot of the same people that I’ve seen for years and I met a lot of new people, too. Though I haven’t seen the actual numbers, I felt like it was a bit smaller than last year. It could be that the layout of the Baltimore Convention Center is more compact than previous venues making it harder to gauge. Still, I had hoped to see continued growth of the community and Drupal as a whole so it was a bit disappointing.

In addition to walking around the tradeshow and attending some great sessions, I presented a two-hour training session on Drupal 8 SEO. The purpose of this session was to teach marketing people how to achieve SEO results with minimal need for developer help. Based on this, I came away with these lessons learned from DrupalCon 2017.

1.     The Drupal community is growing with marketers.

The marketing vibe was strong at DrupalCon last month. Since the first DrupalCon that I attended, I’ve seen it move from a group of developers wanting to build and support an exciting, new open source CMS, to a strong presence of marketing people who are looking for ways to maximize their website lead generation efforts. Websites are an important part of any marketing strategy and Drupal 8 supports marketing efforts better than any previous version.

And that feels great! While I’m a pro in a very particular niche in marketing, I have been pounding the “Drupal for marketers” drum for 12 years in this community. Often alone but more often with a few great people like Amy Cham, Kenna Poulos, and Danita Bowman. The Drupal agencies are finally getting the message, too.

While Drupalcon is still very much about developers, it’s maturing into a marketing powerhouse and it’s great to finally see it!

2.     There is a need for more SEO education in the Drupal community.

The growth of Drupal 8 as a viable platform for marketing has meant that people are more and more interested in SEO. In my Drupal 8 SEO session, I found a wide range of Drupal knowledge and skills. For example, some people were still installing modules manually. (Dirty secret: so do I sometimes.) One session reviewer said, “I am a marketer just starting Drupal and have a good grasp on SEO, but that said, I was too busy installing modules and could not keep up.” For others, the pace was just right: “This was by far my favorite session at DrupalCon. Ben had the talk set up perfectly and walked us through helpful steps that we needed to take for SEO.” In spite of the skills gap, 15 out of 15 attendees said that they learned something in this session.

People are looking for more Drupal 8 SEO education. Said one reviewer, “This topic area is huge, so even in a two-hour seminar, there was well more than could be covered.” Another wrote, “Grateful that this was a hands-on workshop, wish there were more of these.” The new hands-on session format was a big hit. I was thrilled that one attendee said, “Worth the price of the admission for the whole conference!”

3.     The Drupal community will survive and thrive.

If you are familiar with the undercurrents going on in the Drupal community, you may question its long-term health. Families fight. The Drupal community is a big family--so fighting is natural. But families also overcome differences and continue to live and work together. While there have been a lot of negative online communications, at DrupalCon, people were more interested in solving the problems and focusing on the Drupal product. Discussions of Drupal governance is a good thing. It enables conversations on how this big, open system can be better than ever. My time at DrupalCon has convinced me that this Drupal community will solve the existing problems and thrive as it works together to provide a cutting-edge product for the future.

4.     The Baltimore Raven comes from Edgar Allan Poe.

So it’s not related to Drupal, but I never made this connection until I visited Poe’s grave and memorial. The name of the NFL football franchise, the Baltimore Ravens, comes from one of Poe’s most famous poems, “The Raven,”. Well, duh, says all of the people from Baltimore. The rest of us are just getting it. In fact, with a little research, I found out that the team’s three mascots are named Edgar, Allan, and Poe.

Alright, Baltimore! I’m all for using literary allusion in pop culture. It makes me like the Ravens that much more. Still a Cowboys fan, tho.

Drupal 8 SEO fills an important need in the community.

When Drupal 8 came out with so many great changes for SEO, I recognized a need for a new informational book. While I wrote Drupal 6 Search Engine Optimization several years ago, Drupal 8 really needed its own new topics. That’s where Drupal 8 SEO comes in. This book provides detailed instructions that marketers can use to set up SEO for their Drupal 8 website.

Session attendees walked out with a free electronic copy of Drupal 8 SEO. But you can get your own printed or electronic copy. Click here for more information.

Drupal Marketing is Hot and so is Drupal 8 SEOdrupal 8, drupal 8 seo book, Planet Drupal
Categories: Blogs

Web Wash: How to Create Forms using Webform and Contact in Drupal 8

July 11, 2017 - 1:30pm
The ability to create a form quickly and easily is a vital piece of functionality in any content management system. A content editor needs the capacity to create a form and add or remove fields. The days of asking a developer to create a custom form are long gone. An editor should be able to spin up a form for whatever they need. Luckily Drupal 8 has two good options for building forms: Contact and Webform.
Categories: Blogs

Drupal Console: Drupal Console Hits 1 Million Downloads!

July 11, 2017 - 12:12pm
Isn’t it amazing how our crazy passion for all things Drupal formed this community? How a simple conversation between @jmolivas, @dmouse and @crell spiraled into an amazing community project?. What started as an idea and a learning exercise has now transformed into a community initiative beyond our wildest dreams. With 255 global contributors and 6366 commits the Drupal Console project has definitely etched a spot in the great history of Drupal. Now, we’re talking over 1 Million downloads!!
Categories: Blogs

Zivtech: Getting Started with React, Drupal 8, and JsonAPI

July 11, 2017 - 6:00am

You don't need to go fully 'headless' to use React for parts of your Drupal site. In this tutorial, we'll use the Drupal 8 JsonAPI module to communicate between a React component and the Drupal framework.  

As a simple example, we'll build a 'Favorite' feature, which allows users to favorite (or bookmark) nodes. This type of feature is typically handled on Drupal sites with Flag module, but let's say (hypothetically...) that you have come down with Drupal-module-itis. You're sick of messing around with modules and trying to customize them to do exactly what you want while also dealing with their bugs and updates. You're going custom today.

Follow along with my Github repo.

Configure a custom Drupal module

First thing's first: data storage. How will we store which nodes a user has favorited? A nice and easy method is to add an entity reference field to the user entity. We can just hide this field on the 'Manage Form Display' and/or 'Manage Display' settings since we'll be creating a custom user interface for favoriting.

When you install the Favorite module in the repo, it will add the field 'field_favorites' for you to the user entity: see the config/install directory.

Next up: define the part of the page that React will replace. Typically, you will replace an HTML element defined by an id with a React component. If this is your first time hearing this, you should do some basic React tutorials. I started with one on Code Academy

Read more
Categories: Blogs

lakshminp.com: User authentication in Drupal 8 - passwords

July 11, 2017 - 5:09am

We saw how general authentication works with Drupal 8 in the previous post. We shall see how the actual authentication happens when user logs in. It all begins with a humble login route in user.services.yml of the user module.

Categories: Blogs

Agiledrop.com Blog: AGILEDROP: Top Drupal Blogs from June

July 11, 2017 - 4:37am
Because of the summer, many people were or are going to the holidays. But that doesn't mean that they rested. In fact, there were many high-quality blog post about Drupal in the past month, so let's take a lot at the top Drupal Blogs from June. We'll start with Sasa Nikolic and his Nested Paragraphs Translation. In this blog post the author warns that translating content in Drupal isn't a straightforward task and has many obstacles. So, he recapped the basics first and then dug deeper in nested paragraph translation. Our second choice is a fascinating story of how Jack switched his career… READ MORE
Categories: Blogs

Hook 42: Inclusivity Through Accessibility

July 10, 2017 - 6:40pm

Last month Hook 42 had the pleasure of hosting Mike Gifford from Open Concept for conversation, collaboration, and thought leadership surrounding Accessibility and Drupal.

Why the push for accessibility on the web? Roughly 20% of the population has some form of disability. 

There is quite a diversity of abilities. Sight and hearing are the ones people tend to give the most thought to, but there are cognitive, learning, neurological, physical, and speech abilities that can all change how a user engages with the web. As able-bodied people age, they may experience some of the same challenges as those born with disabilities: failing eyesight, diminished hearing, carpal tunnel, and loss of mobility or dexterity.

It's the law.  

Under Section 508, government funded agencies must give disabled employees and members of the public access to information that is comparable to access available to others. American with Disabilities Act (ADA) “prohibits discrimination and ensures equal opportunity for persons with disabilities in employment, State and local government services, public accommodations, commercial facilities, and transportation.”
"Currently, web developers are less expensive than lawyers." ~ Mike Gifford

But, more than anything, it's the right thing to do. Accessibility promotes inclusivity and diversity on the web.
 

Categories: Blogs

Drupal CMS Guides at Daymuse Studios: Drupal 8 Getting Started: Install, Composer, & Facebook Login

July 10, 2017 - 4:30pm

We'll walkthrough setting up your local development LAMP environment, installing Drupal 8, configuring Composer, and your first module: Simple FB Connect.

Categories: Blogs

Palantir: Why We're Standing Up for Net Neutrality

July 10, 2017 - 1:52pm
Why We're Standing Up for Net Neutrality brandt Mon, 07/10/2017 - 11:52 George DeMet Jul 12, 2017

Join us for a day of action urging the FCC and Congress to preserve Title II net neutrality protections. 

Stay connected with the latest news on web strategy, design, and development.

Sign up for our newsletter.

Most people who use the internet take for granted the ability to easily access content and services from a variety of different sources. We watch movies and TV shows on Netflix, Hulu, Amazon, and countless other streaming video services. We listen to music on Spotify, Apple Music, Pandora, and Tidal. We communicate with others using social media and messaging apps like Facebook, Twitter, Instagram, WhatsApp, and Snapchat. We get our news and analysis from hundreds of sites representing the full spectrum of political thought in the United States and beyond.

Being able to quickly and easily publish or consume content from nearly anywhere in the world is not just one of the key reasons for the rapid growth of the internet, but also one of its founding principles.

Today, however, that principle is under threat. The United States Federal Communications Commission (FCC) is considering rolling back net neutrality protections that ensure equal access to online content for broadband internet users. Without net neutrality, internet service providers would be able to offer preferred access to some content providers, and withhold it from others.

Some of these providers also own their media companies and have a business interest in making it easier for people to view and purchase their content than someone else’s. Because most people in the United States don’t have many options when it comes to broadband internet access, losing net neutrality protections means that many consumers may no longer be able to freely choose the online services that best meet their needs.

Think about it this way: imagine a world in which Cuisinart not only made great kitchen appliances, but they also owned your local electric company. And imagine that electric company decided that they were going to charge you more for the electricity used to power any appliances that you had that were made by KitchenAid or any other other non-Cuisinart brand. You would probably argue that that’s absurd, because there’s nothing inherently different about the electricity that’s used to power a KitchenAid toaster versus one made by Cuisinart.

But that’s precisely what the broadband internet service providers opposed to net neutrality want to be able to do: prioritize traffic from their preferred content providers, making it more difficult or costly to access others. In reality, there’s no inherent difference in the traffic that comes from one site versus another; they’re all ones and zeros. Whether you choose to watch a movie on Netflix, Hulu, or FilmStruck shouldn’t be the business of your internet service provider any more than the brand of toaster you use to toast bread in the morning should be the business of your electric utility.

At Palantir, we believe that helping others discover, create, and share knowledge can help strengthen humanity. Many of the websites and online experiences that we architect, design, and build convey information that enable people to make more informed choices and in some cases, even help save lives. It’s important to us that our work is accessible to everyone regardless of what internet service provider they’re using.

That’s why we’re proud to join forces with hundreds of other sites around the web this July 12th for a day of action urging the FCC and Congress to preserve Title II net neutrality protections. You can find out more and make your voice heard at www.battleforthenet.com. We hope you’ll stand alongside us to help keep the web a free and open place.

Stay connected with the latest news on web strategy, design, and development.

Sign up for our newsletter.
Categories: Blogs

Acquia Developer Center Blog: Making a Custom, Acquia-Hosted Site Affordable for Higher Ed

July 10, 2017 - 12:24pm

With budget cuts and rising expectations, higher education websites have become a challenging balancing act of function and affordability. Late in 2016, we set out to build a website solution that would leverage a CMS to create a repeatable, flexible website solution that meets current expectations in higher ed clients, and leaves room for them to make it their own -- without requiring custom development for each client. We also wanted to ensure that it could be deployed for under $50,000; put the work of managing and maintaining the site into the hands of the content team; and have a low-recurring cost to the client.

Tags: acquia drupal planet
Categories: Blogs

Mediacurrent: Drupal vs Sitecore, Part 1 of 2

July 10, 2017 - 12:17pm

Annually, the information technology research firm Gartner publishes its magic quadrant report comparing web content management systems (CMS) at the enterprise level. At this writing, the most recent report places Acquia/Drupal, Adobe Experience Manager (AEM), and Sitecore as the three leaders in the field, based on both their completeness of vision and their ability to execute on organizational requirements.

Categories: Blogs

Roman Agabekov: Setting up server for Drupal with Nginx and Php-fpm under Debian

July 10, 2017 - 10:24am
Setting up server for Drupal with Nginx and Php-fpm under Debian Submitted by admin on Mon, 07/10/2017 - 13:24

In the previous article Setting up Nginx on a Debian server as front-end for Apache of the series of articles for Drupal sysadmins we explained Nginx configs that allow it working through static queries while Apache serves dynamic content. This article offers a look at an alternative setup, where Php-fpm takes the place of Apache. The operating principle for our web server will be as follows:

Tags
Categories: Blogs

Xeno Media: Entity Reference Roundup

July 10, 2017 - 6:00am

Drupal's Entity reference fields are the magic sauce that allows site builders and developers to relate different types of content. Because the fields allows builders and administrators to reference different types of content (entities), it facilitates the building of complex data models and site architectures.

Like anything in Drupal, the community takes the core tools and builds additional functionality on top. Here is a slew of modules that extend or complement the Drupal 8 core reference field so you can do even more!

Entity Reference Revisions

This module is from the team that brought you the Paragraphs module. Adds an Entity Reference field type that has revision support. It's based on the core Entity Reference module but allows you to reference a specific revision of an entity.

Use case:

An entity is actually part of a parent entity (with an embedded entity form). When the parent entity is updated, the referenced entity is also updated, thus the previous revision of the parent entity should still be pointing to the previous version of the entity in order to fully support revision diff and rollback.

Entity Reference Override

An entity reference field paired with a text field. You can use this module to

  • Override the title if you are linking to the referenced entity.
  • Add an extra CSS class to the referenced entity.
  • Override the default display mode for the field on an entity-by-entity basis.

Use case:

Aggregate lists of referenced entities like related articles, but you want to override the name or appearance of individual items.

Entity references with text

Allows you to provide custom text along with one or more entity references.

Use case:

  • Add a referenced author, the word "and ”, and then another referenced author.
  • On another node, Add a referenced author, the words "with support from ”, and then another referenced author.
  • On another node, Add a referenced author, a comma ", ”, another referenced author, the word "and ”, and then another referenced author.
Entity Reference Display

This module adds a field type that allows you to select the display mode for entity reference fields. This allows an editor to select from different display modes such as Teaser, Full, or any you add.

It also includes a Selected display mode field formatter which renders the referenced entities with the selected display mode.

Use case:

Allowing the administrator to change the display of related articles from a grid display mode to a list display mode.

Entity Reference Views Select

This module allows you to change your Entity reference fields to be displayed as a select list, or checkboxes/radio buttons in administrative forms. It does this by allowing you to use Views as the reference method, where you can format the results giving the administrator a much better experience.

Use case:

Showing an icon or thumbnail in a selectable list when referencing a list, or a referenced image.

Entity Reference Tab / Accordion Formatter

This cool little module works on both Entity Reference and Entity Reference Revisions fields and provides a field formatter for displaying the referenced entity in jQuery Tabs or jQuery Accordion.

Use case:

Returning multivalue Paragraphs items in tabs or accordion format.

Views Entity Reference Filter

Provides a new admin friendly Views filter for configuring entity reference fields. It allows users to select the labels of the entities they want to filter on rather than manually entering the IDs.

Use case:

Providing a better admin experience.

Better Entity Reference Formatter

This module extends Drupal's default field formatter for entity reference fields in order to make it more flexible by introducing a new field formatter plugin. Along side the view mode option, you can also define the number of entities to return, or a specific entity, like the first, last, or offset them.

Use case:

Showing the first related product referenced from another product.

Entity Reference Validators

The plural in its name suggests more is coming, but currently this module adds a single validator for Entity Reference fields, the Circular reference validator. This prevents you from using the entity reference field to reference itself.

Use case:

Preventing an entity reference field on node 1 from linking to node 1.

Entity Reference Integrity

This interesting sounding module lists other entities that reference your entity.

It also includes a sub-module Entity Reference Integrity Enforce which will attempt to protect entities that are referenced by other entities, and not allowing its deletion.

Use case:

Protect the integrity of the site by protecting referenced content.

Entity Reference Quantity

This module extends the default entity reference field that includes a "Quantity" value in the field definition so you don't have to build a separate entity just to store two distinct fields.

It also includes autocomplete and dropdown field widgets that allow you to select which entity and add the quantity value.

Use case:

I'll use the example from this great blog on the module: A real world example might be a deck builder for a trading card game like Magic: The Gathering or the DragonBall Z TCG. We want to reference a card from a deck entity and put in the quantity at the same time.

Entity Reference Formatter

This module creates a generic field formatter for referenced entities which allows you to select the formatter based on the referenced entity in the display settings form.

Use case:

When referencing custom entities that don't have view-modes of their own, you would not need to write your own custom formatters

Permissions by field

This module extends the Entity Reference field that adds permissions along with the referenced entity. By adding this field, you can manage access to the entities referenced by this field and select permission level (none, view, update, delete).

Use case:

A lighter version of Organic Groups, or the Group modules.

Views Reference Field

In Drupal 8, Views are now entities! Drupal core's Entity Reference field is able to reference Views, however you can't actually reference the Views displays. This module extends core's entity reference module to add the display ID so that a View can be rendered in a field formatter.

Use case:

Adding a Views reference field to a Paragraphs bundle so you can have a view in and around other paragraph bundles. We implemented this technique in the Bootstrap Paragraphs module.

Dynamic Entity Reference

So cool! This awesome module adds the functionality to let you reference more than one entity type. It create a single field in which you can reference Users, Blocks, Nodes, Contact Forms, Taxonomy Terms, etc!

Use case:

Creating a "related” field, and allowing your administrators to select anything they want.

Entity Reference Drag & Drop

This module creates a Drag & Drop widget for the standard Entity reference fields. It provides you with a list of available entities on the left, and you can select them by dragging and dropping them to the list on the right.

Use case:

Providing a better admin experience.

Phew! Thanks for making it to the end! Do you have a favorite Entity Reference module that we missed? Let us know on Twitter at @xenophiles and @thejimbirch

Happy Drupaling!

Acknowledgements

Thanks to Mike Acklin for his help with this article, and to all the awesome module maintainers and contributors!

Photo by Bethany Legg on Unsplash

Categories: Blogs

Wim Leers: On simplicity & maintainability: CDN module for Drupal 8

July 9, 2017 - 3:02pm

The first release of the CDN module for Drupal was 9.5 years ago yesterday: cdn 5.x-1.0-beta1 was released on January 8, 2008!

Excitement

On January 27, 2008, the first RC followed, with boatloads of new features. Over the years, it was ported to Drupal 61, 7 and 8 and gained more features (I effectively added every single feature that was requested — I loved empowering the site builder). I did the same with my Hierarchical Select module.

I was a Computer Science student for the first half of those 9.5 years, and it was super exciting to see people actually use my code on hundreds, thousands and even tens of thousands of sites! In stark contrast with the assignments at university, where the results were graded, then discarded.

Frustration

Unfortunately this approach resulted in feature-rich modules, with complex UIs to configure them, and many, many bug reports and support requests, because they were so brittle and confusing. Rather than making the 80% case simple, I supported 99% of needed features, and made things confusing and complex for 100% of the users.


Main CDN module configuration UI in Drupal 7.


Learning

In my job in Acquia’s Office of the CTO, my job is effectively “make Drupal better & faster”.

In 2012–2013, it was improving the authoring experience by adding in-place editing and tightly integrating CKEditor. Then it shifted in 2014 and 2015 to “make Drupal 8 shippable”, first by working on the cache system, then on the render pipeline and finally on the intersection of both: Dynamic Page Cache and BigPipe. After Drupal 8 shipped at the end of 2015, the next thing became “improve Drupal 8’s REST APIs”, which grew into the API-First Initiative.

All this time (5 years already!), I’ve been helping to build Drupal itself (the system, the APIs, the infrastructure, the overarching architecture), and have seen the long-term consequences from both up close and afar: the concepts required to understand how it all works, the APIs to extend, override and plug in to. In that half decade, I’ve often cursed past commits, including my own!

That’s what led to:

  • my insistence that the dynamic_page_cache and big_pipe modules in Drupal 8 core do not have a UI, nor any configuration, and rely entirely on existing APIs and metadata to do their thing (with only a handful of bug reports in >18 months!)
  • my “Backwards Compatibility: Burden & Benefit” talk a few months ago
  • and of course this rewrite of the CDN module
CDN module in Drupal 8: radically simpler

I started porting the CDN module to Drupal 8 in March 2016 — a few months after the release of Drupal 8. It is much simpler to use (just look at the UI). It has less overhead (the UI is in a separate module, the altering of file URLs has far simpler logic). It has lower technical complexity (File Conveyor support was dropped, it no longer needs to detect HTTP vs HTTPS: it always uses protocol-relative URLs, less unnecessary configurability, the farfuture functionality no longer tries to generate file and no longer has extremely detailed configurability).

In other words: the CDN module in Drupal 8 is much simpler. And has much better test coverage too. (You can see this in the tarball size too: it’s about half of the Drupal 7 version of the module, despite significantly more test coverage!)


CDN UI module in Drupal 8.


all the fundamentals
  • the ability to use simple CDN mappings, including conditional ones depending on file extensions, auto-balancing, and complex combinations of all of the above
  • preconnecting (and DNS prefetching for older browsers)
  • a simple UI to set it up — in fact, much simpler than before!
changed/improved
  1. the CDN module now always uses protocol-relative URLs, which means there’s no more need to distinguish between HTTP and HTTPS, which simplifies a lot
  2. the UI is now a separate module
  3. the UI is optional: for power users there is a sensible configuration structure with strict config schema validation
  4. complete unit test coverage of the heart of the CDN module, thanks to D8’s improved architecture
  5. preconnecting (and DNS prefetching) using headers rather than tags in , which allows a much simpler/cleaner Symfony response subscriber
  6. tours instead of advanced help, which very often was ignored
  7. there is nothing to configure for the SEO (duplicate content prevention) feature anymore
  8. nor is there anything to configure for the Forever cacheable files feature anymore (named Far Future expiration in Drupal 7), and it’s a lot more robust
removed
  1. File Conveyor support
  2. separate HTTPS mapping (also mentioned above)
  3. all the exceptions (blacklist, whitelist, based on Drupal path, file path…) — all of them are a maintenance/debugging/cacheability nightmare
  4. configurability of SEO feature
  5. configurability of unique file identifiers for the Forever cacheable files feature
  6. testing mode

For very complex mappings, you must manipulate cdn.settings.yml — there’s inline documentation with examples there. Those who need the complex setups don’t mind reading three commented examples in a YAML file. This used to be configurable through the UI, but it also was possible to configure it “incorrectly”, resulting in broken sites — that’s no longer possible.

There’s comprehensive test coverage for everything in the critical path, and basic integration test coverage. Together, they ensure peace of mind, and uncover bugs in the next minor Drupal 8 release: BC breaks are detected early and automatically.

The results after 8 months: contributed module maintainer bliss

The first stable release of the CDN module for Drupal 8 was published on December 2, 2016. Today, I released the first patch release: cdn 8.x-3.1. The change log is tiny: a PHP notice fixed, two minor automated testing infrastructure problems fixed, and two new minor features added.

We can now compare the Drupal 7 and 8 versions of the CDN module:

In other words: maintaining this contributed module now requires pretty much zero effort!

Conclusion

For your own Drupal 8 modules, no matter if they’re contributed or custom, I recommend a few key rules:

  • Selective feature set.
  • Comprehensive unit test coverage for critical code paths (UnitTestCase)2 + basic integration test coverage (BrowserTestBase) maximizes confidence while minimizing time spent.
  • Don’t provide/build APIs (that includes hooks) unless you see a strong use case for it. Prefer coarse over granular APIs unless you’re absolutely certain.
  • Avoid configurability if possible. Otherwise, use config schemas to your advantage, provide a simple UI for the 80% use case. Leave the rest to contrib/custom modules.

This is more empowering for the Drupal site builder persona, because they can’t shoot themselves in the foot anymore. It’s no longer necessary to learn the complex edge cases in each contributed module’s domain, because they’re no longer exposed in the UI. In other words: domain complexities no longer leak into the UI.

At the same time, it hugely decreases the risk of burnout in module maintainers!

And of course: use the CDN module, it’s rock solid! :)

Related reading

Finally, read Amitai Burstein’s “OG8 Development Mindset”! He makes very similar observations, albeit about a much bigger contributed module (Organic Groups). Some of my favorite quotes:

  1. About edge cases & complexity:
Edge cases are no longer my concern. I mean, I’m making sure that edge cases can be done and the API will cater to it, but I won’t go too far and implement them. […] we’ve somewhat reduced the flexibility in order to reduce the complexity; but while doing so, made sure edge cases can still hook into the process.


2. About tests:

I think there is another hidden merit in tests. By taking the time to carefully go over your own code - and using it - you give yourself some pause to think about the necessity of your recently added code. Do you really need it? If you are not afraid of writing code and then throwing it out the window, and you are true to yourself, you can create a better, less complex, and polished module.


3. About feature set & UI:

One of the mistakes that I feel made in OG7 was exposing a lot of the advanced functionality in the UI. […] But these are all advanced use cases. When thinking about how to port them to OG8, I think found the perfect solution: we did’t port it.


  1. I also did my bachelor thesis about Drupal + CDN integration, which led to the Drupal 6 version of the module. ↩︎

  2. Unit tests in Drupal 8 are wonderful, they’re nigh impossible in Drupal 7. They finish running in seconds. ↩︎

Categories: Blogs

Nacho Digital: Drupal Picnic BsAs Argentina

July 9, 2017 - 12:12pm
With Buenos Aires Argentina user group we are organizing a meeting on Sat 22nd and Mon 24th of July

It's been a long time since our last camp was done on BsAs (2009) and thanks to the inspiration of Drupal Camp Chile we've been planning doing another for a while.

We finally put a day thanks to a visit from Enzo. We are calling it a "PicNic" and not a camp due to the extend it'll have, it will be two days:

  • On Saturday 22nd we'll have an sprint with mentoring
  • On Monday 24th there will be technical conferences

You can find more details on our event page.

Categories: Blogs

Pages