Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: HeCAPTe 1.0.2 — Minor update available for module hecapte_captcha (1.0.2). Release: Attribution & Licensing 1.2.1 — Minor update available for module attribution (1.2.1). Release: MCP Sentinel 2.29.0 — Minor update available for module mcp_sentinel (2.29.0). Release: Audit Chain 1.10.9 — Minor update available for module audit_chain (1.10.9). Release: Menu Autopilot 1.4.7 — Minor update available for module menu_autopilot (1.4.7). Release: FileGate 1.11.3 — Minor update available for module file_gate (1.11.3). Release: Download Tracker 1.0.7 — Minor update available for module download_tracker (1.0.7). Release: Directory2Block Slideshow 1.0.8 — Minor update available for module directory2block_slideshow (1.0.8). Module Revived: Swagger-PHP OpenAPI 3 documentation generator 1.0.0 — Module swagger_php updated after 10 months of inactivity (1.0.0). Security Coverage: Microsoft Azure AI — Module ai_provider_azure now has official Drupal security advisory coverage.

The Beta Site module's core function is to provide Drupal with the ability to host the same content with different paths at a "beta" sub-domain. Using the included sub-modules, editors can also test new or alternate layouts for their content, new blocks, new templates, etc. using the beta sub-domain all while leaving their content displaying normally at the default domain.

This project is the result of a need to restructure a large Drupal site, primarily from an Information Architecture standpoint. The module allows site owners to rearrange and restructure their content for the beta sub-domain while leaving current structures intact for the default domain.

When accessing the site using the beta sub-domain, all the links within the site are rewritten using the using the alternate, beta paths. This includes menus and all links which are dynamically created. The included sub-modules optionally extend active trail handling so that breadcrumbs and menus function as normal when accessing the beta site.

A block visibility plugin and a service is provided which can be used to alter other site content being accessed at the beta sub-domain. The core RequestPath block visibility condition is also altered to support the beta paths. This allows site owners to swap out blocks when accessing their sites with the beta sub-domain, e.g. have a different main menu for default vs. beta.

Site owners can use these features to allow previewing and beta testing of new features all while still being able to maintain their content within a single site, even directly on production environments.

The Beta Site module was created with the intent of integrating with Layout Builder. When using the complimentary modules listed below, Beta Site is a game-changer for Drupal, allowing editors to test their content in any layout while on beta and then launch at-will, simply by changing a field value. This alleviates the need to deal with development environments and copying content/media back and forth.

Additional Features

  • Includes a handy sub-module which provides a block that indicates if you're on beta or not with a link to allow toggling back and forth
  • Robots nofollow metatag added on pages accessed with beta sub-domain
  • Integration with RobotsTxt to set Disallow: / when site is accessed with beta sub-domain
  • Integration with Single Content Sync to provide node import/export functionality and preserve view mode selections
  • Integration with Menu Breadcrumb to support beta paths
  • Integration with Menu Trail By Path to support beta paths
  • Beta Site Switches sub-module that provides a UI to allow site owners to define switches for site features and set them to display for either the default domain, beta sub-domain, or both and a Twig extension is included for switching out features in templates - This is a port of the Switches module by Stephen Lucero

Complimentary Modules

  • View Mode Switch Field

    This module provides a new field type for storing view mode selections. It compliments Beta Site by allowing editors to select which view mode their content renders with when accessing the content at the beta domain.

  • Layout Builder Overrides

    This module extends Drupal to allow non-default view mode layouts to be overridden. This allows editors to have some nodes which deviate from a default layout, per view mode.

    Related issues: #2907413, #3002000, #3083754

Installation and Usage

  1. Ensure your webserver configuration allows your site to be accessed using a "beta" sub-domain, e.g. beta.mydomain.com. Drupal allows this by default, so there's no special configuration needed with it as long as the same document root directory is used. Production or public dev/testing environments will likely require a DNS entry for the beta sub-domain. Local users may need to add an entry to the hosts file or a value in the config.yml file for additional_hostnames when using DDEV.
  2. Install the module using "composer require drupal/betasite"
  3. Enable the module using the UI or "drush en betasite"
  4. Edit nodes and add values in the new "Beta URL alias" input field
  5. When you visit the site with the beta sub-domain, you should see the links to the nodes updated to use the new aliases in menus
  6. Use the new "Hostname" condition in the blocks UI to define which blocks should be shown or hidden when the site is accessed with the beta sub-domain
  7. Enable the "Beta Site Toggle Block" module (drush en betasite_toggle_block) and place the block in a region, typically above the content
  8. Visit the site and use the link in the block to switch back and forth between beta
  9. Enable and configure other sub-modules as needed - See individual sub-module README files for more information

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
6
Tracked since
May 2023
Latest release
3 years ago
Releases (12 mo)
0
Maintenance
Dormant

Release Timeline

Releases

Version Type Core Release date
1.0.x-dev Dev Aug 15, 2023
1.0.4 Stable Jun 12, 2023
1.0.3 Stable Jun 2, 2023
1.0.2 Stable May 17, 2023
1.0.1 Stable May 15, 2023
1.0.0 Stable May 12, 2023