Planet Drupal

Syndicate content - aggregated feeds in category Planet Drupal
Updated: 8 hours 51 min ago

Matt Glaman: Creating better Drupal module release notes

Fri, 03/16/2018 - 16:00
Creating better Drupal module release notes mglaman Fri, 03/16/2018 - 10:00 Every software release needs to have release notes. End users need to be able to understand what it is that they are upgrading to and any associated risks, or risks mitigated by upgrading and receiving bug fixes. Across the board proprietary and open source software projects either hit or miss on delivering decent release notes. During MidCamp I decided to help fix that problem for projects.

Acquia Developer Center Blog: Experience Express in Chicago: Inclusion and Drupal 8 in the Spotlight at MidCamp

Fri, 03/16/2018 - 13:59

Every time I leave the Windy City, I feel something pulling me back. This time, it wasn't the gusts that whip around the skyscrapers towering over Lake Shore Drive. Instead, it was the renewed excitement I could feel in the air on the heels of Wednesday's release of Drupal 8.5, and the mood at MidCamp, held at the Lincoln Park campus of DePaul University, was celebratory and animated.

Tags: acquia drupal planet Blog: AGILEDROP: Delivering value not just the solution

Fri, 03/16/2018 - 11:16
When you are in the business of selling services or expertise, you will face competition. Nowadays a global competition where (y)our competitors take on various shapes and sizes. So when an organisation goes on the market looking for certain services, this organisation probably has a predefined set of requirements for the provider. These can change over time, but some basics are set at the beginning.    What is the client actually buying? There are at least three factors that influence the buying process at the organisation which needs a new website. The first one is the organisation… READ MORE

Droptica: Droptica: Yoast Real Time SEO plugin

Fri, 03/16/2018 - 08:30
Yoast SEO is a module that has everything you need to make your content visible to search engines. The plug-in that took the WordPress community by storm is slowly getting more and more traction in the Drupal community as well. What exactly is SEO? SEO is an acronym of Search Engine Optimisation, which basically means optimising websites for a search engine, which in reality translates into getting your website as high as possible in search results, and thus getting more and more people to visit the website.

Paul Johnson: Isn't it time your client created an organisation account on D.O?

Thu, 03/15/2018 - 18:08

For organisations making a technology selection is rarely a trivial decision. Gone are the days where one stakeholder has this level of authority. More often than not a rigorous evaluation process is undertaken.

One early factor which can sway an organisation to evaluate Drupal as a candidate technology may be that respected organisations or industry peers have already achieved success with the platform. Whilst case studies are an excellent path to evidence this, they consume considerable time to author or may be impossible due to commercial sensitivity or privacy constraints.

Some time back I persuaded Greater London Authority (GLA) to create what is known as an Organisation Account on In doing so GLA subtly signalled to peers that Drupal was of notable interest to government and public sector. In a small way they were contributing back, and that's how I persuaded them to do so. The more organisations we can convince to register on, the greater net benefit for us all.

In his recent blog post "My three mistakes in regards to the Contribute module and Drupal" Jacob Rockowitz expresses regret about not talking about supporting the Drupal community with his clients early enough. Indeed for him it was many years before it happened.

"We need to collectively start asking our clients to be contributing members of the community."

I wholeheartedly agree with this sentiment and encourage you to compel your clients to do so. There are 2 simple steps ideally your customers must take.

  1. Create an organisation account: Add an organisation (you need to already have a confirmed user account to do so)
  2. Support the Drupal Association: Join here. Starting at just $200 or €160 it is hard to justify why any organisation benefitting from the huge value Drupal presents wouldn't want to subscribe. Imagine how well funded the DA would be if we all got half our clients to do so.

Boosting the number of organisations registered on that are end user brings many benefits. I do hope that, consistent with the spirit of open source and Drupal that you consider encouraging your customers to start on this contribution path. Perhaps creating an account will start them on a journey to greater engagement with the project too?

OSTraining: How to Change the Default Text Strings in Drupal 8

Thu, 03/15/2018 - 15:55

Drupal 8.5 is available now, and we covered some of the key new features.

However, some smaller, but very useful features arrived with 8.5. For example, it's now much easier to translate the default text.

A few years ago, we explained how to translate the default text in Drupal 7. The process was painful! Let me show you how much easier it is in Drupal 8.5.

Matt Glaman: Another AWESOME MidCamp!

Thu, 03/15/2018 - 10:00
Another AWESOME MidCamp! mglaman Thu, 03/15/2018 - 04:00

 MidCamp 2018 has come and gone. This was the regional Drupal camp's fifth year, and my fourth time attending (missed year one ). The amazing group of organizers behind the conference makes it one of my favorites. MidCamp is a human first event -- everything is about accessibility.

PreviousNext: Bare Templates: Removing Unnecessary Markup in Twig files

Thu, 03/15/2018 - 09:48

In most of the projects we build, the HTML markup provided by core just gets in the way. There is way too many wrapper divs. This can cause issues when trying to create lean markup that matches what is produced in a generated styleguide.

In this post, I'll introduce you to the concept of bare templates, and how you can remove unnecessary markup from your Twig templates.

by Pasan Gamage / 15 March 2018

In Drupal 8, a couple of themes are shipped by default to serve a common set of end user needs.

Among them are:

  • Bartik: A flexible, recolourable theme with many regions and a responsive, mobile-first layout.
  • Seven: The default administration theme for Drupal 8 was designed with clean lines, simple blocks, and sans-serif font to emphasise the tools and tasks at hand.
  • Stark: An intentionally plain theme with almost no styling to demonstrate default Drupal’s HTML and CSS.
  • Stable: A base theme. Stable theme aggregates all of the CSS from Drupal core into a single theme. Theme markup and CSS will not change so any sub-theme of Stable will know that updates will not cause it to break.
  • Classy: A sub-theme of Stable. Theme designed with lot of markups for beginner themers.

But in an actual business scenario the requirements and expectations of a client towards the look and feel of the website is far more distinct than the themes that are provided in Drupal core.

When building your site based upon one of these themes it is common to face issues with templating during the frontend implementation phase. Quite often the default suggested templates for blocks, nodes, fields etc. contain HTML wrapper divs that your style guide doesn’t require.

Usually the most effective way is to build themes using the Stable theme. In Stable, the theme markup and CSS are fixed between any new Drupal core releases making any sub-theme to less likely to break on a Drupal core update. It also uses the verbose field template support for debugging.

Which leads us to use bare templates.

What is a bare template?

A bare template is a twig file that has the minimum number of HTML wrappers around actual content. It could be simple as a file with a single content output like {{}}

Compared to th traditional approach, bare templates provide benefits such as:

  • Ease of maintenance: With minimum markup the complexity of the template is much lesser making it easy to maintain.
  • Cleaner Markup: The markup will only have the essential or relevant elements where as in traditional approach there are a lot of wrappers leading to a complex output.
  • Smaller page size: Less markup means less page size.
  • Avoids the need for markup removal modules: With bare markup method we do not need to use modules like fences or display suite. Which means less modules to maintain and less configuration to worry about.
Our Example

We need to create a bare template for type field and suggest it to render only field name and field_image of my_vocabulary taxonomy entity. This will avoid Drupal from suggesting this bare template for other fields belonging to different entities.

Field template

Let's have a look at field template which resides at app/core/themes/stable/templates/field/field.html.twig

{% if label_hidden %} {% if multiple %} {% for item in items %} {{ item.content }} {% endfor %} {% else %} {% for item in items %} {{ item.content }} {% endfor %} {% endif %} {% else %} {{ label }} {% if multiple %} {% endif %} {% for item in items %} {{ item.content }} {% endfor %} {% if multiple %} {% endif %} {% endif %}

