New Workspaces module in Drupal 8.6 and great content staging options

Parent Feed: 

Websites can be incredibly convenient and time-saving for administrators, and thus efficient for businesses. Especially when it comes to websites on Drupal 8! Its latest release, 8.6, has become a true sensation in terms of editorial experiences. In addition to such new features as the oEmbed feature, Media Library, Layout Builder improvements, there also appeared the Workspaces module in Drupal 8.6, which we want to give an overview right now. Get ready to read and enjoy! Of course, you can also upgrade to Drupal 8 or update to Drupal 8.6 with the help of our Drupal support team — and enjoy Workspaces and other new modules in action!

The purpose of the Workspaces module in Drupal 8.6

Workspaces is a new experimental module built into the Drupal 8.6 core. It lets website administrators review and edit the content and then publish unlimited amounts of it all at once.

They can switch between so-called environments, or parallel website versions. The built-in environments are “Live” and “Stage”, with “Live” as the default one. Other workspaces can also be created.

Editors can work with as many content pieces as needed while staying on the “Stage” environment. When all the content is reviewed and ready, it can be deployed to “Live” with just one magic button.

It is very convenient to see all the content just the way it will appear to visitors instead of reviewing the pieces one by one. The staged content is not visible to others until the “Deploy to Live” button brings it to “Live.”

Workspaces vs Workflows: two Drupal 8 core modules to never confuse

Workspaces module in Drupal 8 core is sometimes confused with another one for content reviewing experiences. After all, Workspaces sounds very similar to Workflows — the module introduced in Drupal 8.5. Workflows provides content approval functionality in a duet with the core Content Moderation module.

So how do Workspaces and Workflows differ?

  • Workflows in pair with Content Moderation allows editors to move the content between such states as Draft, Archived, and Published, or custom ones. It provides piece-by-piece moderation processes based on roles.
  • Workspaces, on the contrary, provides bulk moderation processes. All content is reviewed and edited in one environment and then deployed to another. This is especially efficient for content-heavy websites.

Workspaces and Workflows are not only different but also incompatible at the moment. Only one of them can be enabled in your Drupal 8 core. Otherwise, they may create collisions due to the fact they have the same entities pending approval.

An example of how the Workspaces module in Drupal 8 works

Examples are worth a thousand words, so let’s see Workspaces in action. First of all, we enable the module on the Extend page. The module is experimental, and we will see a warning about it when enabling.

how the Workspaces module in Drupal 8 works

Ok, we immediately notice the green “Live” button in the right hand corner of the site. After we click it, the stylish black Workspaces interface unfolds. It also has the “Manage workspaces” and “Edit” links under “Live”. The “Stage” button is in the left hand corner.

 Managing workspaces in Drupal 8

If we click the “Stage” button, we are offered to activate the Stage workspace, so let’s click “Confirm.” That’s the usual way to switch between the environments. The active environment is always in the right hand corner, we click on it and can call another environment in the left hand corner.

Switching between worspaces in Drupal 8

So we are now on the “Stage” workspace. Let’s create some content that no one else will see. Please mind that you will not be able to do all usual actions while in the environment other than the default one. For example, it will not possible to create content types, generate dummy content with the Devel module, and more. You will need to go to the default workspace for that. The default one is defined in workspace.services.yml as a parameter.

However, it is possible to manually create nodes of an existing content type right in the “Stage” environment, which we will do right now. We create 5 articles and edit something in them just for a test.

The Stage workspace in Drupal 8

We can see no articles when we visit our site’s main page in the Incognito window, because they are not yet deployed to “Live.” Let’s click “Deploy to Live”, and we will see a summary of the items to be deployed.

Deploying content from Stage to Live in Drupal 8

We click to confirm the deployment, and then we see the “Successful deployment” message. Looks nice!

Drupal 8 workspaces listed

Let’s now switch check the visibility of our articles in the Incognito window. The articles show already, which means they have been moved to “Live.” Our experiment with the experimental Workspaces module in Drupal 8.6 has been completed successfully!

Content deployed via Workspaces

Enjoy the new features in Drupal 8.6!

So it’s time to take everything “the great eight” has to offer — the Workspaces module in Drupal 8.6 and many other features.

For any help in upgrading to Drupal 8, updating to its latest minor version 8.6, configuring the new modules, or creating custom ones to precisely meet your needs, contact our Drupal agency!

Author: 
Original Post: