Planet Drupal

ComputerMinds.co.uk: How to import config without losing changes

3 weeks 6 days ago

Drupal empowers site builders and editors to configure their sites in settings forms. Configuration management lets developers push changes up to live sites to be imported. But developers have to be considerate to ensure imports will not wipe out those changes made directly through the live sites' settings forms. At the least, they have to export the changes before making further tweaks. But admins may make further changes in the meantime too, so developers can end up frequently pulling irrelevant changes back from live, which seems unnecessary.

Here's some examples of the kind of config that I'm thinking of:

  • The site email and Google Analytics account are usually managed by site admins, not developers. So developers should not be the ones to manage those settings.
  • Marketers may like tweaking the site name or slogan. That doesn't need to affect developers.
  • Contact forms contain labels and other text which may be key to the communication between a client and their customers.
  • Permissions - sometimes it's not clear where the lines are between editors/admins/etc, so why not allow some flexibility to reassign permissions directly on live without needing to touch the codebase?

We need an approach that allows for specific settings to be considered 'unmanaged' - so an import wouldn't touch whatever they have made to be on live. The Config Ignore project claims to solve this, but we already use Config split which is more powerful, more flexible and has a better user interface. (Although Config Ignore does allow targeting parts of config rather than whole config items.)

Config split is often used to create environment-specific sets of configuration, but its design means it can be used for separating config for other purposes. In this scenario, what's needed is a split that represents settings to be protected, which can be exported immediately before any import. Then when importing, Drupal only sees the preserved version of the settings, so won't change them, regardless of what is in the main configuration files.

The split, which I've called 'Unmanaged', needs to be set up like as follows (see screenshot):

  • Use a folder (directory) which already exists and is writable. I use ../config/unmanaged, so it matches the split name and is outside the webroot.
  • Set to active. I usually set all other splits to inactive, and only make them active in an environment's settings.php, but this split exists for the sake of workflow, not environment. For example, it can actually be useful locally, so I can tweak things for development without affecting what ends up in version control.
  • Have the largest weight of any split, so that it overrides any other exported version of config it contains.
  • Use the Conditional split section, not Complete split, to pick configuration to protect.
  • Do not tick either of the checkboxes in the conditional split section.

Once the split has been created, the container needs rebuilding for it to work. Run this, which includes exporting it for the first time:

drush cache-rebuild drush -y config-split-export unmanaged

Now that it is exported, a .htaccess file will be have been added to the directory alongside the config. Add the following line to your project's .gitignore file, adjusting the directory location as appropriate. This ensures the directory will get created on live when changes are pulled from git (containing .htaccess), but deliberately without the exported config:

config/unmanaged/*.yml

So now before running any imports, make sure to export the split:

drush -y config-split-export unmanaged drush -y config-import

With this split and the export step in place in your workflow, you can be confident of allowing your developers and site admins to get on with their respective work, without getting in each others' way. This puts configuration splits to use for something beyond environment-specific overrides, which I think is exciting. I wonder what other useful purposes they may have?

 

Photo by Sascha Hormel from Pexels

OSTraining: PHP Notices, Warnings and Errors on Your Drupal Site

3 weeks 6 days ago

Websites will run into problems. Whether you're using Drupal or any other software, there will be problems at some point.

Drupal runs on PHP and when PHP has problems, it reports them to you. 

However, often these errors will appear on your site and will be visible to visitors, as in the image below:

Agaric Collective: Build and Manage Online Donations in Drupal with the Give Module

1 month ago

So often an organization's online donation system is divorced from their website. For staff, it means one more tool to use and manage. For supporters, it can result in a donation experience that is tedious or clunky. There are free software tools like CiviCRM and CommitChange which do a good job of feeling integrated into your site, despite being a separate system. However, for smaller groups these tools can be overkill. We built the Give module to provide a lightweight donation solution built right into your Drupal site.

 

Read more and discuss at agaric.coop.

Kristian Polso: Launching Pino: a Drupal 8 Distribution for Member Management

1 month ago
Last week I published Pino: a Member Management web app built as a custom Drupal 8 distribution. With Pino, you can manage members and their metadata, send email notifications to the members and more. I have been thinking about this doing this project for some time now. I am personally a board member in several associations, and I have seen several different member management solutions. Most common of them all, is honestly just Excel.

Craft of Coding: Drupal on OpenShift: Enhancing the developer experience

1 month ago

Learn how to automate all the pieces once you deploy your first Drupal 8 site on OpenShift. We walked through a detailed Drupal 8 deployment on OpenShift. We just scratched the surface of OpenShift and didn’t explore all its features. In this post, we will further this setup by enhancing the developer experience in using OpenShift. […]

The post Drupal on OpenShift: Enhancing the developer experience appeared first on Craft of Coding.

Spinning Code: SC DUG February 2019

1 month ago

For the SC DUG meeting this month Will Jackson from Kanopi Studios gave a talk about using Docksal for local Drupal development. Will has the joy of working with some of the Docksal developers and has become an advocate for the simplicity and power Docksal provides.

We frequently use these presentations to practice new presentations, try out heavily revised versions, and test out new ideas with a friendly audience. If you want to see a polished version checkout our group members’ talks at camps and cons. So if some of the content of these videos seems a bit rough please understand we are all learning all the time and we are open to constructive feedback.

If you would like to join us please check out our up coming events on Meetup for meeting times, locations, and connection information.

OpenSense Labs: Going ultra-minimalist: Metalsmith with Drupal

1 month ago
Going ultra-minimalist: Metalsmith with Drupal Shankar Sun, 02/17/2019 - 22:22

A metalsmith sees potential where others might see trash. In his vision, a plastic bag can become a ring, the zipper can turn into a bracelet and brass platters can be metamorphosed into a striking hollow vessel. In the digital spectrum, there’s another Metalsmith which can shape a great web presence for your organisation with its amazing web development capabilities.


A combination of Metalsmith and Drupal even more fruitful with Drupal’s spectacular backend that can be used to feed data to all sorts of clients and Metalsmith’s exceptional capabilities as a static site generator.

Forging an understanding Source: Werner Glinka | Twin Cities Drupal Camp 2018

Metalsmith is not aimed at particular project types such as blogs. It supports a wide array of templates and data format options. It offers a simple plug-in architecture and is easy to get started. It uses a modular structure. Its lightweight nature and fewer dependencies make its a magnificent solution.

Metalsmith is an extremely simple, pluggable static site generator - Metalsmith.io

Static site generators create HTML code locally on the developer’s computer and all the required components are stored in a well-structured directory characterised by the strict separation of layout and content. That means a static site generator produces static build files for their deployment to a web server wherein the files are developed from source files. This is exactly the reasoning on which Metalsmith was built. Metalsmith is more than just a static site generator as everything is a plugin and Metalsmith core is an abstraction for manipulation of the file directory. It can be used for building a plethora of use cases like a project scaffolder, or an ebook generator, or even the technical docs.
 
Its working principle is simple. It takes the information from the source files of a source directory and it, then, writes the manipulated information to the files into a destination directory. The manipulations can be the translation of templates, replacement of variables, grouping files, moving files among others.
 
All the manipulations are done by plugins. Only thing Metalsmith has to take care of in its core is to offer an underlying logic of how the manipulations are confronted with and for a defined interface for the plugins. Moreover, source files are, in the nascent stage itself, converted into JavaScript objects so that plugins only do the modifications to the JavaScript objects. Moreover, Metalsmith is divided into a core and several plugins that minimises the intricacy by giving the user complete authority to use only those plugins that are needed and disseminating the task of maintaining the Metalsmith core to the Metalsmith community. Being programmed in Javascript, the need for another language like Python or Ruby is eliminated and it also has a simple plugin-interface thereby offering a simple workflow.

Metalsmith with Drupal

Twin Cities Drupal Camp 2018 had a session that demonstrated how a headless Drupal 8 installation serves content to a local Metalsmith-based static website build process. Drupal 8 turned out to be a fantastic backend CMS for serving data to all kinds of clients. Here, simply put, the local environment is the Metalsmith process uploading anything onto the Github. Once uploaded, Netlify loads it into its own process and publishes it.

Source: Werner Glinka | Twin Cities Drupal Camp 2018

Server data are leveraged for building pages dynamically at build time with the assistance of Metalsmith as the static site generator and the Nunjucks template engine. As a result, the merits of a static website as well as the magnificent backend data governance of Drupal is obtained. Drupal is only utilised for governing content in the backend and is then used to serve the content to the build process through an API.

Conclusion

Metalsmith, along with Drupal's great prowess in content governance, can be a great solution for building static sites.
 
We believe in empowering the digital firms and making their digital transformation dreams come true with our suite of services.
 
Let us know how do you want us to help you build an astounding web presence at hello@opensenselabs.com

blog banner blog image Metalsmith Drupal 8 Headless Drupal Decoupled Drupal Blog Type Articles Is it a good read ? On

Vardot: How to Rank #1 on Google Using Drupal CMS

1 month ago
Firas Ghunaim February 17, 2019

"Content is king! SEO is so 2017." Sure, why not.

Where is that king's throne? Where do you find content?

Content is found on web and mobile pages across the internet, amongst millions of millions of pages. Search Engine Optimization is about the process of being found by your content consumers and readers.

What Search Engine Optimization is not is that it's all about keywords; a common and prevalent misconception. You still need to create content that is of relevance to someone searching for it.

and of course, follow Google's rules and learn their ranking factors.

Basic stuff really.

"SEO? Gotta follow the Google machine's rules bro"

 

A critical consideration that usually escapes the decision-making process of what to use to publish that content: Which CMS suits my needs the most? 

A CMS (Content Management System) is the beating heart of your digital platform, website or experience. It is where you develop, manage and publish your content. Most websites look like Ferraris' but drive like an Austin Allegro.

Long story short, the CMS you built your site on will play a key role in your SEO efforts.

 

4 Ways Drupal CMS Enhances Your SEO

I am not here to shamelessly promote Drupal CMS (I really am though), but if you are looking to create the best digital experience for your users without bothering about on-site SEO then look no further than Drupal.

At its core, Drupal was built with SEO in mind. It has the power, flexibility, and tools needed to optimize every facet of your website for search engines, and in its huge kit of modules, there are quite a few that are dedicated to giving you an easier time when it comes to improving the optimization of your website. 

 

1. Implementing Meta tags

 

Meta tags are bits of text that are integral when it comes to improving your website’s search ranking, because, in a way, it tells search engines what the content is on each page on your website. This could be the titles of your pages to the little descriptions you see underneath the website links on a Google results page. You and your search engine need these bits of information to properly present and index your site on the search results page.

Usually, you can leave it up to your search engine to generate your page’s metadata for you, but by using the Drupal Metatag module, you can customize the metadata yourself. Set your own information such as page titles and descriptions to more properly and correctly present your site to your search engine and the online world.

 

Read More: 6 Reliable SEO Tools To Make Your Life Easier   2. Cleaning up Your URLs

 

Having bad, messy-looking links is a no-no when it comes to SEO. You want links that are easy to read and not just a jumble of letters and numbers so that they look more attractive to prospective visitors and to your search engine, who may be looking at your URL for keywords when it determines your site’s ranking.

Many web developers never realize the implications of messy URLs and leave their link syntax as-is, but going through each and every page on your website and manually setting the URLs isn’t an attractive option either. Luckily, Drupal generates clean URLs by default, improving the readability of your links and making things a bit easier on you.

If you want your links to be better and even more easy on the eyes, popular Drupal module Pathauto is a configurable system that automatically creates clean and extremely readable links that are perfect for your site’s optimization.

Another thing to keep in mind is making sure that your links actually go somewhere. Nothing sours the user experience more than clicking a link and being presented with a 404 page, and this in turn negatively affects your search rankings.

You can avoid this from happening by using the Redirect module. If you happened to have changed the page’s URL after Google indexed it, or moved the content to a different URL, this module allows you to make 301 redirects from that old link to the new one, quickly and painlessly, without having to go through the headache of cleaning up after yourself and fixing broken links.

 

3. Improving Page Speed

 

Google has been using the speed your page loads as an influencing factor in search rankings for years at this point. As they point out, sites that load faster have users that stay on for much longer, so it’s not only Google that you’re pleased by speeding up your website.

You might have to spend a little to have your website up to speed, but Drupal comes with several measures to help pages load faster, such as using BigPipe.

However, it’s not only desktop users you have to keep in mind, but mobile users, too. Given the leaps and bounds that technology has undergone in the last couple of years, you now find more and more people browsing the web on their smartphones and tablets. It’s important to make sure that your site experience is just as friendly and accessible on mobile devices as it is on desktop computers. As anyone who has used a desktop site on a mobile device knows, it’s not a pleasant experience.

Drupal’s default theme is responsive by design, which means it will display well on mobile screens of any size without having to do complicated rewrites of code or having to juggle multiple URLs to make sure your site displays correctly. With Google now also looking at the page speed of mobile sites, it’s now more important than ever to focus on delivering a good, well-optimized mobile experience to improve your SEO.

 

Read more: SEO Checklist Before Launching Your Drupal Website

 

4. Talking to Your Search Engine

 

Optimizing your website can be a little tough when you don’t even know basic things such as where your site traffic is coming from. Installing modules like Google Analytics makes you privy to such information, and for someone with their finger on the pulse of the site’s SEO, it’s perhaps one of the most important tools they can have.

With Google Analytics, you get to know things about your site visitors: Where in the world they come from, which links they followed to get to your site, which pages they visit and how much time they spend on those pages, what keywords they searched to find your page and more. If you’re concerned about SEO, then getting information about your website directly from Google, the most popular search engine in the world is valuable information to have, and can help you make decisions on what to improve on next.

And while you’re pulling information from Google about your website, you can also provide information about your website to Google in the form of an XML sitemap. These are specially formatted, condensed summaries of the pages of content on your website that you can submit to Google to help them find your site and let their bots crawl through your pages. Google can crawl through your site without an XML sitemap, but you take on the risk of them possibly missing pages.

With Drupal, generating an XML sitemap is as easy as installing the XML sitemap module which creates one for you, and modules like Cron can automatically make sure your sitemap is kept up-to-date with the latest information from your website.

Read More: Top 5 Drupal Modules For Marketers

Drupal is inherently optimized for search engines after all the whole idea behind Drupal was to enable the creation of digital experiences that are user-centric. That user includes the development team who are always aided by the open-source community of experts that provide us with awesome SEO tools such as the SEO Checklist.

You see, friend... SEO is not dead. Content's prominence just made SEO eternal.

Want to boost your site’s traffic and rank #1 on Google with Drupal? Message us through our Contact Us page, or via email at sales@vardot.com.

Aten Design Group: Flexible Authoring with Structured Content

1 month ago

As a writer or editor for your organization’s website, you should be able to quickly write articles or build pages that are collections of smaller elements. You should be able to write some text, add a slideshow, write some more text, perhaps list a few tweets, and finish things off with a list of related content. Or maybe you paste in a pull quote, add a couple full-width images with captions, or even put together an interactive timeline. Your content management system should let you do all that, easily. But chances are, it won’t be with the WYSIWYG you’re used to right now.

What You See Isn’t What You Get

WYSIWYG editors still fall short when it comes to doing much more than simple formatting and embedding a few images. Anything beyond that, and the underlying technology has to leverage some kind of proprietary “smart code” or “token” and do some find-and-replace magic that makes slideshows, media players, or other more complex blocks of content show up right to the editor. These tokens aren’t typically based on any adopted standard. It’s just this custom, arbitrary formatting shortcut that programmers decided to use that tells the CMS, “Replace this snippet with that other piece of content.”

If it sounds complicated, that’s because it is. It’s hard to get right. It’s hard to build in a sustainable way. It’s hard – impossible, really – to make it look right and work well for authors. It’s REALLY hard to migrate.

Here’s an example: In earlier versions of Drupal, Node Embed was a way to embed one piece of content (say, an image) inside the body of another (like an article). The “smart code” [[nid: 123]] tells Drupal, “replace this with the piece of content that has an ID of 123.” It worked, but the authoring experience was janky. And it really wasn’t structured content, since your markup would end up littered with these proprietary snippets referencing objects in the CMS. Somewhere down the line, someone would inevitably have to migrate all of that and write regular expressions and processors to parse it back into a sane structure for the new system. That gets expensive.

Fieldable Entities and Structured Content

The thing that lets you, the web editor, write content that is both manageable and flexible is breaking your content into discrete, single-purpose fields. In Drupal it’s called “fieldable entities.” You don’t dump everything into the WYSIWYG (which would be hard to do anyway). Instead, there’s a field to add the author’s name, a field for attaching images, and a field for the text (that last part gets the WYSIWYG). More generally, this serves an important concept called “structured content.” Content is stored in sensible chunks. It adapts to a variety of contexts, like a mobile app or a news aggregator or (of course) your website. In the case of your website, your CMS pushes all those fields through a template, and voila, the page is published beautifully and your readers eat it up.

What If My Fields Have Fields?

Here’s where it gets interesting. Back to our earlier example: let’s say your article has a couple slideshows. Each slideshow has a few images, captions, and links. Suddenly your discrete, single-purpose field (slideshow) has its own fields (images, captions, links). And, you may want to add a slideshow virtually anywhere in the flow of the page. Perhaps the page goes text, slideshow, text. Or maybe it’s text, slideshow, text, some tweets, another slideshow. And now you want to swap some things around. Again, you should be able to do all that, easily.

Drupal Paragraphs

Enter the Drupal Paragraphs module. Paragraphs takes the approach of creating content bundles, or collections of fields, that can be mixed and matched on a given page in virtually countless configurations. They’re called “Paragraphs” because they are flexible, structured building blocks for pages. The name is a little misleading; in fact, they are 100% configurable groups of fields that can be added, edited, and rearranged however you want on a given article. You can have paragraph types for slideshows, pull quotes, tweets, lists of related content, or virtually anything else. Paragraphs are building blocks: smaller elements that can be combined to build a page. And like I said earlier, you should be able to easily make pages from collections of smaller elements.

Drupal Paragraphs is Sort of Easy

We use Drupal Paragraphs whenever a particular type of content (a news article, blog post, etc.) is really built up of smaller, interchangeable collections of other fields (text, slideshows, videos, etc.). Drupal Paragraphs are flexible and organized. They let authors create whatever kinds of pages they want, while storing content in a way that is structured and adaptable. Migrations with Paragraphs are generally easier than migrations with special, proprietary embed codes. Breaking content types into Paragraphs gives authors the flexibility they need, without sacrificing structure. You don’t end up with a bunch of garbage pasted into an open WYSIWYG field.

So what’s the catch? Well, the interface isn’t awesome. Using Drupal Paragraphs can add a lot of complexity to the authoring experience. Forms will have nested forms. It can be overwhelming.

Alternatives to Drupal Paragraphs

As I’m writing this, another approach to page building is gathering momentum in the Drupal universe. Layout Builder is currently an experimental module in core, and slated to ship as a stable release with Drupal 8.7. Layout Builder provides a slick drag-and-drop interface for editors to build pages from blocks and fields. We’re excited to see how Layout Builder develops, and to see how well it performs for large editorial websites. For websites with hundreds or thousands of articles, managing pages with Layout Builder may be difficult. As Drupal’s founder, Dries Buytaert, pointed out in a post late last year, “On large sites, the free-form page creation is almost certainly going to be a scalability, maintenance and governance challenge.”

Other open source CMS communities are seeing a similar rise in the demand to provide authors with flexible page-building tools. WordPress released Gutenberg, a powerful drag-and-drop editing experience that lets authors quickly build incredibly flexible pages from a massive library of components. It’s worth noting Gutenberg is not without challenges. It poses accessibility issues. Antithetical to the themes in this post, it does not necessarily produce structured content. It relies on proprietary tokens for referencing embedded blocks of content. But it is very flexible, and offers an expressive interface for authors. For Drupal users, there’s a Drupal port for Gutenberg.

For us at Aten, the balance comes back to making sure content is stored in a way that is structured, can be adaptive, is reusable, and is relatively easy to migrate. And that you, the writer, can easily build flexible web pages.

Structured and Adaptable: Drupal Paragraphs with Layout Control

We’ve been working on an approach that keeps Paragraphs in place as the primary way content is managed and stored, but also gives authors the ability to easily control layout. Using Drupal’s core Layout Discovery system, Entity Reference with Layout is a custom field type that combines layouts and Paragraphs. It’s still in very early experimental development, but we’re excited about the impact this approach might have on making it even easier to create flexible pages. And it uses Paragraphs for content storage, with the benefits we’ve already touched on: content is well-structured and relatively easy to migrate. It’s not as flexible or robust as Layout Builder, but might be a great option for authoring flexible pages with Paragraphs. (More on this in a future post.)

Reusable and Flexible: Advanced Paragraphs

Since Drupal Paragraphs are themselves collections of flexible fields, there are all kinds of interesting ways they can be applied to building complex publishing features. We’re working with a client in publishing who needs the ability to completely customize the way content appears on their home page. They would like to promote existing content to the homepage, but they may want to override article titles, images, and summaries. Since the article authors aren’t the same people editing the home page and other key listing pages, they didn’t want authors to have to think about all of those variations. The way content is presented on an article page isn’t always the best-suited for the homepage and other contexts. We used paragraphs to give home page editors the ability to drop articles onto the page, with fields for overriding everything they need to.

Where to Go From Here

Your CMS should make it easy to write content and build pages. If you’re interested in seeing a demo of Drupal Paragraphs, Layout Builder, or Gutenberg, drop us a line. We’d love to help.

Promet Source: 4 Key Success Factors for Driving Change

1 month ago
A commercial came on the radio recently advertising a software application that would, basically, revolutionize data management and enable employees to be more efficient. My first thought was, “How can they possibly promise that when they don’t know their customers’ data management processes?” Then, it became clear. The business processes would have to be changed in order to accommodate the software. Is that appropriate? Is it right that an organization should be required to change the way it conducts business in order to implement a software application? 

OpenSense Labs: Jigsaw Puzzle of Drupal Media & 3rd Party Solutions: Can Integration Complete the Picture?

1 month ago
Jigsaw Puzzle of Drupal Media & 3rd Party Solutions: Can Integration Complete the Picture? Vasundhra Fri, 02/15/2019 - 01:13

Communication is the heart of all human interactions and the media is like the blood pumping all the necessary ideas and expressions. 

Media provides the essential link between the individual and the demands of the technological society.
-Jacques Ellul

We as individuals view hundreds of advertisement each day. Digging through that phone and eyes glued to those tabs. People like us have produced a substantial rise in marketing tactics. 

Marketing tactics such as social media, videos, search engine optimization, mobile paid media, and marketing of the emails have simulated the need for good quality content. What our minds’ decide to pay attention to depends on the interest and how compelling the advertisement or piece of content is.

It is necessary for organizations to realize their target persona, and serve up content that will bust through the clutter and hit homes with their customer.

Drupal Media can serve up this task beautifully and can do almost anything by gracefully blending digital assets in it.  

You ask how?

I say - let’s find out!

The Evolution of Media Management in Drupal 8  Drupal 8 Versions When was it introduced? What was offered? Drupal 8.2 5th October 2006  Basic out-of-the-box media handling  Drupal 8.3 6th April 2017 This brought enhanced media handling in Drupal 8. Migrating Drupal 7 File Entities to Drupal 8 Media Entities Drupal 8.4 4th October 2017 Introduction of a new Media API to the core. For site builders, Drupal 8.4 ships with the new media module i.e base media entity Drupal 8.5 7th March 2018  Supported remote video using the oEmbed format. Drupal 8.6 7th November 2018  For the content creator, richer image and media integration and digital asset management. Media Type and Best Solutions to Handle Them

Media type as we know has been generally categorized with the data content such as an application, audio content, image text message, a video stream and so on. Media type conveys the applications that in return tell them what type of application is needed for the process. Media Types like Pictures, graphics, icons, video are handled beautifully with the help of Drupal modules. 

Media types can be handled with the help of some practices :

  • Media Module Maintenance 

Modules maintenance in Drupal can be achieved with the help of distinct features and functionalities. Status report screen (which checks a variety of issues), cron (that automates the task of a website in “N” hour), caching and deployment, are some of the pieces to the whole module maintenance picture.

Media module provides a “base” entity for assets. This allows users to standardize Drupal site interactions with media resources. Local files, images, youtube video, tweets can be treated with the help of a media module. 

  • Building Distributions 

If you are setting up a Drupal site then it would typically mean being involved in downloading and configuring various contributed modules (media and non-media). To make the whole process easier there are a variety of “Pre-configured” versions of Drupal that can be downloaded and used for a specific site. These pre-configured versions of Drupal are called distributions. With these “full-featured” distributions you can easily and quickly set up a site for the specialized purpose.  

  • Site Building 

Drupal 8 comes with the most popular text editor modules and image uploader modules. These both provide the users with basic HTML controls and the power to edit the content. Text editor modules like paragraphs grant the user with a cleaner data structure. The scope of making mistakes is next to null due to the module known as the environmental indicator that helps in correcting mistakes. 

  • Custom Development 

Drupal is a collection of modules and distribution. With more and more organizations looking to build an engaging digital experience for their stakeholders, the Drupal CMS has made custom developments in its platform. The version brings significant changes in modules that help in better user experience and efficiency of the website. 

Media expectations as a content author and Site Builders  

State of Drupal 2016 survey which 2,900 people attended and participated in got the top two most requested features in terms of content creator persona.

The top two features which were adequately demanded were

  • Richer media 
  • Media integration

Thus, “media initiative” for Drupal 8 was introduced that provided with extensible base functionalities. For the media handling in the core the support of the reusable assets, media browsing, remote video with the extensible cleanliness of contributed modules were made. 

In Drupal 7 the media module was jam-packed with many functionalities. Now in Drupal 8 it has been recreated and introduced into separate modules. The three major modules which beautifully handles the media entities are named as:

Media Entity 

To store media assets, media entity modules were introduced. This module provides a base entity for the media, a very basic entity which refers to all kinds of media objects. Media entity also presented a relation between Drupal and media resource.  

Entity Embed

WYSIWYG embed support(within the text area) is allowed by the entity embed module in Drupal 8. The core consists of an editor and a filter module. This module allows a site builder to construct a button which leads an editor with the text area, hence the name “entity embed”.

Entity Browser

The entity browser module provides flexible and generic entity browsing and selection tools. It can be used in any context where one needs to select a number of entities and do something with them. The inline entity also provided with the integration of the media.

Site builders want that every type of media usage should be easily tracked and be presented to them. These three modules help them in achieving this task.

Third Party integrations for media solutions 

DAM (Digital Asset Media)

A digital asset is any text or media that is formatted into a binary source and includes the right to use it. All the digital files that do not include this right are not considered digital assets. Digital assets are categorized into images and multimedia, called media assets, and textual content and the management of these types of assets is known as Digital Asset Management. Modules like Acquia DAM, Bynder, integration module, EMBridge, S3 file sync, Q bank, Asset Bank, Media Valet, Elvis contribute to the integration of DAM and Drupal media. 

CDN (content delivery network)

CDN is a globally distributed network of proxy servers. It integrates offload static assets like images, videos, CSS and JS.

CDN like Cloudflare offers image compression and is great for content delivery network services. CDN provides several advantages over serving the traffic directly:

  1. Assets can be cached in a proxy which is geographically closer to the end users that usually leads to high download speed.
  2. Each page response is shared with the origin server and the CDN.
  3. Some of the CDN’s provides with page optimization service which further enhances the performance and also the user experience. 

To make the integration easier Drupal has a CDN module that would help in speeding up the process and make it more agile. 


External Storage 

It is not uncommon for large files and folders to get into the way of website speed. Large files are not usually cached resulting in every request to load the website slow. Drupal modules like the S3 file system, storage API, AmazonS3 contributes highly to integrate external storage. These modules manage the storage and the files in its API by providing an additional file system to your Drupal sites. 

Infrastructure 

One of the most prominent examples of integrating infrastructure is Cloudflare. It is one of the biggest networks operating on the Internet. People use Cloudflare services for the purposes of increasing the security and performance of their websites. 

A number of various solutions implemented at customers' facilities are rather large today. Often the subsystems of seemingly unified IT landscape are either loosely connected to each other or the interaction between them is ensured by file and data transfer via e-mail or from hand to hand.

When content becomes media 

Content on your website would start acting like media because let’s face it the content repository or the content that is stored in the database of the digital content is an association set of data management, search and access method allowing accessing of content. It includes

Content Pooling 

Content pooling involves the storing of the learning material in form of objects, meta-data as well as the relation which is there between them. It is the grouping up of the resources together (assets, resources etc) of the purpose of maximizing profit and minimizing risks, content pooling is done. 

Content Syndication 

Content Syndication is the building up of a suite of Drupal site that needs a way to consume content from a central Drupal source. The CMS provides a number of splendid tools to simplify content creation and moderation. The users can create content once and make it available everywhere. Push content and media items at any sites to publish them on any targeted remote site. 

Deploy

This module of Drupal 8 allows the user to easily stage and preview content on all Drupal sites. It automatically manages dependencies between entities and is specially designed for rich API which can easily be extended. 

Contenta CMS 

The main agenda of Contenta CMS was to make the content happy. It is a community-driven API first distribution for Drupal 8 which provides users with a standard platform alongside the content. Contenta CMS is all about easing the pain of its users. It builds decoupled applications and websites. 

Beyond version 8 

Drupal 8 was launched without the support of the media library. Thus, the addition of the media library is planned to be launched in Drupal 8. The developers have been currently working on adding a media library to Drupal 8 so that the content authors can select pre-existing media from a library and easily embed them in their posts. Once the media library becomes stable, the content authors can deprecate the use of the old file upload functionality and make the new media library the default experience.

Instead of working on Drupal 9 as a separate code base, it is planned to be launched in Drupal 8 which means that new functionalities are being added on the backward compatibility code along with the experimental features. For contributed module authors, Drupal 9 is working on compatibilities (Before the release of Drupal 9 the users are allowed to update their media module for the new media library) 

Source: Dries Buytaert's blogConclusion

As the world is getting more and more involved in the act of media, the need for handling it has become really important. 

Media is important because it allows the people to transmit information to a larger audience, over a greater length of time. The importance of the media today is immense. Never before in mankind's history have the media had such an influence. 

Yes, Drupal has come a long way in this sector. Contact us on hello@opensenselabs.com to know more about the media handling in your Drupal sites and the services which are provided by us.

blog banner blog image Drupal Drupal 8 CMS Media Media Management Media Solutions Digital Asset Management Content Delivery Network External Storage Content Syndication Content Pooling Blog Type Articles Is it a good read ? On

Drudesk: A glimpse at Drupal 8 and Vue.js combination

1 month ago

The trend of using JavaScript frameworks with Drupal keeps gaining popularity. It is used for creating rich, fast, and interactive web interfaces. One of the hot use areas is decoupled (headless Drupal 8) architecture, with the front-end part completely entrusted to a JS framework. There are many JS frameworks and libraries that pair well with Drupal 8 — React, Angular, Gatsby, Ember, Elm etc. Today, we will review one of them — Vue.js. Let’s take a closer look at Drupal 8 and Vue.js combination.

Sooper Drupal Themes: Sooperthemes 2015-2018 Retrospective: Crafting Enterprise-Ready Solutions For A Better Drupal Experience

1 month ago

As of today Sooperthemes provides the only proven enterprise-grade drag and drop Drupal builder, and framework theme. Examples proving this point are sites being rolled out by the United NationsGoogle, and by the US Senate for all newly inaugurated senators!

3 years ago, Sooperthemes started developing Drupal tools in a novel way: developing every tool as a platform. This resulted in our theme agnostic Glazed Builder drag and drop solution, and our  Glazed framework theming platform. Throughout the years, Sooperthemes has evolved to become much more than just a theme shop. While we still provide a gallery of premium Drupal designs that can be found on our website, we now focus our efforts towards developing solutions rather than tools that bring great value to all Drupal users, organizations, governments, and enthusiasts worldwide.

At Sooperthemes we believe that building web content should be an easy and approachable process for anyone, even for people who aren't necessarily tech savvy. With this idea in mind we are headed on a mission: To empower Drupal users with the necessary capabilities to build high-end responsive websites as well as help experienced site builders and organizations work faster through development automation. 

Sooperthemes today

Our Glazed framework theme allows users to have control over every aspect of a Drupal site: from typography to colors, grid design and navigation. Combine this with our Drag and Drop builder and everything you need on a professional website can be designed and developed directly in the browser. This empowers your marketing and design staff to work efficiently without incurring heavy IT costs. 

When you take look at Drupal competitors such as WordPress and cloud based solutions like Squarespace, one of the main reasons they successfully skyrocketed in the web development industry is because of the simple front-end editing experience and the value this experience brings to the users. Glazed Builder brings this modern site-building experience to the Drupal world by combining the power and unique aspects of Drupal with the simplicity and intuitiveness of Drag and Drop technology. 

Glazed Builder is different from Wix, Squarespace, or any other Drag and Drop builders: it's made for Drupal and deeply integrated with Drupal APIs. It acts as a Drupal field formatter and you can have multiple instances per page, for your footer, main content, blocks, and even custom entity types. It automatically understands Drupal's revision system, language systems, workflow states, and permissions. This makes it one of the most advanced visual page builders in the world from a website architecture perspective.

How Sooperthemes products create a better Drupal experience 

Drag and Drop tools have evolved to be more powerful, produce better code, and leverage frontend frameworks to create a fluent authoring experience that runs in the browser. In Glazed Builder this experience is integrated with Views and the block systems: you can create highly dynamic pages and even dashboards with Drag and Drop, without losing reusability of the components you build. It is available for both Drupal 8 and Drupal 7, and provides the tools to easily perform difficult customization tasks. It lets the user focus on creating value for the customers and leave the technical aspects behind. It's intuitive and easy to use out of the box. 

Adding Glazed Builder on top of your existing Drupal 8 stack

Glazed Builder is theme agnostic, meaning it can plug directly into your existing site infrastructure and is compatible with any theme. You don’t necessarily have to use our Glazed Theme, you can add the Glazed Builder module directly on your website and get the same benefits you get from installing it on a Sooperthemes theme. Moreover, Sooperthemes products are built by developers who have 12+ years of experience working with Drupal and you don't have to worry about shortcodes or vendor lock-in when you use the product. 

Role based user profiles to customize the Glazed Builder interface

As a site administrator you can limit what users with specific Drupal roles see in their Glazed interface using the Glazed Builder profiles editor. You have total control over who has access to specific Glazed Builder elements, Drupal blocks, Views display and text editor buttons. This allows for a smooth workflow for your web team, giving them access to the tools that are relevant specifically to their tasks. While removing all elements and features that can distract them.

Front end development

When you add or change content on a page, you can see and experience what your visitor is going to see when browsing your website. Working from the front end allows you to focus on building amazing experiences and engage your audience on a deeper level by producing and designing valuable content for your audience. The freedom to leverage and shape your perfect web page is at your fingertips, the limit is your creativity and the way you use the tools.

Save time & reduce IT costs

Using Glazed products will save you precious time on a daily basis. Tasks that previously needed a developer's assistance and would take hours can now be performed directly in the front-end within minutes. Moreover, editing or adding new content to your website is just a couple of clicks away. IT costs savings come from automating technical challenges in designing websites and crafting high quality content. 

Marketing & SEO Tools

Glazed Builder empowers your marketing team by giving them the freedom to be creative. Designing landing pages that convert, personalized call to action buttons, including and editing global blocks are just few of the many features Glazed Builder has to offer. Moreover Glazed comes pre-installed with a number of 35 ready-to-go elements for building any type of content. The elements are divided into four categories: layout elements, content elements, media elements and interactive elements. Every element is fully customizable and can be personalized to meet the website’s overall design feel and your marketing strategy. Any type of content you create on your website is mobile-friendly right away. SEO managed right within the builder. You can easily add alt and title text to images, fully control your header tags, always get clean markup and fast performance. Our clean markup makes it easier for you to rank above your competitors in Google search results.

What's next for Sooperthemes?

After just uploading new 11 tutorial videos to the Sooperthemes YouTube channel I'm looking back at our first videos and see a lot of improvement. We're going to continue focussing even more on video content. Documentation is something very difficult to get right but when you do get it right it's very rewarding. 

In 2019 we're also going to develop more advanced features and integration for our core products. Glazed Builder is going to get more capabilities geared to large enterprise users and Glazed theme is simply in need of constant updates just in order to keep up with design trends. The power of the Glazed theme framework is that you can keep the same theme for 5 years and instead of having a dated looking website at the end of the line you can just update some settings and get right look for your brand.

A big milestone we're going to be working towards is a Bootstrap 4 update, probably coming in Q3 or Q4. Right now our customers are successful with Bootstrap 3 so it's not an urgent issue but eventually Bootstrap 4 will become the new standard across the Drupal community.

3 years ago when just releasing Glazed Builder the product was received well by early adopters and considered an "awesome tool". 3 years later we're seeing mainstream adoption and clients describing Glazed Builder as "basically a must-have to start a Drupal project". We hope to continue playing an important role to the Drupal community, as well as presenting a more modern and capable Drupal to potential Drupal adopters outside the community!

OPTASY: Easy Page Speed Audit: How to Improve the Perceived Performance of Your Drupal Site

1 month ago
Easy Page Speed Audit: How to Improve the Perceived Performance of Your Drupal Site radu.simileanu Thu, 02/14/2019 - 09:10

How do you run a page speed audit from a user experience standpoint? For, let's face it: website performance is user experience! 

What are the easiest and most effective ways to measure your Drupal website's performance? What auditing tools should you be using? How do you identify the critical metrics to focus your audit on?

And, once identified, how do you turn the collected data into speed optimization decisions? Into targeted performance improvement solutions...

Also, how fast is “ideally fast”, in the context of your competition's highest scores and of your users' expectations?

Here are the easiest steps of an effective page performance audit, with a focus on the prompt actions you could take for improving it.
 

Dries Buytaert: Optimizing site performance by reducing JavaScript and CSS

1 month ago

I've been thinking about the performance of my site and how it affects the user experience. There are real, ethical concerns to poor web performance. These include accessibility, inclusion, waste and environmental concerns.

A faster site is more accessible, and therefore more inclusive for people visiting from a mobile device, or from areas in the world with slow or expensive internet.

For those reasons, I decided to see if I could improve the performance of my site. I used the excellent https://webpagetest.org to benchmark a simple blog post https://dri.es/relentlessly-eliminating-barriers-to-growth.

The image above shows that to render that page, it took a browser 0.722 seconds to download and render the page (see blue vertical line):

  • The first 210 milliseconds are used to set up the connection, which includes the DNS lookup, TCP handshake and the SSL negotiation.
  • The next 260 milliseconds (from 0.21 seconds to 0.47 seconds) are spent downloading one HTML file, two CSS files and one JavaScript file.
  • After everything is downloaded, the final 330 milliseconds (from 0.475 seconds to 0.8 seconds) are used to layout the page, execute the JavaScript code and download the Favicon.

By most standards, 0.722 seconds is pretty fast. In fact, according to HTTP Archive, it takes more than 2.4 seconds to download and render the average web page on a desktop.

Regardless, I noticed that the length of the horizontal green bars and the horizontal yellow bar was relatively long compared to that of the blue bar. In other words, a lot of time is spent downloading JavaScript (yellow horizontal bar) and CSS (two green horizontal bars) instead of the HTML, including the actual content of the blog post (blue bar).

To fix, I did two things:

  1. Use vanilla JavaScript. I replaced my jQuery-based JavaScript with vanilla JavaScript. Without impacting the functionality of my site, the amount of JavaScript went from almost 45 KB to 699 bytes, good for a savings of over 6,000 percent.
  2. Conditionally include CSS. For example, I use Prism.js for syntax highlighting code snippets in blog posts. prism.css was downloaded for every page request, even when there were no code snippets to highlight. Using Drupal's render system, it's easy to conditionally include CSS. By taking advantage of that, I was able to reduce the amount of CSS downloaded by 90 percent — from 4.7 KB to 2.5 KB.

According to the January 1st, 2019 run of HTTP Archive, the median page requires 396 KB of JavaScript and 60 KB of CSS. I'm proud that my site is well under these medians.

File type Dri.es before Dri.es after World-wide median JavaScript 45 KB 669 bytes 396 KB CSS 4.7 KB 2.5 KB 60 KB

Because the new JavaScript and CSS files are significantly smaller, it takes the browser less time to download, parse and render them. As a result, the same blog post is now available in 0.465 seconds instead of 0.722 seconds, or 35% faster.

After a new https://webpagetest.org test run, you can clearly see that the bars for the CSS and JavaScript files became visually shorter:

To optimize the user experience of my site, I want it to be fast. I hope that others will see that bloated websites can come at a great cost, and will consider using tools like https://webpagetest.org to make their sites more performant.

I'll keep working on making my website even faster. As a next step, I plan to make pages with images faster by using lazy image loading.

Drupal blog: Headless CMS: REST vs JSON:API vs GraphQL

1 month ago

This blog has been re-posted and edited with permission from Dries Buytaert's blog.

The web used to be server-centric in that web content management systems managed data and turned it into HTML responses. With the rise of headless architectures a portion of the web is becoming server-centric for data but client-centric for its presentation; increasingly, data is rendered into HTML in the browser.

This shift of responsibility has given rise to JavaScript frameworks, while on the server side, it has resulted in the development of JSON:API and GraphQL to better serve these JavaScript applications with content and data.

In this blog post, we will compare REST, JSON:API and GraphQL. First, we'll look at an architectural, CMS-agnostic comparison, followed by evaluating some Drupal-specific implementation details.

It's worth noting that there are of course lots of intricacies and "it depends" when comparing these three approaches. When we discuss REST, we mean the "typical REST API" as opposed to one that is extremely well-designed or following a specification (not REST as a concept). When we discuss JSON:API, we're referring to implementations of the JSON:API specification. Finally, when we discuss GraphQL, we're referring to GraphQL as it used in practice. Formally, it is only a query language, not a standard for building APIs.

The architectural comparison should be useful for anyone building decoupled applications regardless of the foundation they use because the qualities we will evaluate apply to most web projects.

To frame our comparisons, let's establish that most developers working with web services care about the following qualities:

  1. Request efficiency: retrieving all necessary data in a single network round trip is essential for performance. The size of both requests and responses should make efficient use of the network.
  2. API exploration and schema documentation: the API should be quickly understandable and easily discoverable.
  3. Operational simplicity: the approach should be easy to install, configure, run, scale and secure.
  4. Writing data: not every application needs to store data in the content repository, but when it does, it should not be significantly more complex than reading.

We summarized our conclusions in the table below, but we discuss each of these four categories (or rows in the table) in more depth below. If you aggregate the colors in the table, you see that we rank JSON:API above GraphQL and GraphQL above REST for Drupal core's needs.

REST JSON:API GraphQL Request efficiency Poor; multiple requests are needed to satisfy common needs. Responses are bloated. Excellent; a single request is usually sufficient for most needs. Responses can be tailored to return only what is required. Excellent; a single request is usually sufficient for most needs. Responses only include exactly what was requested. Documentation, API explorability and schema Poor; no schema, not explorable. Acceptable; generic schema only; links and error messages are self-documenting. Excellent; precise schema; excellent tooling for exploration and documentation. Operational simplicity Acceptable; works out of the box with CDNs and reverse proxies; few to no client-side libraries required. Excellent; works out of the box with CDNs and reverse proxies, no client-side libraries needed, but many are available and useful. Poor; extra infrastructure is often necessary client side libraries are a practical necessity, specific patterns required to benefit from CDNs and browser caches. Writing data Acceptable; HTTP semantics give some guidance but how specifics left to each implementation, one write per request. Excellent; how writes are handled is clearly defined by the spec, one write per request, but multiple writes is being added to the specification. Poor; how writes are handled is left to each implementation and there are competing best practices, it's possible to execute multiple writes in a single request.

If you're not familiar with JSON:API or GraphQL, I recommend you watch the following two short videos. They will provide valuable context for the remainder of this blog post:

Request efficiency

Most REST APIs tend toward the simplest implementation possible: a resource can only be retrieved from one URI. If you want to retrieve article 42, you have to retrieve it from https://example.com/article/42. If you want to retrieve article 42 and article 72, you have to perform two requests; one to https://example.com/article/42 and one to https://example.com/article/72. If the article's author information is stored in a different content type, you have to do two additional requests, say to https://example.com/author/3 and https://example.com/author/7. Furthermore, you can't send these requests until you've requested, retrieved and parsed the article requests (you wouldn't know the author IDs otherwise).

Consequently, client-side applications built on top of basic REST APIs tend to need many successive requests to fetch their data. Often, these requests can't be sent until earlier requests have been fulfilled, resulting in a sluggish experience for the website visitor.

GraphQL and JSON:API were developed to address the typical inefficiency of REST APIs. Using JSON:API or GraphQL, you can use a single request to retrieve both article 42 and article 72, along with the author information for each. It simplifies the developer experience, but more importantly, it speeds up the application.

Finally, both JSON:API and GraphQL have a solution to limit response sizes. A common complaint against typical REST APIs is that their responses can be incredibly verbose; they often respond with far more data than the client needs. This is both annoying and inefficient.

GraphQL eliminates this by requiring the developer to explicitly add each desired resource field to every query. This makes it difficult to over-fetchdata but easily leads to very large GraphQL queries, making (cacheable) GET requests impossible.

JSON:API solves this with the concept of sparse fieldsets or lists of desired resource fields. These behave in much the same fashion as GraphQL does, however, when they're omitted JSON:API will typically return all fields. An advantage, though, is that when a JSON:API query gets too large, sparse fieldsets can be omitted so that the request remains cacheable.

REST JSON:API GraphQL Multiple data objects in a single response Usually; but every implementation is different (for Drupal: custom "REST Export" view or custom REST plugin needed). Yes Yes Embed related data (e.g. the author of each article) No Yes Yes Only needed fields of a data object No Yes; servers may choose sensible defaults, developers must be diligent to prevent over-fetching. Yes; strict, but eliminates over-fetching, at the extreme, it can lead to poor cacheability. Documentation, API explorability and schema

As a developer working with web services, you want to be able to discover and understand the API quickly and easily: what kinds of resources are available, what fields does each of them have, how are they related, etc. But also, if this field is a date or time, what machine-readable format is the date or time specified in? Good documentation and API exploration can make all the difference.

REST JSON:API GraphQL Auto-generated documentation Depends; if using the OpenAPI standard. Depends; if using the OpenAPI standard (formerly, Swagger). Yes; various tools available. Interactivity Poor; navigable links rarely available. Acceptable; observing available fields and links in its responses enable exploration of the API. Excellent; autocomplete feature, instant results or compilation errors, complete and contextual documentation. Validatable and programmable schema. Depends; if using the OpenAPI standard. Depends; the JSON:API specification defines a generic schema, but a reliable field-level schema is not yet available. Yes; a complete and reliable schema is provided (with very few exceptions).

GraphQL has superior API exploration thanks to GraphiQL (demonstrated in the video above), an in-browser IDE of sorts, which lets developers iteratively construct a query. As the developer types the query out, likely suggestions are offered and can be auto-completed. At any time, the query can be run and GraphiQL will display real results alongside the query. This provides immediate, actionable feedback to the query builder. Did they make a typo? Does the response look like what was desired? Additionally, documentation can be summoned into a flyout, when additional context is needed.

On the other hand, JSON:API is more self-explanatory: APIs can be explored with nothing more than a web browser. From within the browser, you can browse from one resource to another, discover its fields, and more. So, if you just want to debug or try something out, JSON:API is usable with nothing more than cURL or your browser. Or, you can use Postman (demonstrated in the video above) — a standalone environment for developing on top of an anyHTTP-based API. Constructing complex queries requires some knowledge, however, and that is where GraphQL's GraphiQL shines compared to JSON:API.

Operational simplicity

We use the term operational simplicity to encompass how easy it is to install, configure, run, scale and secure each of the solutions.

The table should be self-explanatory, though it's important to make a remark about scalability. To scale a REST-based or JSON:API-based web service so that it can handle a large volume of traffic, you can use the same approach websites (and Drupal) already use, including reverse proxies like Varnish or a CDN. To scale GraphQL, you can't rely on HTTP caching as with REST or JSON:API without persisted queries. Persisted queries are not part of the official GraphQL specification but they are a widely-adopted conventionamongst GraphQL users. They essentially store a query on the server, assign it an ID and permit the client to get the result of the query using a GETrequest with only the ID. Persisted queries add more operational complexity, and it also means the architecture is no longer fully decoupled — if a client wants to retrieve different data, server-side changes are required.

REST JSON:API GraphQL Scalability: additional infrastructure requirements Excellent; same as a regular website (Varnish, CDN, etc). Excellent; same as a regular website (Varnish, CDN, etc). Usually poor; only the simplest queries can use GET requests; to reap the full benefit of GraphQL, servers needs their own tooling. Tooling ecosystem Acceptable; lots of developer tools available, but for the best experience they need to be customized for the implementation. Excellent; lots of developer tools available; tools don't need to be implementation-specific. Excellent; lots of developer tools available; tools don't need to be implementation-specific. Typical points of failure Fewer; server, client. Fewer; server, client. Many; server, client, client-side caching, client and build tooling. Writing data

For most REST APIs and JSON:API, writing data is as easy as fetching it: if you can read information, you also know how to write it. Instead of using the GET HTTP request type you use POST and PATCH requests. JSON:API improves on typical REST APIs by eliminating differences between implementations. There is just one way to do things and that enabled better, generic tooling and less time spent on server-side details.

The nature of GraphQL's write operations (called mutations) means that you must write custom code for each write operation; unlike JSON:API the specification, GraphQL doesn't prescribe a single way of handling write operations to resources, so there are many competing best practices. In essence, the GraphQL specification is optimized for reads, not writes.

On the other hand, the GraphQL specification supports bulk/batch operations automatically for the mutations you've already implemented, whereas the JSON:API specification does not. The ability to perform batch write operations can be important. For example, in our running example, adding a new tag to an article would require two requests; one to create the tag and one to update the article. That said, support for bulk/batch writes in JSON:APIis on the specification's roadmap.

REST JSON:API GraphQL Writing data Acceptable; every implementation is different. No bulk support. Excellent; JSON:API prescribes a complete solution for handling writes. Bulk operations are coming soon. Poor; GraphQL supports bulk/batch operations, but writes can be tricky to design and implement. There are competing conventions. Drupal-specific considerations

Up to this point we have provided an architectural and CMS-agnostic comparison; now we also want to highlight a few Drupal-specific implementation details. For this, we can look at the ease of installation, automatically generated documentation, integration with Drupal's entity and field-level access control systems and decoupled filtering.

Drupal 8's REST module is practically impossible to set up without the contributed REST UI module, and its configuration can be daunting. Drupal's JSON:API module is far superior to Drupal's REST module at this point. It is trivial to set up: install it and you're done; there's nothing to configure. The GraphQL module is also easy to install but does require some configuration.

Client-generated collection queries allow a consumer to filter an application's data down to just what they're interested in. This is a bit like a Drupal View except that the consumer can add, remove and control all the filters. This is almost always a requirement for public web services, but it can also make development more efficient because creating or changing a listing doesn't require server-side configuration changes.

Drupal's REST module does not support client-generated collection queries. It requires a "REST Views display" to be setup by a site administrator and since these need to be manually configured in Drupal; this means a client can't craft its own queries with the filters it needs.

JSON:API and GraphQL, clients are able to perform their own content queries without the need for server-side configuration. This means that they can be truly decoupled: changes to the front end don't always require a back-end configuration change.

These client-generated queries are a bit simpler to use with the JSON:API module than they are with the GraphQL module because of how each module handles Drupal's extensive access control mechanisms. By default JSON:API ensures that these are respected by altering the incoming query. GraphQL instead requires the consumer to have permission to simply bypass access restrictions.

Most projects using GraphQL that cannot grant this permission use persisted queries instead of client-generated queries. This means a return to a more traditional Views-like pattern because the consumer no longer has complete control of the query's filters. To regain some of the efficiencies of client-generated queries, the creation of these persisted queries can be automated using front-end build tooling.

REST JSON:API GraphQL Ease of installation and configuration Poor; requires contributed module REST UI, easy to break clients by changing configuration. Excellent; zero configuration! Poor; more complex to use, may require additional permissions, configuration or custom code. Automatically generated documentation Acceptable; requires contributed module OpenAPI. Acceptable; requires contributed module OpenAPI. Excellent; GraphQL Voyager included. Security: content-level access control (entity and field access) Excellent; content-level access control respected. Excellent; content-level access control respected, even in queries. Acceptable; some use cases require the consumer to have permission to bypass all entity and/or field access. Decoupled filtering (client can craft queries without server-side intervention) No Yes Depends; only in some setups and with additional tooling/infrastructure. What does this mean for Drupal's roadmap?

Drupal grew up as a traditional web content management system but has since evolved for this API-first world and industry analysts are praising us for it.

As Drupal's project lead, I've been talking about adding out-of-the-box support for both JSON:API and GraphQL for a while now. In fact, I've been very bullish about GraphQL since 2015. My optimism was warranted; GraphQL is undergoing a meteoric rise in interest across the web development industry.

Based on this analysis, for Drupal core's needs, we rank JSON:API above GraphQL and GraphQL above REST. As such, I want to change my recommendation for Drupal 8 core. Instead of adding both JSON:API and GraphQL to Drupal 8 core, I believe only JSON:API should be added. That said, Drupal's GraphQL implementation is fantastic, especially when you have the developer capacity to build a bespoke API for your project.

On the four qualities by which we evaluated the REST, JSON:API and GraphQL modules, JSON:API has outperformed its contemporaries. Its web standards-based approach, its ability to handle reads and writes out of the box, its security model and its ease of operation make it the best choice for Drupal core. Additionally, where JSON:API underperformed, I believe that we have a real opportunity to contribute back to the specification. In fact, one of the JSON:API module's maintainers and co-authors of this blog post, Gabe Sullice (Acquia), recently became a JSON:API specification editor himself.

This decision does not mean that you can't or shouldn't use GraphQL with Drupal. While I believe JSON:API covers the majority of use cases, there are valid use cases where GraphQL is a great fit. I'm happy that Drupal is endowed with such a vibrant contributed module ecosystem that provides so many options to Drupal's users.

I'm excited to see where both the JSON:API specification and Drupal's implementation of it goes in the coming months and years. As a first next step, we're preparing the JSON:API to be added to Drupal 8.7.

Special thanks to Wim Leers (Acquia) and Gabe Sullice (Acquia) for co-authoring this blog post and to Preston So (Acquia) and Alex Bronstein(Acquia) for their feedback during the writing process.

 February 11, 2019

 11 min read time

 Permalink

Blair Wadman: Easy way to find the Drush command you are looking for

1 month ago

Both Drush and Console have built-in help. If you type drush, you will get a long list of available commands. If you type drupal, again you will get a long list of available console commands. If you can’t remember the exact command to use to do what you need, you can scroll through the long list of commands to find the one you want.

Drupal Association blog: Keeping up to date with information for Drupal Event Organizers

1 month ago

The events that every year bring us together all over the World are the lifeblood of our vibrant and diverse community. From BADCamp in California, USA, through Global Training Days in Omsk, Russia to Contribution Weekends in Leeds, UK, we have a combined wealth of knowledge and experiences but also challenges and opportunities.

At the Drupal Association, we value highly the commitment made by those who volunteer their time to make these events happen. If I wasn’t British, and therefore terribly understated, at this point I would probably say “You rock!”.

As an event organiser, I wanted to take the opportunity to bring to your attention a few things happening in the community that we hope will help you in your efforts.

The Event Organizers’ Group

We were very pleased to see the creation of a growing group of event organizers forming and beginning to have regular meetings to share experiences and resources. One of its founders, Kaleem Clarkson, has blogged about this and their plans for the future.

To help with their formation, we helped them become one of the first groups to create one of the new Community Group Sections at Drupal.org/community/event-organizers.

One thing that is super important, though, is that this group has representation by event organizers from all around the World. Wherever you live, do join this group, make your voice heard and ensure that it meets in a way that works for you.

The Event Organizers’ Round Table with Dries Buytaert

One of the requests we had from the group was to be able to spend more time discussing their aims with the Project founder, Dries Buytaert.

Dries agreed that spending quality time with representatives of such a key part of our community was highly valuable, so we have created a round table at DrupalCon Seattle 2019 to which event organizers will be invited to attend and participate.

The invites will be sent to the mailing segment introduced below - make sure you read on!


Image of Dries taking notes from a previous Round Table, courtesy Baddý Sonja Breidert

A mailing list segment especially for event organizers

To ensure that we can alert event organizers to activities like the above, we have created a special segment in our mailing list system that allows us to send updates to only those that want to hear about them.

If you are an Event Organizer, or looking to become one in the future, I highly recommend you visit your user profile on Drupal.org and check the box “Contact me regarding local organizing (camps, groups, etc.)”

For the above mentioned Round Table with Dries Buytaert, we will be sending invites to member of this mailing list so make sure you are on it!

Checked
1 hour 34 minutes ago
Drupal.org - aggregated feeds in category Planet Drupal
Subscribe to Planet Drupal feed