As you see there is quite a lot of div wrappers used in the default template which makes it difficult to style components. If you are looking for simple output, this code is overkill. There is however, a lot of valuable information is provided in the comments of field.html.twig which we can use.

{# /** * @file * Theme override for a field. * * To override output, copy the "field.html.twig" from the templates directory * to your theme's directory and customize it, just like customizing other * Drupal templates such as page.html.twig or node.html.twig. * * Instead of overriding the theming for all fields, you can also just override * theming for a subset of fields using * @link themeable Theme hook suggestions. @endlink For example, * here are some theme hook suggestions that can be used for a field_foo field * on an article node type: * - field--node--field-foo--article.html.twig * - field--node--field-foo.html.twig * - field--node--article.html.twig * - field--field-foo.html.twig * - field--text-with-summary.html.twig * - field.html.twig * * Available variables: * - attributes: HTML attributes for the containing element. * - label_hidden: Whether to show the field label or not. * - title_attributes: HTML attributes for the title. * - label: The label for the field. * - multiple: TRUE if a field can contain multiple items. * - items: List of all the field items. Each item contains: * - attributes: List of HTML attributes for each item. * - content: The field item's content. * - entity_type: The entity type to which the field belongs. * - field_name: The name of the field. * - field_type: The type of the field. * - label_display: The display settings for the label. * * @see template_preprocess_field() */ #} The code Building the hook.

We will be using hook_theme_suggestions_HOOK_alter() to suggest the two fields to use our bare template when rendering.

It is important to note that only these two fields will be using the bare template and the other fields (if any) in that entity will use the default field.html.twig template to render.

my_custom_theme_theme_suggestions_field_alter (&$hooks, $vars){     // Get the element names passed on when a page is rendered.     $name = $vars['element']['#field_name'];     // Build the string layout for the fields.     // :::     $bare_hooks = [         'taxonomy_term:my_vocabulary:teaser:name',         'taxonomy_term:my_vocabulary:teaser:field_logo',     ];     // Build the actual var structure from second parameter     $hook = implode(':', [         $vars['element']['#entity_type'],         $vars['element']['#bundle'],         $vars['element']['#view_mode'],         $vars['element']['#field_name'],     ]);     // Check if the strings match and assign the bare template.     if (in_array($hook, $bare_hooks, TRUE)) {         $hooks[] = 'field__no_markup';     } }

The hook key field__no_markup mentioned in the code corresponds to a twig file which must reside under app/themes/custom/my_theme/templates/field/field--no-markup.html.twig

Debugging Output

In order to see how this is working, we can fire up PHPStorm and walk the code in the debugger.

As you can see in the output below, the implode() creates the actual var structure from the second parameter. We will use this to compare with the $bare_hooks array we created  fields specific to content entity types that we need to assign the bare template.

Note: As best practise make sure you pass a third argument TRUE to in_array(). Which will validate the data type as well.


Bare Template Markup

The following is the contents of our bare template file. Notice the lack of any HTML?

{# /** * @file * Theme override to remove all field markup. */ #} {% spaceless %} {% for item in items %} {{ item.content }} {% endfor %} {% endspaceless %}

Bare templating can be used for other commonly used templates as well. To make it render a minimal amount of elements.


We can always use custom templating to avoid getting into complicated markups. And have the flexibility to maintain the templates to render for specific entities.

Resources Tagged Style Guides, Twig

Amazee Labs: Launching Kinderregion

Thu, 03/15/2018 - 09:04
Launching Kinderregion

We’re super excited! The new Kinderregion website has finally launched and brings their motto of Great parents need great tips for trips to life. 

It showcases a wide variety of exciting activities for kids. Families living in Switzerland can now plan a fun day for the whole family by browsing the site. Built on the same framework as Zurich Tourism, Kinderregion showcases highly engaging content that is structured, helpful and of interest to the user. 

Nicole Blum Thu, 03/15/2018 - 09:04 The idea

By building Kinderregion on the same framework as Zurich Tourismus, the new site would have to to offer highly valuable content in a structured and appealing manner. The events section should benefit from the main site’s interactive features such as instant filters and an interactive map based on React. As Kinderregion is a content heavy website, we would need to allow content editors to easily change the front page and the menu. Similarly, we would need the ability to deploy code and configuration changes without losing the customisations done by the client. Just as with, our idea to solve this was using the Panels ecosystem.

The most challenging part of the project

Creating something complex on a tight budget can be tricky. We were, however, able to solve this by re-applying certain existing elements throughout the entire site. Along the way, our team learned a bunch of new things and strengthened their skill sets even more. One highlight being how to override existing styling when working with the sub-template.

The Result

We implemented Kinderregion as a subsite of the main Zurich Tourism website, based on the Domain module. This allows us to share mission content across both websites and most importantly, benefit from the infrastructure that the Zurich Tourism Website already provides. We also added to the permission system and the reactive events filter section on the Landing pages.

The same layout used for is applied to Kinderregion, and is based on the "Panels suite". It is built using "Panels everywhere", which enables us to export the site layout and it’s domain-specific variants to features. Following the same logic, the home page is based on a panel page with different variants for each domain. The mega menu is composed of mini panels, loading into specific menu items through the use of the menu mini panel module. The consistent use of panels for all of these different areas allows the content editors to easily update the front page and makes it possible for us to deploy code and configuration changes, without losing the customisations done by the client. Hence, the sites heavy content is displayed in a coherent and captivating manner.

We loved collaborating with Zurich Tourism again on this new project and also really enjoyed working alongside the creative agency Rosarot Ideennetz throughout the process. All input and guidance has been super valuable and highly appreciated. Blog: AGILEDROP: Our blog posts from February

Thu, 03/15/2018 - 02:09
You have already seen what Drupal blogs were trending in the previous month, and now it is time to look at all our blog post from February.    The first blog post in February was What can Drupal agencies expect in 2018 by our Commercial director Iztok. He looked at the technology trends and how they are changing, how can those changes influence on Drupal agencies and what can we expect in the future. What are the conclusions from Drupal Business Survey, including responses from 200 different Drupal agencies? Iztok did a SWOT analysis based on digital agency reports from 2017 and outlooks… READ MORE

MTech, LLC: Drupal 8 Contrib Upgrade Status

Wed, 03/14/2018 - 21:13
Drupal 8 Contrib Upgrade Status

One of the things I constantly get asked about in the Drupal 8 migrate space is when will migrate be ready for use. With the API being marked stable in 8.5.0, now is a good time to consider upgrading. Upgrading a D6 or D7 site should be ready, especially if you have mainly core modules in use. However, what about when your site used a contrib module or two or ten?

Lucas Hedding Wed, 03/14/2018 - 14:13 Tutorial: equipment library reservations with Drupal 8 & BEE

Wed, 03/14/2018 - 16:51
BEE makes it easy to quickly implement all kinds of booking & reservation use cases. We've created a new video that walks through setting up BEE to take reservations for an equipment library.

Fuse Interactive: Drupal 8 and iMIS - A SAML Story

Wed, 03/14/2018 - 16:19
Drupal 8 and iMIS - A SAML Story In the summer of 2017, Fuse started work on a new website for the BC Pharmacy Association (BCPhA). This new website was to be built in Drupal 8 and was part of BCPhA’s overhaul of their digital strategy. Among the various requirements of the build, was an integration with an existing third-party system BCPhA used to manage their members. This system had been in use by BCPhA for a while and their existing website integrated into this system. John Wiebe Wed, 03/14/2018 - 08:19

Lucius Digital: Login without password most secure | Wait.. what?

Wed, 03/14/2018 - 15:36
Never having to remember your Drupal passwords again, how great would that be? It appears the working without passwords even is the most secure option. But how is that possible? Class naming for Javascript development in Drupal

Wed, 03/14/2018 - 15:33
Class naming for Javascript development in Drupal Steven Jones 14th Mar 2018

We've settled on what we think is a best practice for class naming for Javascript in Drupal – let me explain what I mean and then talk you through our reasoning.

Read more

Jacob Rockowitz: My three mistakes in regards to the Contribute module and Drupal

Wed, 03/14/2018 - 14:38

Figuring out how to improve the sustainability of Drupal needs to be an ongoing discussion with a gradually evolving approach. It is important that Drupal and every Open Source project has an ongoing discussion about sustainability where everyone can share their views and experiment with new ideas and approaches.

The Contribute module is an experiment that ignited a discussion. It is important to recognize what works and what doesn’t, acknowledge and learn from mistakes, and continue to have this discussion. Sure, there will be varying opinions and results, but the discussion must always be permitted to happen.

My first mistake: The Contribute module is definitely not a technical dependency

The Webform module doesn't depend on the Contribute module to function properly. Honestly, I did not expect that adding this dependency would be so disruptive. This was my first mistake... adding any new dependency is disruptive especially if someone is managing a large multisite installation.

Conceptually, the Contribute module's message is for the broader Drupal community. This message is originating from my work on the Webform module, therefore it should have stayed in the Webform module. In time, I hope this message gradually works its way through the Drupal core issue queue and reaches the entire Drupal community.

My second mistake: Not fully thinking through my approach

How people interact and communicate in online communities is interesting (to say the least). The truth is people say and act in ways that they would never do in person. I am a born and raised New Yorker, which requires a thick skin to defend yourself, yet at the same time you need empathy to get along with so many different groups of people.

My first mistake...Read More

Drupal blog: How to use Drupal 8's off-canvas dialog in your modules

Tue, 03/13/2018 - 22:14

This blog has been re-posted and edited with permission from Dries Buytaert's blog. Please leave your comments on the original post.

The goal of this tutorial is to show how to use Drupal 8.5's new off-canvas dialog in your own Drupal modules.

The term "off-canvas" refers to the ability for a dialog to slide in from the side of the page, in addition to resizing the page so that no part of it is obstructed by the dialog. You can see the off-canvas dialog in action in this animated GIF:

This new Drupal 8.5 feature allows us to improve the content authoring and site building experience by turning Drupal outside-in. We can use the off-canvas dialog to enable the content creator or site builder to seamlessly edit content or configuration in-place, and see any changes take effect immediately. There is no need to navigate to the administrative backend to make edits. As you'll see in this tutorial, it's easy to use the off-canvas dialog in your own Drupal modules.

I use a custom album module on for managing my photo albums and for embedding images in my posts. With Drupal 8.5, I can now take advantage of the new off-canvas dialog to edit the title, alt-attribute and captions of my photos. As you can see in the animated GIF above, every photo gets an "Edit"-link. Clicking the "Edit"-link opens up the off-canvas dialog. This allows me to edit a photo in context, without having to go to an another page to make changes.

So how did I do that?

Step 1: Create your form, the Drupal way

Every image on has its own unique path:<album-name>/<image-name>

I can edit my images at:<album-name>/<image-name>/edit

For example, gives you the image of the Niagara Falls. If you have the right permissions you could edit the image at (you don't ). Because you don't have the right permissions, I'll show you a screenshot of the edit form instead:

I created those paths (or routes), using Drupal's routing system, and I created the form using Drupal's regular Drupal form API. I'm not going to explain how to create a Drupal form in this post, but you can read more about this at the routing system documentation and the form API. Here is the code for creating the form:

<?php namespace Drupal\album; use Drupal\Core\Form\FormBase; use Drupal\Core\Form\FormStateInterface; use Drupal\album\Image; use Drupal\Core\Url; class ImageEditForm extends FormBase { public function getFormId() { return 'album_edit_image'; } public function buildForm(array $form, FormStateInterface $form_state, $dir = NULL, $img = NULL) { $image = Image::loadImage("$dir/$img"); $form['path'] = [ '#type' => 'hidden', '#value' => $image->getUrlPath(), // Unique ID of the image ]; $form['title'] = [ '#type' => 'textfield', '#title' => t('Title'), '#default_value' => $image->getTitle(), ]; $form['alt'] = [ '#type' => 'textfield', '#title' => t('Alt'), '#default_value' => $image->getAlt(), ]; $form['caption'] = [ '#type' => 'textarea', '#title' => t('Caption'), '#default_value' => $image->getCaption(), ]; $form['submit'] = [ '#type' => 'submit', '#value' => t('Save image'), ]; return $form; } public function submitForm(array &$form, FormStateInterface $form_state) { $values = $form_state->getValues(); $image = Image::loadImage($values['path']); if ($image) { $image->setTitle($values['title']); $image->setAlt($values['alt']); $image->setCaption($values['caption']); $image->save(); } $form_state->setRedirectUrl(Url::fromUserInput('/album/'. $image->getUrlPath())); } } ?> Step 2: Add an edit link to my images

First, I want to overlay an "Edit"-button over my image:

If you were to look at the HTML code, the image link uses the following <a href> tag:

<a href="" class="edit-button">Edit</a>

Clicking the link doesn't open the off-canvas dialog yet. The class="edit-button" is used to style the button with CSS and to overlay it on top of the image.

Step 3: Opening the off-canvas dialog

Next, we have to tell Drupal to open the form in the off-canvas dialog when the "Edit"-link is clicked. To open the form in the off-canvas dialog, extend that <a href> tag to:

<a href="" class="edit-button use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas" data-dialog-options="{&quot;width&quot;:400}">Edit</a>

Some extra HTML in the <a href> tag is all it took; it took my regular Drupal form, showed it in an off-canvas dialog, and even styled it! As I wrote above, it is easy to use the off-canvas dialog in your own modules. Hopefully you'll be inspired to take advantage of this new functionality.

There are several things being added though, so let's break it down. First we add the a class called use-ajax:

  • use-ajax is the class that is necessary for any link including dialogs that use Drupal's Ajax API.

We also added some data-dialog-* attributes:

  • data-dialog-type="dialog" specifies that you want to open the link in a dialog. The other option you can specify is modal. Unlike a dialog, a modal dialog restricts interaction with the current page until the modal dialog is closed.
  • data-dialog-renderer="off_canvas" specifies how Drupal will actually render the dialog. If data-dialog-renderer is not specified then the dialog will rendered with Drupal's default dialog renderer, which is a pop-up dialog (similar to the modal dialog which is used by the Views module).
  • data-dialog-options="{&quot;width&quot;:400}" is optional and can be used to overwrite the default off-canvas dialog properties. In this case, I'm specifying that I want the width of the off-canvas dialog to be 400 pixels instead of the default 300 pixels. Any valid jQuery UI dialog options can be sent here.
  • ?destination=current-path specifies the page we have to navigate back to after we close the dialog. To have the form redirect to the current page a destination value must be added to the query string of the link. Redirecting the form to the current page works the same for dialog links as it does for other links to forms in Drupal. Luckily Drupal 8 provides a RedirectDestination helper service to handle this. In the example above, submitting the form would redirect you to

You can create a link like the example above using a Drupal render array; it will open a form page in the off-canvas dialog and redirect the submitted form back to the current page:

$elements['link'] = [ '#title' => 'Edit image', '#type' => 'link', '#url' => Url::fromRoute('album_image', ['album' => $album, 'image' => $image], ['query' => \Drupal::service('redirect.destination')->getAsArray()])->toString();, '#attributes' => [ 'class' => ['use-ajax'], 'data-dialog-type' => 'dialog', 'data-dialog-renderer' => 'off_canvas', 'data-dialog-options' => Json::encode(['width' => 400]), '#attached' => [ 'library' => [ 'core/drupal.dialog.ajax', ], ], ];

Because the dialog functionality might not be needed on every page, Drupal won't load it unless needed. We use the #attached element to tell Drupal that we want the JavaScript dialog system to be loaded for this page. It's a bit more work, but it keeps Drupal efficient.

Improving the developer experience

Applying the off-canvas dialog to my blog and writing this tutorial uncovered several opportunities to improve the developer experience. It seems unnecessary to set class' => ['use-ajax'] when data-dialog-type is set. Why do I need to specify both a data-dialog-type and a data-dialog-renderer? And why can't Drupal automatically attach core/drupal.dialog.ajax when data-dialog-type is set?

In discussing these challenges with Ted Bowman, one of the developers of the off-canvas dialog, he created an issue on to work on off-canvas developer experience improvements. Hopefully in a future version of Drupal, you will be able to create an off-canvas dialog link as simply as:

$link = Link::createFromRoute('Edit image', 'album_image', ['album' => $album, 'image' => $image])->openInOffCanvasDialog(); $elements['link'] = $link->toRenderable();

Special thanks to Ted Bowman and Samuel Mortenson for their feedback to this blog post.

Mediacurrent: How to Make the Most of Your DrupalCon BOF Experience

Tue, 03/13/2018 - 19:23

DrupalCon Nashville is coming up and that means another chance to create deeper connections with the Drupal community by attending or facilitating Birds of a Feather sessions (BOFs). The DrupalCon team has summarized what a BOF is on the DrupalCon website:

Manifesto: DrupalCamp London 2018 – business, code and community

Tue, 03/13/2018 - 17:16
This year’s DrupalCamp London was probably the best ever. Either you were there for business, for learning more, or for meeting friends old and new. The camp itself was a perfect fit for all roles. Always something interesting, never a boring moment. The chatbots are here Saturday I spoke at “Hi, I’m Drupal. How can. Continue reading...

Acro Media: Digital Products and Recrurring Subscriptions in Drupal Commerce 2

Tue, 03/13/2018 - 16:25

In a previous post, we covered the basics of the Urban Hipster demo that Acro Media put together to showcase the amazing out-of-the-box functionality available with Drupal Commerce 2. Let us now turn our attention to some of the "plus" features that are still possible with Drupal Commerce, but that aren't quite so easy right out of the box.

Recurring subscriptions

Recurring subscriptions are really two things: recurring payments (payments that happen on a schedule) and also licensing (getting access to something). Those two things usually have to go together. For instance: you automatically pay $10 every month (the recurring payment) and you get Netflix (the license).

But there are things to think about. What if a customer's credit card doesn't process because they cancelled it and got a new one? Do they stop getting access immediately? Is there a grace period? You might not want to cancel outright; you might want to try to encourage renewal. Drupal Commerce 2 can handle all of that.

Digital products

A digital product can be a download, or access to a site, or a key that activates a trial. In the Urban Hipster demo site, Sir Mix-a-Bit is the digital product. When you go through the sales funnel, you can choose from three different subscription lengths (one month, three months, six months). You're able to add it to your cart, and it displays exactly the same way as any other product. The difference is that once you purchase it, Drupal Commerce knows it's a digital good, so it's handled slightly differently.

Drupal Commerce has two default product types: physical and digital. It understands that it doesn't need shipping or dimension details for digital products, and there is no fulfillment necessary on the back end (although you can if you need it).

The recurring subscription functionality is not limited to digital products, by the way. It could be a donation, in which case there is no product. Or it could be amortized payments, where customers pay for a product over time.

How different is this from Commerce 1?

It's simpler and more streamlined. In Commerce 1, you needed a whole suite of modules because you had to have the card-on-file functionality and so on; now, you just add two modules and all the functionality is there. It's much easier to work with.

Check out the Sir Mix-A-Bit recurring subscription digital product page.

More from Acro Media

Chat with us

If you'd like a personalized tour to discuss how Drupal Commerce fits into your ecommerce solution, give us a shout. We're happy to show and tell.