Development News

Hook 42: Drupal 8 Interviews: Spotlight on Amber Matz

Main Drupal Feed - Tue, 07/10/2018 - 03:42

If you have been to any of the North American Drupal Camps, chances are you recognize Amber Matz. She is the production manager and a trainer at Drupalize.Me. Drupalize.Me is a site for Drupal tutorials and trainings. Amber, along with Joe Shindelar, travel to the various Drupal Camps and DrupalCons and currently run Drupal 8 Theming workshops.

Post Status: Working on your own website — Draft podcast

Wordpress Planet - Mon, 07/09/2018 - 18:34

Welcome to the Post Status Draft podcast, which you can find on iTunes, Google Play, Stitcher, and via RSS for your favorite podcatcher. Post Status Draft is hosted by Brian Krogsgard and co-host Brian Richards.

In this episode, the Brians discuss the challenges of working on your own business website, when your company offers services or makes products for websites. Agencies often disregard their own websites, as do product companies. We discuss our own histories of attempting in-house redesign projects, strategies to get them done, and how we approach things today owning our own tiny businesses.

Episode Links Sponsor: Pagely

Pagely offers best in class managed WordPress hosting, powered by the Amazon Cloud, the Internet’s most reliable infrastructure. Post Status is proudly hosted by Pagely. Thank you to Pagely for being a Post Status partner

Drupal blog: Why large organizations are choosing to contribute to Drupal

Main Drupal Feed - Mon, 07/09/2018 - 17:59

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

During my DrupalCon Nashville keynote, I shared a brief video of Mike Lamb, the Senior Director of Architecture, Engineering & Development at Pfizer. Today, I wanted to share an extended version of my interview with Mike, where he explains why the development team at Pfizer has ingrained Open Source contribution into the way they work.

Mike had some really interesting and important things to share, including:

  1. Why Pfizer has chosen to standardize all of its sites on Drupal (from 0:00 to 03:19). Proprietary software isn't a match.
  2. Why Pfizer only works with agencies and vendors that contribute back to Drupal (from 03:19 to 06:25). Yes, you read that correctly; Pfizer requires that its agency partners contribute to Open Source!
  3. Why Pfizer doesn't fork Drupal modules (from 06:25 to 07:27). It's all about security.
  4. Why Pfizer decided to contribute to the Drupal 8's Workflow Initiative, and what they have learned from working with the Drupal community (from 07:27 to 10:06).
  5. How to convince a large organization (like Pfizer) to contribute back to Drupal (from 10:06 to 12:07).

Between Pfizer's direct contributions to Drupal (e.g. the Drupal 8 Workflow Initiative) and the mandate for its agency partners to contribute code back to Drupal, Pfizer's impact on the Drupal community is invaluable. It's measured in the millions of dollars per year. Just imagine what would happen to Drupal if ten other large organizations adopted Pfizer's contribution models?

Most organizations use Open Source, and don't think twice about it. However, we're starting to see more and more organizations not just use Open Source, but actively contribute to it. Open source offers organizations a completely different way of working, and fosters an innovation model that is not possible with proprietary solutions. Pfizer is a leading example of how organizations are starting to challenge the prevailing model and benefit from contributing to Open Source. Thanks for changing the status quo, Mike!

WPTavern: How WordPress is Powering a New Community on the Remote Island of Ogijima

Wordpress Planet - Mon, 07/09/2018 - 16:09

Junko Nukaga began her journey into the world of WordPress in 2011, just after her hometown in Fukushima prefecture was hit by the 9.0 magnitude Tōhoku earthquake and tsunami. The catastrophic event, referred to in Japan as the Great East Japan Earthquake, devastated the region’s infrastructure and took more than 15,000 lives. It also caused a level 7 meltdown at three reactors in the Fukushima Daiichi Nuclear Power Plant complex.

Until this point Nukaga had only used WordPress as a blogging tool, but her hometown prefecture needed a fast way to get a website up for publishing accurate measurements of the radiation levels. Although she was living in Osaka at the time, Nukaga joined the volunteer team and built the site using WordPress. In addition to local radiation levels, it also had FAQ’s about radiation from scientists to combat the misinformation that was rampant at the time. People found the site through social networks and word of mouth.

After making a difference for her hometown with WordPress, Nukaga wanted to find out more about the community behind the software. She joined an offline WordBench meetup and got connected to the WordPress community. The next year she co-organized WordCamp Osaka 2012, and in 2014 she became the lead organizer of WordCamp Kansai, an area that includes seven prefectures: Mie, Shiga, Kyoto, Osaka, Hyogo, Nara, Wakayama.

As Nukaga became more deeply involved in the WordPress community as a speaker, organizer, and contributor, she developed a new understanding of the power of open source collaboration. After moving to the remote island of Ogijima in 2014, she was inspired to create a library and cultural center, using WordPress to organize a team of more than 200 volunteers.

“When my family and I moved to this island, the school here was closed, because there were no kids on Ogijima,” Nukaga said. “We have a daughter, so we urged the government to reopen the school.

“Although the school restarted, I thought that it would be meaningless for the school to stop or close again when our daughter graduated. The island is an aging society and no new children will be born here. I figured that if there was a library, I could call migrants to the island. A library which is free and an open space would help solve many things, such as children’s learning environment, communication support for the islanders, and migration consultation, for example.”

Nukaga set up a WordPress website before constructing the library so her team of volunteers could disclose the progress of the building and recruit followers. They promoted the website through social networks and were able to crowdfund efforts to construct and maintain the building.

The Ogijima Library opened in February 2014 as a non-profit organization that is rooted in the community, providing a place where people can connect through books and share knowledge with one another. Residents on the island now have access to titles and periodicals that would previously have required a boat trip to acquire. More than 50 migrants have moved to the island within the last four years since the library opened, including families with babies born last year.

“Without WordPress, none of this would have been possible,” Nukaga said. “WordPress opened my way. It taught me the philosophy of open source. I have used this philosophy to involve many unspecified people from the beginning of the process of making the library. We built the building ourselves with the help of 200 volunteers, and we continue to get support through book donations. Also, thanks to the flexibility of WordPress, the things I wanted to do, such as updating, providing a search system for books, and linking to social networks, were all possible.”

WordCamp Ogijima: “Empowering the Smalls to Go Big”

The WordPress community on the island is also thriving, thanks to community organizers who call Ogijima home. Nukaga organizes the meetups, which average 5 to 20 attendees at each event. Shinichi Nishikawa, who organized WordCamp Tokyo in 2012 and WordCamp Bangkok 2017 and 2018, made his home on the island in March 2016. He is joining forces with Nukaga and a team of 35 leaders and volunteers to organize the first WordCamp Ogijima on July 15, 2018.

This will be the first Japanese WordCamp not held in the cities. Organizers have chartered two ferries to transport more than 250 attendees to the island. Camping is the primary lodging option in tents beside the island’s lighthouse and organizers have planned a BBQ after party. Although the event is currently sold out, 10 additional tickets will go on sale on July 10 due to cancellations and an estimation of no-shows.

“The uniqueness of the community in this area is that there are many with different backgrounds,” Nukaga said. “WordCamps in the city are mainly attended by engineers, designers and bloggers, but here there are people who are restaurant managers, farmers, a barber, an illustrator, a ranger (nature protection officer), baker, and others who are interested in WordPress.”

The organizing team, which includes many new contributors from all walks of life, along with meetup organizers in the Setouchi inland sea area, has adopted the theme “Empowering the smalls to go big.”

Ogijima’s local community includes members like Kaisho Damonte, who is using WordPress and WooCommerce to power a website for the bakery and cafe business he started after renovating a 100-year-old barn on the island. Kentaro Yamaguchi, another island resident, uses WordPress for his barber shop’s website.

Shinichi Nishikawa said he sees WordCamp Ogijima as “a WordCamp in a new place, for new audiences, by new organizers.” He appreciates the openness of the islanders who are willing to embrace new things.

“The WordPress community on the island represents this atmosphere,” Nishikawa said. “Everyone has their own views, plans for their lives, and their own ways of thinking. WordPress, with its ‘Democratization of Publishing’ mission is a great match to us, who are trying to make our lives in different ways. We have built a library, cafe, a barbershop, and offices DIY ourselves. When it comes to websites, WordPress helps us a lot.”

The WordPress Community in Ogijima is Defined by a Focus on Cooperative Learning

One of the most inspirational aspects of the community in Ogijima, along with the greater Japanese WordPress community, is the strong emphasis on helping each other learn and succeed. New members are often woven into the community through meetups that focus on connecting around specific interests outside of WordPress technical skill. The community warmly welcomes users who are new to WordPress who want to get help with their websites. Nishikawa said this is the particular audience that the Ogijima meetup is trying to reach.

“We want to connect with individuals who want to achieve something; small business owners, designers, photographers, writers, editors, and anyone who is struggling doing something on the web,” Nishikawa said. “By coming together, you notice that there are many friends who are struggling as well. Experienced developers attend as usual but their role this time is to share their knowledge to the new people. We help each other build and improve our websites. It’s a very relaxed and helping atmosphere in the meetups. We do have some presentations sometimes but that’s not the main thing.”

WordPress Core Committer Mike Schroder will be speaking at WordCamp Ogijima about how everyone has something unique to bring to the community to help it grow.

“I initially visited Japan for WordCamp Tokyo a few years ago — largely because it was the biggest WordCamp in the world at the time,” Schroder said. “The community in Japan is extremely active and welcoming, and I quickly made many friends. One unique part of the community is that it has a big focus on education. The WordBench events are excellent!”

“As the theme of the event is ‘Empower the smalls to go big,’ I’m looking forward to sharing some bits of my background, and how others have helped me grow, in an effort to show folks that they have a lot to offer,” Schroder said. (He’s also doing a bit of research and is interested to hear stories from others about unique aspects of their lives that have helped them succeed in the WordPress ecosystem. You can ping him @mike on WP Slack if you want to contribute.)

The community in Ogijima is a beautiful example of how WordPress is powering a new wave of makers and doers on the island. The software has enabled them to establish new businesses, commerce, and cultural centers in a remote area where they are building their lives. WordCamp Ogijima is a classic example of what a WordCamp should be – an event that highlights the successes of local WordPress users.

“While I don’t think our numbers will grow, our lives will always need WordPress and its community,” Nishikawa said regarding the local meetups. “And we welcome ambitious attendees who need help.”

Evolving Web: Decoupling Drupal with Gatsby

Main Drupal Feed - Mon, 07/09/2018 - 13:39

Gatsby is a really fast React-based static site generator. You can use it to create a static site, with content pulled from Drupal and other content management systems. 

Why Use Gatsby?

Unlike dynamic sites which render pages on-demand, static site generators pre-generate all the pages of the website. This means no more live database querying and no more running through a template engine. Performance goes up and the maintenance cost goes down.

Static site generators have been evolving over the last few years. Tools like Jekyll, Gatsby, Hexo, Hugo become more and more popular. They have been chosen by developers who want a simple website/blog solution. They need very minimal server setup and have a low maintenance cost. However, static site generators usually require writing content in Markdown, which is not a great authoring experience for most content editors.

On the other hand, content management systems such as Drupal and Wordpress can provide a very powerful back-end. Having a WYSIWYG editor and content types help editors to manage content more easily and systematically. However, maintaining a CMS requires hosting a web server and database, and opens you up to security vulnerabilities and performance issues.

Gatsby stands in between the simplicity and robustness of static site, and the versatile back-end of a content management system. Using Gatsby means that you can host the CMS in-house and publish content generated by Gatsby as a static website. The first thing you’ll notice about Gatsby is how amazingly fast it is.
 

How to Integrate Drupal and Gatsby

In this tutorial, we are going to put together a demo that pulls Drupal content into a Gatsby site. We’ll borrow content of this awesome blog post to create a list of coffee types in Drupal, then transfer the list content to Gatsby.

This goal can be achieved with 4 steps:

  1. Build a Drupal server
  2. Build a Gatsby site
  3. Fetch content from the Drupal server
  4. Publish the Gatsby site
1. Build a Drupal server

Let’s say we already have a Drupal 8 site installed. We’ll need to:

  • Create a content type name Coffee with three fields: Title, Body and Image
  • Turn Drupal into an API server by installing 2 modules jsonapi and jsonapi_extras.
  • Give Anonymous user permission to Access the JSON API resource list
  • Verify that the API server is working well by going to http://[your-site]/jsonapi as an Anonymous user. The page should show up with all information of your API server

Tips

  • If you use Chrome, use JSON Viewer Chrome extension to view JSON data in a better format
  • If you don’t set permission for Anonymous user to Access JSON API resource list, you’ll get error 406 - Not acceptable when trying to connect to Drupal from Gatsby
  • If you don’t have jsonapi_extras installed, you’ll get error 405 - Method Not Allowed when query data from Gatsby
2. Build a Gatsby Site

First, make sure you have node and npm installed on your computer. Verify it by typing node -v and npm -v into Terminal

node -v v10.1.0 npm -v 5.6.0

Install Gatsby’s command line tool

npm install --global gatsby-cli

Create a new Gatsby site and run it, I’ll call my Gatsby site coffees.gatsby

gatsby new coffees.gatsby cd coffees.gatsby gatsby develop // start hot-reloading development environment

By default, the new Gatsby site is accessible at localhost:8000

3. Fetch Content from the Drupal Server

At this step, we’ll be creating a new simple page /coffees that displays all the coffee types from the Drupal site.

Create the /coffees page

Create a new page in Gatsby is as simple as creating a new JS file. All Gatsby pages should be stored in /src/pages. In this case, we’ll create the file coffees.js in /src/pages and add the following code in coffees.js:

import React from "react" const CoffeesPage = () => ( Different types of coffee ) export default CoffeesPage

This simple code does one thing: create a new page at /coffees. The content of this page is a heading h1 with the text “Different types of coffee”

Query Drupal content using GraphQL

In order to pull data from Drupal 8 site, we’ll need to install the gatsby-source-drupal plugin

// in your coffees.gatsby folder npm install --save gatsby-source-drupal

Configure the gatsby-source-drupal plugin

// In gatsby-config.js plugins: [ ... { resolve: 'gatsby-source-drupal', options: { baseUrl: 'http://dcmtl2018-demo.server/', apiBase: 'jsonapi', // endpoint of Drupal server }, } ],

After adding the plugin configuration, the site should still be functioning. If Gatsby throws a 406 error, check the permission on the Drupal site; if Gatsby throws a 405 error, make sure module jsonapi_extras is enabled.

Build GraphQL to query all coffee nodes from Drupal

Gatsby comes with an in-browser tool for writing, validating and testing GraphQL queries named GraphiQL, and it can be found at localhost:[port]/___graphql, in our case it’s localhost:8000/___graphql

Let’s try querying all the Coffee nodes in this tutorial

After building the query successfully, let’s go back to the coffees.js file to execute the query.

export const query = graphql` query allNodeCoffee { allNodeCoffee { edges { node { id title body { value format processed summary } } } } } `

Then, update the const CoffeesPage to display the title and body content:

const CoffeesPage = ({data}) => ( Different types of coffee { data.allNodeCoffee.edges.map(({ node }) => ( { node.title } ))} )

Thanks to hot-reloading, we can see the sweet fruit of the work right after saving the file

So far, we have done:

  • Create an API server with Drupal and jsonapi, jsonapi_extras
  • Create a Gatsby site with page coffees.js that “reads” content from Drupal server

Let’s move the the last step of the tutorial: publish Gatsby site.

4. Publish the Gatsby Site

Gatsby names itself as a static static site generator, meaning its main purpose is to generate a bunch of static HTML, JS, CSS and images files. This action can be done by only one command:

gatsby build

Once finished, checkout /public folder to see result of your hard work along this long tutorial. Deploying your site is now simply copy/push contents in /public to server.

 

Conclusion

In this tutorial, we got to know how to:

  • Create a new Gatsby site
  • Install new plugin in Gatsby
  • Use GraphiQL to write, validate and test GraphQL query

I personally find that Gatsby is a good solution for setting up a simple blog. It’s easy to install, very fast, and requires zero server maintenance. In a future blog post, I’ll talk about how to integrate more complex data from Drupal into Gatsby.

+ more awesome articles by Evolving Web

DrupalEasy: DrupalEasy Podcast 211 - Tara King - Diversity and Inclusion Contribution Team

Main Drupal Feed - Mon, 07/09/2018 - 12:45

Direct .mp3 file download.

Tara King, Customer Success Engineer with Pantheon, Drupal Diversity and Inclusion leadership team, and a member of Core Mentoring Leadership team joins Mike Anello to talk about Drupal's Diversity and Inclusion Contribution Team - and how you can get involved.

Discussion DrupalEasy News Sponsors 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.

Agiledrop.com Blog: AGILEDROP: Drupal Security Tips

Main Drupal Feed - Mon, 07/09/2018 - 10:55
Drupal is the leading enterprise web content management framework.  With this popularity, of course, comes the increased risk to security. While Drupal in itself, out-of-the-box is widely considered to be very secure, there are additional methods that one must definitely undertake in order to ensure their Drupal site stays attack-proof as much as possible.   Minimum Administrative Privileges In Drupal, users with administrative privileges have access to each and every section of the site. This, of course, means that administrative privileges in the wrong hands could prove to be the end of… READ MORE

ThinkShout: Automatic Page Generation with Custom Entity Routes

Main Drupal Feed - Mon, 07/09/2018 - 09:02

One of the most useful items in the Drupal 8 toolbox is the Paragraphs Module. By creating custom paragraph types, you can have much finer control over the admin and content creation process in Drupal.

A recent client of ThinkShout needed a content type (office locations) to include ‘sub-pages’ for things like office hours, services, and other items depending on the location. Most of the sub-page content was pretty simple, but they also needed to have direct links, be printable, and have the same header as the parent page. This ruled out an Ajax solution.

We’ve been using Paragraphs to make configurable content throughout the site, and since the sub-pages only have Title and Content fields, we thought they would be a good fit here as well. We then decided to explore the possibility of using custom entity routes to fulfill the other requirements.

To start, we created two additional view modes for the sub-page paragraphs called Sub-page and Menu link containing the Content and Title fields respectively. By keeping these fields in separate view modes, we make it much easier to work with them.

Next we created a custom module to hold all of our code, ts_sub_pages. In addition to the standard module files, we added the file ts_sub_pages.routing.yml, which contains the following:

ts_sub_pages.sub_pages: path: '/node/{node}/sub-page/{paragraph}' defaults: _controller: '\Drupal\ts_sub_pages\Controller\TSSubPagesController::subPageParagraph' _title_callback: '\Drupal\ts_sub_pages\Controller\TSSubPagesController::getTitle' options: parameters: node: type: entity:node paragraph: type: entity:paragraph requirements: _permission: 'access content'

This defines a unique system path based on the parent node ID and the paragraph entity ID. It would look like https://example.org/node/12345/sub-page/321. It also defines the call to the controller and the title_callback, essentially a location where we can create functions to manipulate the entity and its route. The options define the things to pass into the controller and title callback functions, and we also define access permissions using requirements.

One of the odd things about the controller and title_callback calls is that they look like a path, but are not. They have a predefined (and minimally documented) structure. You must do the following to make them work:

  • Create two folders in your module: src/Controller (case is important).
  • Create a file called TSSubPagesController.php - this must match the call.
  • Define a class matching TSSubPagesController in TSSubPagesController.php
  • Define a function matching subPageParagraph inside the TSSubPagesController class.

Example below. The names of the controller file, class, and function are up to you, but they must have the same case, and the file and class must match.

Digging into the TSSubPagesController.php file, we have a setup like so:

<?php namespace Drupal\ts_sub_pages\Controller; use Drupal\Core\Controller\ControllerBase; use Symfony\Component\HttpFoundation\Request; use Drupal\node\Entity\Node; use Drupal\paragraphs\Entity\Paragraph; /** * TS Sub Pages controller. */ class TSSubPagesController extends ControllerBase { /** * {@inheritdoc} */ public function subPageParagraph(Paragraph $paragraph, Node $node, Request $request) {

Here we have the namespace - this is our module. Note again that the src is taken for granted. Next are the Symfony/Drupal use statements, to pull in the classes/interfaces/traits we’ll need. Then we extend the ControllerBase class with TSSubPagesController, and define our subPageParagraph function. The function pulls in the $node and $paragraph options we defined in ts_sub_pages.routing.yml.

Now we can finally get to work on our sub-pages! Our goal here is to bring in the parent node header fields on every sub-page path. In the Drupal admin interface, go to ‘Manage Display’ for your content type. In our case it was /admin/structure/types/manage/location/display. Scroll to the bottom and under ‘Custom display settings’ you’ll find a link to ‘Manage view modes’. We added a mode called sub-page, and added all of the fields from our Location’s header.

Now we can bring that view of the node into the sub-page using the subPageParagraph function we defined above:

<?php public function subPageParagraph(Paragraph $paragraph, Node $node, Request $request) { $node_view_builder = \Drupal::entityTypeManager()->getViewBuilder('node'); $node_header = $node_view_builder->view($node, 'sub_page'); $paragraph_view_builder = \Drupal::entityTypeManager()->getViewBuilder('paragraph'); $paragraph_body = $paragraph_view_builder->view($paragraph, 'sub_page'); return ['node' => $node_header, 'paragraph' => $paragraph_body]; }

We get the node and paragraphs using getViewBuilder, then the view modes for each. The node’s ‘sub-page’ view mode contains all of the header fields for the node, and the paragraph ‘sub-page’ view mode contains the paragraph body. We return these, and the result is what looks like a page when we visit the base paragraph url of /node/12345/sub-page/321. The title is missing though, so we can add that with another small function inside the TSSubPagesController class (we call it using the _title_callback in ts_sub_pages.routing.yml):

<?php /** * Returns a page title. */ public function getTitle(Paragraph $paragraph, Node $node) { $node_title = $node->getTitle(); $paragraph_title = $paragraph->field_title_text->value; return $node_title . ' - ' . $paragraph_title; }

Now we need to build a menu for our sub-pages. For this we can just use the ‘sub-pages’ paragraph field on the parent node. In the admin display, this field is how we add the sub-page paragraphs, but in the public-facing display, we use it to build the menu.

First, make sure you include it in the ‘default’ and ‘sub-page’ displays as a Rendered Entity, using the “Rendered as Entity” Formatter, which has widget configuration where you need to select the “Menu Link” view mode. When we set up the Paragraph, we put the Title field in the ‘Menu Link’ view. Now the field will display the titles of all the node’s sub-pages. To make them functional links, go to the ‘Menu Link’ view mode for your sub-page paragraph type, make the Title a ‘Linked Field’, and use the following widget configuration:

Destination: /node/[paragraph:parent_id]/sub-page/[paragraph:id] Title: [paragraph:field_title_text]

Next we need to account for the fact that the site uses URL aliases. A node called ‘main office’ will get a link such as /locations/main-office via the Pathauto module. We want our sub-pages to use that path.

We do this by adding a URL Alias to the sub-page routes on creation (insert) or edit (update). In our module, we add the following functions to the ts_sub_pages.module:

<?php /** * Implements hook_entity_insert(). */ function ts_sub_pages_entity_insert(EntityInterface $entity) { if ($entity->getEntityTypeId() == 'paragraph' && $entity->getType() == "custom_subpage") { _ts_sub_pages_path_alias($entity); } } /** * Implements hook_entity_update(). */ function ts_sub_pages_entity_update(EntityInterface $entity) { if ($entity->getEntityTypeId() == 'paragraph' && $entity->getType() == "custom_subpage") { _ts_sub_pages_path_alias($entity); } }

These get called every time we add or update the parent node. They call a custom function we define just below. It’s important to note that we have a custom title field field_title_text defined - your title may be the Drupal default:

<?php /** * Custom function to create a sub-path alias. */ function _ts_sub_pages_path_alias($entity) { $sub_page_slug = Html::cleanCssIdentifier(strtolower($entity->field_title_text->value)); $node = \Drupal::routeMatch()->getParameter('node'); $language = \Drupal::languageManager()->getCurrentLanguage()->getId(); $nid = $node->id(); $alias = \Drupal::service('path.alias_manager')->getAliasByPath('/node/' . $nid); $system_path = "/node/" . $nid . "/sub-page/" . $entity->id(); if (!\Drupal::service('path.alias_storage')->aliasExists($alias . "/" . $sub_page_slug, $language)) { \Drupal::service('path.alias_storage') ->save($system_path, $alias . "/" . $sub_page_slug, $language); } }

This function gets the sub-page paragraph title, and creates a URL-friendly slug. It then loads the paragraph’s node, gets the current language, ID, and alias. We also build the system path of the sub-page, as that’s necessary for the url_alias table in the Drupal database. Finally, we check that there’s no existing path that matches ours, and add it. This will leave old URL aliases, so if someone had bookmarked a sub-page and the name changes, it will still go to the correct sub-page.

Now we can add the ‘Home’ link and indicate when a sub-page is active. For that we’ll use a custom twig template. The field.html.twig default file is the starting point, it’s located in core/themes/classy/templates/field/. Copy and rename it to your theme’s template directory. Based on the field name, this can be called field--field-sub-pages.html.twig.

The part of the twig file we’re interested in is here:

{% for item in items %} <div{{ item.attributes.addClass('field__item') }}>{{ item.content }}</div> {% endfor %}

This occurs three times in the template, to account for multiple fields, labels, etc. Just before each of the for loops, we add the following ‘home’ link code:

{% if url('<current>')['#markup'] ends with node_path %} <div class="field__item active" tabindex="0">Home</div> {% else %} <div class="field__item"><a href="{{ node_path }}">Home</a></div> {% endif %}

Next, we make some substantial changes to the loop:

{% set sub_text = item.content['#paragraph'].field_title_text.0.value %} {% set sub_path = node_path ~ '/' ~ sub_text|clean_class %} {% if url('<current>')['#markup'] ends with sub_path %} <li{{ item.attributes.addClass('field__item', 'menu-item', 'active') }}>{{ sub_text }}</li> {% else %} <li{{ item.attributes.addClass('field__item', 'menu-item') }}><a href="{{ sub_path }}">{{ sub_text }}</a></li>

Here, sub_text gets the sub-page title, and sub_path the path of each sub-page. We then check if the current url ends with the path, and if so, we add the active class and remove the link.

And that’s it! The client can now add as many custom sub-pages as they like. They’ll always pick up the parent node’s base path so they will be printable, direct links. They’ll have the same header as the parent node, and they will automatically be added or deleted from the node’s custom context-aware menu.

Hmm, maybe this would make a good contributed module?

Drupixels: Enable debug mode and error reporting for local development in Drupal 8

Main Drupal Feed - Sun, 07/08/2018 - 14:57
If you are just starting with Drupal 8 then one of the most important things you should know is to enable the debug mode and error reporting on Drupal 8. This is really important for backend as well as frontend developer to the full error on your screen while you are working because you might not know what is the exact issue with the site with just a generic error statement.

Matt Glaman: Filtering out invalid entity references in Drupal 8

Main Drupal Feed - Fri, 07/06/2018 - 20:15
Filtering out invalid entity references in Drupal 8 mglaman Fri, 07/06/2018 - 15:15 Today I was working on a custom Drupal 8 form where I needed an option to purge existing entities and their references on a parent entity before running an import. It seemed pretty straightforward until I saw "ghost" values persisting on the parent entity's inline entity form. Here's my journey down the rabbit hole to fix broken entity reference values.

Dev Blog: Update on Gutenberg

Wordpress Planet - Fri, 07/06/2018 - 19:23

Progress on the Gutenberg project, the new content creating experience coming to WordPress, has come a long way. Since the start of the project, there have been 30 releases and 12 of those happened after WordCamp US 2017. In total, there have been 1,764 issues opened and 1,115 closed. As the work on phase one moves into its final stretch, here is what you can expect.

In Progress
  • Freeze new features in Gutenberg (the feature list can be found here).
  • Hosts, agencies, teachers invited to opt-in sites they have influence over.
  • WordPress.com has opt-in for wp-admin users. The number of sites and posts will be tracked.
  • Mobile app support for Gutenberg will be across iOS and Android.
July
  • 4.9.x release with an invitation to install either Gutenberg or Classic Editor plugin.
  • WordPress.com will move to opt-out. There will be tracking to see who opts out and why.
  • Triage increases and bug gardening escalates to get blockers in Gutenberg down to zero.
  • Gutenberg phase two, Customization exploration begins by moving beyond the post.
August and beyond
  • All critical issues within Gutenberg are resolved.
  • There is full integration with Calypso and there is opt-in for users there.
  • A goal will be 100k+ sites having made 250k+ posts using Gutenberg.
  • Core merge of Gutenberg begins the 5.0 release cycle.
  • 5.0 moves into beta releases and translations are completed.
  • There will be a mobile version of Gutenberg by the end of the year.

WordPress 5.0 could be as soon as August with hundreds of thousands of sites using Gutenberg before release. Learn more about Gutenberg here, take it for a test drive, install on your site, follow along on GitHub and give your feedback.

Update on Gutenberg

Wordpress News - Fri, 07/06/2018 - 19:23

Progress on the Gutenberg project, the new content creating experience coming to WordPress, has come a long way. Since the start of the project, there have been 30 releases and 12 of those happened after WordCamp US 2017. In total, there have been 1,764 issues opened and 1,115 closed as of WordCamp Europe. As the work on phase one moves into its final stretch, here is what you can expect.

In Progress
  • Freeze new features in Gutenberg (the feature list can be found here).
  • Hosts, agencies, teachers invited to opt-in sites they have influence over.
  • WordPress.com has opt-in for wp-admin users. The number of sites and posts will be tracked.
  • Mobile app support for Gutenberg will be across iOS and Android.
July
  • 4.9.x release with an invitation to install either Gutenberg or Classic Editor plugin.
  • WordPress.com will move to opt-out. There will be tracking to see who opts out and why.
  • Triage increases and bug gardening escalates to get blockers in Gutenberg down to zero.
  • Gutenberg phase two, Customization exploration begins by moving beyond the post.
August and beyond
  • All critical issues within Gutenberg are resolved.
  • There is full integration with Calypso and there is opt-in for users there.
  • A goal will be 100k+ sites having made 250k+ posts using Gutenberg.
  • Core merge of Gutenberg begins the 5.0 release cycle.
  • 5.0 moves into beta releases and translations are completed.
  • There will be a mobile version of Gutenberg by the end of the year.

WordPress 5.0 could be as soon as August with hundreds of thousands of sites using Gutenberg before release. Learn more about Gutenberg here, take it for a test drive, install on your site, follow along on GitHub and give your feedback.

PreviousNext: Automate your Drupal accessibility testing with aXe and NightwatchJS

Main Drupal Feed - Thu, 07/05/2018 - 23:52

Automated accessibility tools are only one part of ensuring a website is accessible, but it is a very simple part that can catch a lot of really easy to fix issues. Issues that when found and corrected early in the development cycle, can go a long way to ensuring they don’t get compounded into much larger issues down the track.

by Rikki Bochow / 6 July 2018

I’m sure we all agree that the accessibility of ALL websites is important. Testing for accessibility (a11y) shouldn’t be limited to Government services. It shouldn’t be something we need to convince non-government clients to set aside extra budget for. It certainly shouldn’t be left as a pre-launch checklist item that only gets the proper attention if the allocated budget and timeframe hasn’t been swallowed up by some other feature.

Testing each new component or feature against an a11y checker, as it’s being developed, takes a small amount of time. Especially when compared to the budget required to check and correct an entire website before launch -- for the very first time. Remembering to run such tests after a components initial development is one thing. Remembering to re-check later down the line when a few changes and possible regressions have gone through is another. Our brains can only do so much, so why not let the nice, clever computer help out?

NightwatchJS

NightwatchJS is going to be included in Drupal 8.6.x, with some great Drupal specific commands to make functional javascript testing in Drupal super easy. It's early days so the documentation is still being formed.  But we don't have to wait for 8.6.x to start using Nightwatch, especially when we can test interactions against out living Styleguide rather than booting up Drupal.

So lets add it to our build tools;

$ npm install nightwatch

and create a basic nightwatch.json file;

{ "src_folders": [   "app/themes/my_theme/src/",   "app/modules/custom/"   ], "output_folder": "build/logs/nightwatch", "test_settings": { "default": { "filter": "**/tests/*.js", "launch_url": "http://127.0.0.1", "selenium_host": "127.0.0.1", "selenium_port": "4444", "screenshots": { "enabled": true, "on_failure": true, "on_error": true, "path": "build/logs/nightwatch" }, "desiredCapabilities": { "browserName": "chrome" } } } }

We're pointing to our theme and custom modules as the source of our JS tests as we like to keep the tests close to the original JS. Our test settings are largely based on the Docker setup described below, with the addition of the 'filter' setting which searches the source for .js files inside a tests directory.

A test could be as simple as checking for an attribute, like the following example;

/** * @file responsiveTableTest.js. */ module.exports = { 'Responsive tables setup': (browser) => { browser .url(`${browser.launch_url}/styleguide/item-6-10.html?hideAll`) .pause(1000); browser.expect.element('td').to.have.attribute('data-label'); browser.end(); }, };

Which launches the Styleguides table component, waits a beat for the JS to initiate then checks that our td elements have the data-label that our JS added. Or is could be much more complex.

aXe: the Accessibility engine

aXe is a really nice tool for doing basic accessibility checks, and the Nightwatch Accessibility node module integrates aXe with Nightwatch so we can include accessibility testing within our functional JS tests without needing to write out the rules ourself. Even if you don't write any component specific tests with your Nightwatch setup, including this one accessibility test will give you basic coverage.

$ npm install nightwatch-accessibility

Then we edit our nightwatch.json file to include the custom_commands_path and custom_assertions_path;

{ "src_folders": ["app/themes/previousnext_d8_theme/src/"], "output_folder": "build/logs/nightwatch", "custom_commands_path": ["./node_modules/nightwatch-accessibility/commands"], "custom_assertions_path": ["./node_modules/nightwatch-accessibility/assertions"], "test_settings": {   ...   } }

Then write a test to do the accessibility check;

/** * @file Run Axe accessibility tests with Nightwatch. */ const axeOptions = { timeout: 500, runOnly: { type: 'tag', values: ['wcag2a', 'wcag2aa'], }, reporter: 'v2', elementRef: true, }; module.exports = { 'Accessibility test': (browser) => { browser .url(`${browser.launch_url}/styleguide/section-6.html`) .pause(1000) .initAccessibility() .assert.accessibility('.kss-modifier__example', axeOptions) .end(); }, };

Here we're configuring aXe core to check for wcag2a and wcag2aa, for anything inside the .kss-modifier__example selector of our Styleguide. Running this will check all of our components and tell us if it's found any accessibility issues. It'll also fail a build, so when hooked up with something like CircleCI, we know our Pull Requests will fail.

If we want to exclude a selector, instead of the .kss-modifier__example selector, we pass an include/exclude object { include: ['.kss-modifier__example'], exclude: ['.hljs'] }.

If you only add one test add one like this. Hopefully once you get started writing Nightwatch tests you'll see how easy it is and eventually add more :)

You can include the accessibility test within another functional test too, for example a modal component. You'll want to test it opens and closes ok, but once it's open it might have some accessibility issues that the overall check couldn't test for. So we want to re-run the accessibility assertion once it's open;

/** * @file dialogTest.js */ const axeOptions = require('../../../axeOptions.js'); // axeOptions are now shareable. const example = '#kssref-6-18 .kss-modifier__example'; const trigger = '#example-dialog-toggle'; const dialog = '.js-dialog'; module.exports = { 'Dialog opens': (browser) => { browser .url(`${browser.launch_url}/styleguide/item-6-18.html?hideAll`) .pause(1000) .initAccessibility(); browser.click(trigger).pause(1000); browser.expect.element(dialog).to.be.visible; browser.assert.attributeEquals(dialog, 'aria-hidden', 'false'); browser.assert.accessibility(example, axeOptions); browser.end(); }, };Docker

As mentioned above this all needs a little docker & selenium setup too. Selenium has docs for adding an image to Docker, but the setup basically looks like this;

@file docker-compose.yml services:   app:   [general docker image stuff...] selenium: image: selenium/standalone-chrome network_mode: service:app volumes: - /dev/shm:/dev/shm

Then depending on what other CI tools you're using you may need some extra config. For instance, to get this running on CircleCI, we need to tell it about the Selenium image too;

@file .circleci/config.yml jobs:   test:    docker:   [other docker images...] - image: selenium/standalone-chrome

If you're not using docker or any CI tools and just want to test this stuff locally, there's a node module for adding the selenium-webdriver but I haven't tested it out with Nightwatch.

Don’t forget the manual checks!

There’s a lot more to accessibility testing than just these kinds of automated tests. A layer of manual testing will always be required to ensure a website is truly accessible. But automating the grunt work of running a checklist against a page is one very nice step towards an accessible internet.

Tagged accessibility, CI, nightwatchjs, Functional Testing, aXe

WPTavern: WordPress 4.9.8 to Introduce “Try Gutenberg” Callout

Wordpress Planet - Thu, 07/05/2018 - 21:39

Paul Biron and Joshua Wold are leading the upcoming WordPress 4.9.8 release, which was originally announced as 4.9.7. WordPress core contributors met yesterday to decide the general focus and set the release schedule. In the meantime, the 4.9.7 security and maintenance release was rolled out to fix an authenticated arbitrary file deletion vulnerability, along with a few other minor updates.

WordPress 4.9.8 is targeted for July 31, 2018, with a beta as early as July 17. The release will focus on introducing the “Try Gutenberg” callout and adding privacy fixes and enhancements. The ticket proposing the callout was opened a year ago and was planned to be included in WordPress 4.9.5 but was eventually pulled before the release in favor of allowing Gutenberg contributors to iron out a few important issues.

WordPress Core Committer Mel Choyce added the most recent round of designs to the ticket four weeks ago and contributors are still iterating on the design and text for the callout. Another iteration is expected to be added to the ticket early next week.

WordPress 4.9.8 is another step in Matt Mullenweg’s roadmap for getting Gutenberg into 5.0. The goal is to make more users aware of Gutenberg and to gather more testing and feedback before the new editor lands in core. The prompt will include a prominent button that users can click to install the Gutenberg plugin, along with links for where to learn more and how to report issues.

WPTavern: Just Write: A Client-Side React App for Writing and Editing WordPress Posts

Wordpress Planet - Thu, 07/05/2018 - 18:09

WordPress developer Jason Bobich has created an open source client-side React app called Just Write that provides a decoupled editing experience for WordPress. Bobich said he built the app in 10 days to explore the possibilities of React and the WP REST API.

Although it’s still a work in progress, the app has a demo where curious testers can manage posts from any WordPress website that’s secured with HTTPS and has the JWT Authentication plugin installed. Alternatively, testers can click on the “play in the sandbox” to bypass authentication.

Once logged in, the user sees a dashboard with the most recent posts, a deliberate design decision that Bobich made to “motivate the user to do one thing – to just write.”

The editor includes support for Markdown and a simple preview with a sticky toolbar at the top. Just Write also allows the user to edit their profile and personal information in a dropdown at the top of the screen.

Bobich said he created to the app to improve his JavaScript skills and doesn’t have a plan to use it for business.

“Ever since we were all told a couple of years ago, ‘Learn JavaScript deeply,’ I’ve seen just how many holes I had in my own JavaScript knowledge,” Bobich said. “I’ve been working hard the last couple of years to become more than just a jQuery monkey. And so this project is just another step towards my personal growth surrounding the technologies involved here. It’s so exciting to think about the potential things that we can build in the community with React and the WordPress API.”

WP REST API Currently Poses Complicated Hurdles for App Developers

After the REST API was merged into core, the time seemed ripe for developers to build a proliferation of different writing experiences for users. However, working with the API still has many hurdles for application developers, limitations that Bobich said he became acquainted with while developing Just Write.

“For anyone wanting to build a practical application like this, the first glaring issue is around authentication,” Bobich said. “WordPress has no way to securely authenticate from outside of the WordPress admin. So expecting any average user to set up oAuth or JWT with a third-party plugin is a bit of a reach.”

Bobich also encountered issues working with media and saving content the WordPress way (which allows shortcodes to get parsed before wpautop()). The application is not yet ready for real, practical use but would require even more API calls to do things like get ahold of categories and tags or add the ability to create new ones.

“Think about all the work WordPress has put into the way we embed media in different ways,” Bobich said. “Just having basic things we take for granted — pasting a YouTube link, a tweet, uploading an image and having it cropped 100 ways ’til Sunday — for all work properly would all take custom JavaScript coding.”

Bobich said he thinks these limitations are the reason why there aren’t yet more applications built with decoupled editing experiences. Yet, in the new era of Gutenberg, Just Write’s alternative writing interface offers a simplicity that some users may prefer.

“As the WordPress admin continues to grow and become more complex, some people get excited and others moan and grown,” Bobich said. “But building something like Just Write shows us that there’s more to WordPress than just what we see. There’s more than a menu full of plugins and a new editor built in React that we may or may not like. WordPress can be what we want. It can fit our own needs or any client’s. And this all comes from the potential ability to decouple the editing experience.”

As WordPress has evolved to accommodate different user types from blogging, websites, and niche applications, Bobich said he thinks the next logical step is for developers to begin creating admin interfaces catered specifically to users’ individual needs.

“Gutenberg marks an important turn in the evolution,” Bobich said. “For those that were clinging to the simplicity of WordPress and blocking out some of the other noise, this might not be something they end up liking… or maybe it will?

“But the bigger point is that what we see there in the admin doesn’t have to be it. I hope people will be braver than me and really set out to build these different alternatives. If I can polish my React skills and build that myself in 10 days, I can only imagine what others can do.”

Hook 42: DrupalCamp Asheville

Main Drupal Feed - Thu, 07/05/2018 - 17:19

 

Drupal Camp Asheville is next weekend! Join members of the Drupal community of all different skill levels and career paths for 3 days of science, trainings, sessions, and sprints.

Hook 42’s own Adam Bergstein will be sharing some insights on everybody’s favorite online Drupal testing environment, Simplytest.me. He recently took over ownership of the service, and we are excited to hear about where it is going next!

Along with helping organize the camp, our newest team member, Jonathan Daggerhart, will be leading an all day training on Drupal 8 Essentials.

Dev Blog: WordPress 4.9.7 Security and Maintenance Release

Wordpress Planet - Thu, 07/05/2018 - 17:00

WordPress 4.9.7 is now available. This is a security and maintenance release for all versions since WordPress 3.7. We strongly encourage you to update your sites immediately.

WordPress versions 4.9.6 and earlier are affected by a media issue that could potentially allow a user with certain capabilities to attempt to delete files outside the uploads directory.

Thank you to Slavco for reporting the original issue and Matt Barry for reporting related issues.

Seventeen other bugs were fixed in WordPress 4.9.7. Particularly of note were:

  • Taxonomy: Improve cache handling for term queries.
  • Posts, Post Types: Clear post password cookie when logging out.
  • Widgets: Allow basic HTML tags in sidebar descriptions on Widgets admin screen.
  • Community Events Dashboard: Always show the nearest WordCamp if one is coming up, even if there are multiple Meetups happening first.
  • Privacy: Make sure default privacy policy content does not cause a fatal error when flushing rewrite rules outside of the admin context.

Download WordPress 4.9.7 or venture over to Dashboard → Updates and click “Update Now.” Sites that support automatic background updates are already beginning to update automatically.

The previously scheduled 4.9.7 is now referred to as 4.9.8, and will follow the release schedule posted yesterday.

Thank you to everyone who contributed to WordPress 4.9.7:

1naveengiri, Aaron Jorbin, abdullahramzan, alejandroxlopez, Andrew Ozz, Arun, Birgir Erlendsson (birgire), BjornW, Boone Gorges, Brandon Kraft, Chetan Prajapati, David Herrera, Felix Arntz, Gareth, Ian Dunn, ibelanger, John Blackbourn, Jonathan Desrosiers, Joy, khaihong, lbenicio, Leander Iversen, mermel, metalandcoffee, Migrated to @jeffpaul, palmiak, Sergey Biryukov, skoldin, Subrata Sarkar, Towhidul Islam, warmlaundry, and YuriV.

WordPress 4.9.7 Security and Maintenance Release

Wordpress News - Thu, 07/05/2018 - 17:00

WordPress 4.9.7 is now available. This is a security and maintenance release for all versions since WordPress 3.7. We strongly encourage you to update your sites immediately.

WordPress versions 4.9.6 and earlier are affected by a media issue that could potentially allow a user with certain capabilities to attempt to delete files outside the uploads directory.

Thank you to Slavco for reporting the original issue and Matt Barry for reporting related issues.

Seventeen other bugs were fixed in WordPress 4.9.7. Particularly of note were:

  • Taxonomy: Improve cache handling for term queries.
  • Posts, Post Types: Clear post password cookie when logging out.
  • Widgets: Allow basic HTML tags in sidebar descriptions on Widgets admin screen.
  • Community Events Dashboard: Always show the nearest WordCamp if one is coming up, even if there are multiple Meetups happening first.
  • Privacy: Make sure default privacy policy content does not cause a fatal error when flushing rewrite rules outside of the admin context.

Download WordPress 4.9.7 or venture over to Dashboard → Updates and click “Update Now.” Sites that support automatic background updates are already beginning to update automatically.

The previously scheduled 4.9.7 is now referred to as 4.9.8, and will follow the release schedule posted yesterday.

Thank you to everyone who contributed to WordPress 4.9.7:

1naveengiri, Aaron Jorbin, abdullahramzan, alejandroxlopez, Andrew Ozz, Arun, Birgir Erlendsson (birgire), BjornW, Boone Gorges, Brandon Kraft, Chetan Prajapati, David Herrera, Felix Arntz, Gareth, Ian Dunn, ibelanger, John Blackbourn, Jonathan Desrosiers, Joy, khaihong, lbenicio, Leander Iversen, mermel, metalandcoffee, Migrated to @jeffpaul, palmiak, Sergey Biryukov, skoldin, Subrata Sarkar, Towhidul Islam, warmlaundry, and YuriV.

Amazee Labs: Zurich Drupal Meetup - July

Main Drupal Feed - Thu, 07/05/2018 - 13:12
Zurich Drupal Meetup - July

We will host the next Durpal Meetup at our Amazee Labs offices in Zurich on 11 July.

Anli de Jager Thu, 07/05/2018 - 15:12

We'll focus our discussions on progressive decoupling, GraphQL, and Drupal.

So, if these topics interest you make sure to join us for an evening of great talks and collaboration.

We hope to see you there!

Date: Wednesday, 11 July 2018

Time: 6:30 PM - 9:00 PM

Venue: Amazee Labs, Förrlibuckstrasse 30, Zürich

OpenSense Labs: Drupal Commerce vs Magento: Comparison 2018

Main Drupal Feed - Thu, 07/05/2018 - 11:29
Drupal Commerce vs Magento: Comparison 2018 Shankar Thu, 07/05/2018 - 16:59

When you want to buy a new shirt from an emporium, you look for the best shop that can exhibit different pieces of nicest clothes for you to choose from. Not much has changed with the emergence of the online stores. You still strive to buy the best thing available on the best e-commerce site. Drupal Commerce and Magento offer an amazing e-commerce platform for the digital businesses to establish themselves as the best in the industry.


Drupal Commerce and Magento have different features and specifications. Determining which one is the most suited for your organization’s needs is a matter to be pondered over. To yield the best crop, comparing both of them side-by-side can give you a better picture.

A brief look at Drupal Commerce and Magento Drupal Commerce

With more than 60,000 sites powered by Drupal Commerce, a module, it is one of the most flexible e-commerce solutions for websites and applications of all sizes. Drupal 7 and Drupal 8 are the versions to be maintained and supported for the years to come. While building an online store in former will require Commerce 1.x, and for the latter Commerce 2.x.

Drupal Commerce is meritorious in various ways bringing e-retailers more traffic to drive more results. Usage statistics for Drupal Commerce from Drupal.org
  • Easy usage: It helps in the development of administration system and customised business workflow. Hence, even a person without the technical expertise can make alterations and do the testing which makes it a marketing driven commerce.
     
  • Digital experience: It enhances digital experience by incorporating commerce, content and, community and brings e-retailers more traffic.
     
  • Business-centric: It gives you the structure that you need for your online store without setting preamble and assuming your business requirements. Simply saying, it is the king of customisation.
     
  • King of content: Built on top of enterprise CMS, it offers a commerce platform to intertwine content and products seamlessly, thereby driving both online and offline sales via a wonderful UX, optimised merchandised tools, and efficient SEO techniques.
     
  • Easy configuration: With its robustness and flexibility, it is configurable to fit right for your enterprise’s needs. It is great for any sort of physical and non-physical items that demand payment models like recurring, licensing or subscription.
     
  • Cost-effective: Being an open source software, it is an affordable solution.
     
  • Adaptable: It allows third-party integrations and enhancements in the features and functionalities to adapt the changing needs of a business. Be it Authorize.net, Braintree, PayPal, Stripe, Amazon Pay and a lot of other payment gateways, it provides many integrations. Thus, it is highly extensible.
The Drupal project of Obermeyer had to encounter a lot of challenges with 3 different websites for 3 distinct audiences in addition to autonomous ERP and B2B ordering systems. Their objective was to optimise the digital processes of Obermeyer and provide an excellent digital experience through a centralised platform. By leveraging the benefits of Drupal 8 and Drupal Commerce 2.x, they built a robust enterprise ecommerce solution that could offer friction-free online shopping experience to their B2B, B2C and VIP audiences. Magento

Providing a flexible shopping cart system, Magento is another e-commerce platform that is offering online merchants a robust solution and the control over the appearance, content and, functionalities of their e-commerce websites. It provides tools for a powerful marketing, SEO and, catalog-management. Ranging from small-scale sites to the large-scale enterprise SaaS-based systems, it has wonderful platform to accommodate the needs of business requirements.

Usage statistics for Magento from BuiltWith.com

Some of the highpoints of Magento where it is advantageous is mentioned below:

  • Installation: It is very simple when it comes to installation and features additional layouts and plug-ins.
     
  • Affordable solution: It offers an efficacious and cost-effective solution being an open source software.
     
  • Payment gateways: Some of its worldwide available payment gateways are PayPal, Authorize.net, CyberSource etc.
Drupal Commerce vs Magento. Which one is the better e-commerce platform? An exhaustive and side-by-side comparison of Drupal Commerce and Magento needs to be hammered out to see where they score higher.

Metrics/Platforms

Drupal Commerce

Magento

Installation

Easy installation from the scratch

Easy installation from the ground up

Usage

Easy to learn

Steep learning curve

Content management

Can create complex content relationship

Has a basic content management system

Catalogue management

Dynamic addition or removal of products possible

Conventional way of displaying products

Mobile responsiveness

Fully responsive

Fully responsive

Features and functionalities

Great for complex online stores

Good only for simple shopping carts

Multilingual

Has in-built modules to create multilingual site

Multiple Store Views helps in building multilingual site

Administration interface

Easily customisable

Difficult to customise

Cost constraints

Being open source technology, it is absolutely free to use

Shown identity shift with newer modules not free to use

Business-driven

Can be easily integrated with multiple ventures of your business

Would require two or more independent systems to integrate with multiple ventures

SEO tools

Plethora of modules available for enabling SEO

Built-in SEO-friendly tools available

Skills required

Required minimal coding skills

Requires advanced coding skills

Integration scope

Third party integrations possible

Provision for third party integrations available

Security

Most security focussed

Relatively less secure

Installation

Drupal Commerce allows developers to install from the scratch. An installation package has to be downloaded and installed. It requires you to install Drupal CMS and then enable the Drupal Commerce module or use an installation profile to automatically enable it.

Magento allows developers to install from the ground up by providing installation package to be downloaded, loaded and installed.

Verdict: Match is drawn. No side wins this contest. Both of them offer a wonderful platform for the installation.

Usage

Having a site running on Drupal and familiarity with the Drupal features and functionalities would make your life easier in learning how to use Drupal Commerce.

Although Magento gives complete control to the users and comes with some amazing features, Magento professionals are required to fully extract its potential and use its functionalities to the fullest. Someone new to Magento may lead a tough learning curve initially.

Verdict: Thus, it has the advantage over Magento as you do not have to consume a lot of your time in learning its functionalities. Being adept with Drupal helps in learning Drupal Commerce in no time.

Content Management

Built on top of Drupal, Drupal Commerce permits you to endlessly create content types with custom fields and attributes, and cool media tools, thereby improving the editing experience. Its provision for content relationships helps you in forming a listicle consisting of related products and blog posts. Also, you can customise your landing page with optimised product lists. It is great for businesses who consider providing content as the fulcrum of their growth.

In contrast, Magento has a very basic content management system. It only allows you to add pages, some content to different categories of pages and attributes to the products. Other than this, you will step into its custom domain. This incurs heavy costs and increases ongoing support.

Verdict: Drupal Commerce is, obviously, miles ahead and hugely beneficial in this arena.

Catalog Management

A product can be dynamically added or removed from the product list automatically in Drupal Commerce. You can develop a traditional catalog-like experience and it automatically follows the way you have organized your products and uses attributes associated with them. Be it tables, grids, or lists, products can be exhibited on your website in any pluggable style with each having their own appearance and feel. This immensely helps in building user engagement.

Magento has a very conventional way of how products are organized and added to the list. You build a set of classifications in a catalog root where the products can be included. A product can fall into multiple categories depending on their type and how the users are trying to find these products. But Magento follows a strict provision for displaying products on the site. For instance, only lists and grid views are available for product listings.

Verdict: Drupal Commerce, apparently, has the upper hand in this area.

Mobile responsiveness

Drupal Commerce offers screen flexibility for building the most powerful and versatile business engine in today’s market. Drupal themes help in lending a fully responsive design for the ecommerce website.

For instance, SShop is a bootstrap based Drupal 8 theme with out-of-the-box support for Drupal Commerce. It provides multi-level responsive header menu, slideshow on the homepage, and a custom layout.

Corolla is another stupendously stylised colorable Drupal theme that comes with 6 preset colour schemes, custom colour options, mobile responsive features, and box shadow and background texture options among others.

eStore is a fully responsive, bootstrap-based Drupal theme that comes with cool functionalities like product layouts collection to scan through and choose from, slider content types, custom field additions to the Default Product Type, content types included in the configurations etc.

Magento is not far behind. It adopts responsive web design approach to craft websites that provide an optimal viewing experience across a wide range of devices. For instance, the out-of-the-box Magento Blank and Luma themes offer a fully responsive design.

Verdict: Providing a beautiful design to the site and making the responsive across devices, both the platforms are equally beneficial in this area.

Features and functionalities

One of the foremost advantages of Drupal Commerce is that it has a huge and a growing list of modules for enabling customised features and functionalities. Building a custom application and providing a wonderful digital experience thereby incorporating features that are beyond commerce, it is adaptable to changing times and business needs. Whether you need to add web services or forums, it gives you the space for adding a functionality which is entirely new.

Magento comes with a nice set of features which is really good for your online store. If you are looking at a product on the basis of its published feature set, then Magento is good for you. So, in simple words, if you just need to develop a shopping cart, opt for it.

Verdict: Hence, unlike Magento, not only a simple shopping cart, Drupal Commerce can customise your online shopping site for a wide array of needs.

Multilingual capabilities

Drupal 8 comes with out-of-the-box modules for translating the content on the website. Its built-in language handling abilities help in delivering localised digital experiences by letting you choose from 94 languages.

It also offers the individuals who work on the site - site administrators, content editors, and translators - the choice of their own language. From pages to the taxonomy terms, it can translate everything. Even the configuration of the site like blocks, panels, views etc. can be translated.

With every Magento theme, you can incorporate a multilingual storefront without a lot of trials and tribulations thereby allowing the user to switch between languages with ease.

Store Views are the store instances in the Magento platform. So, if you are running a ecommerce website with a single language, single Store View is required. For multilingual sites, it allows you to have multiple Store Views.

Verdict: Both the platforms share this arena equally and lets you run a great multilingual online store.

Administration interface

Without even making changes to the code, you can customise the admin interface as per your needs in Drupal Commerce. It lets you create screens for specific users with certain administrative actions.

Magento gives you a structured and properly defined way to govern the entire store. If you are complacent with its built-in admin interface functionalities, then it’s good for you. But if the need arises for some more features, then a lot of development effort is required to make customizations.

Verdict: With provision to choose from a huge list of Drupal modules to make the admin UX better, it should be a no-brainer of a choice that points to Drupal Commerce.

Cost constraints

Drupal is an open source technology. So, it is absolutely free to use.

In contrast Magento is showing an identity shift according to Gartner’s Magic Quadrant for Digital Commerce in 2018. It states that some newer modules in Magento are not being offered as open source. Moreover, the prospects drawn to Magento because of its strong reputation in the open source community should be careful of this tectonic shift and determine whether or not they are comfortable with this.

Verdict: Being an open source technology, Drupal Commerce clearly excels in this category. 

Business-Driven

Drupal Commerce can help make a site with any of these functionalities or all at once: a multilingual site, a multisite, community forum or an online store. So, it can integrate with multiple business platforms under one umbrella.

To integrate Magento with any other part of business ventures like forums or subscriptions, you will have to confront with two independent systems working with each other. This calls for third-party solutions to keep data between several systems in sync and up-to-date.

Verdict: Drupal Commerce clearly wins this race by miles with a wide pool of benefits for your business.

SEO tools

You can enable SEO through superabundance of modules in Drupal like Pathauto, XML Sitemap, Redirect etc.

With Magento’s out-of-the-box SEO tools, you can easily adjust URLs, meta information, and verify search terms and ranking through Google integration.

Verdict: Both of them offer a perfect platform for making the site search friendly.

Skills required

Without much coding experience, you can easily pick the basics quickly in Drupal Commerce. For someone with minimal coding knowledge, it offers modules like Views, features etc to power user interface. Even for a code genius, aforementioned modules can be really helpful.

With heavy usage of objects, inheritance, and programming concepts, someone with minimal experience of coding, may find it tough in Magento to get to the scheme of things quickly. Also, understanding and detecting Magento extension clashes can be tricky. It has an okay documentation available but active Magento community and a wide range of training and support offering can be pretty useful.

Verdict: With an active, engaging and responsive Drupal Community and a plethora of training and support services available, Drupal Commerce should be the default choice.

Integration scope

Drupal Commerce can seamlessly integrate with third-party tools. Some of the examples are: 

Magento offers support for third-party integrations too. Some of the example categories are:

  • Magento theme or template integration allows you to use third-party themes from Themeforest or TemplateMonster.
  • SMS gateway integration with third-party service providers like Kapsystem is possible in Magento
  • It also allows Payment Gateway integration with Paypal, Amazon Pay etc.
  • Magento API integrations can be done with Xero, Salesforce, Box etc.
  • It can also be integrated with leading CMS like Drupal.

Verdict: Both the platforms offer third-party integrations.

Security

Statistically proven, Drupal is the best security focussed CMS among the major CMS platforms like Wordpress, Joomla and Magento. Both the infected websites and the infection rate of Magento were much higher than that of Drupal in the Hacked Website Report from Sucuri.

Source: Sucuri.net

Verdict: Drupal is the most secure CMS and should be prioritised over Magento.

Conclusion

For the best e-commerce site, digital firms have to thrive on the e-commerce platforms for a unique and a masterclass of a website. Drupal Commerce and Magento provide a platform for setting up an e-commerce site efficiently. To understand what suits your organisation’s needs, you have to properly understand their features and functionalities to choose wisely. A side-by-side comparison delineates that Drupal Commerce has the clear edge over Magento and comes out as the winner.

We provide Drupal Commerce services to help you scale up. Contact us at hello@opensenselabs.com to gauge which platform would be the best for your enterprise needs.

blog banner blog image Drupal Commerce Magento Drupal Drupal 8 Ecommerce platform Commerce 2.0 Magento vs Drupal Drupal Commerce vs Magento Ecommerce Payment gateway Ecommerce website Content Management System CMS Mobile Responsive Multilingual Site Open Source Multisite SEO Blog Type Articles Is it a good read ? On

Pages