Drupal Multisite ================ For Drupal multisite installs, there are two ways that sites can be configured in Cascade to accommodate for a multisite setup. .. note: screenshot starting width: 1200 x 675 or 1200 x 900 .. |Multisite Databases| image:: ../../../shared/images/portal/drupal_multisite_databases.jpg :width: 400 :alt: Multisite Databases .. |Multisite Assets| image:: ../../../shared/images/portal/drupal_multisite_assets.jpg :width: 400 :alt: Multisite Assets .. |Multisite FTACs| image:: ../../../shared/images/portal/drupal_multisite_ftacs.jpg :width: 400 :alt: Multisite FTACs .. |Multisite Links| image:: ../../../shared/images/portal/drupal_multisite_links.jpg :width: 400 :alt: Multisite Links .. |Multisite Projects| image:: ../../../shared/images/portal/drupal_multisite_projects.jpg :width: 400 :alt: Multisite Projects .. |Multisite FTAC| image:: ../../../shared/images/portal/drupal_multisite_ftac.jpg :width: 400 :alt: Multisite FTAC Single Project Configuration ++++++++++++++++++++++++++++ For a single project configuration, all of the sites under the core site are configured within the same Cascade project. The following are configuration considerations for using a single project. * All sites will share the same GitLab repository * Each site will have a separate database group within the Cascade project * Each site will have a separate asset group within the Cascade project Add A Single Project Multisite ------------------------------ This section will cover the project configuration changes that need to be made for a single project multisite. To add a single project multisite, start by adding the inital project to Cascade. After adding the base project, loop through the below configuration changes for each subsite. For a complete walk through on adding a normal project to Cascade, see our :ref:`Quickstart Guides. ` Configuring Databases for Multisites ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Since the core site and the subsites will share the same project, you'll want to add additional database groups to the project for each multisite. Below is an example of multiple database groups for a multisite configuration. For detailed instructions on adding database groups, see the :ref:`Add Databases guide. ` |Multisite Databases| Configuring Assets for Multisites ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Since the core site and the subsites will share the same project, you'll want to add additional asset groups to the project for each multisite. Below is an example of multiple asset groups for a multisite configuration. For detailed instructions on adding asset groups, see the :ref:`Add Assets guide. ` |Multisite Assets| Configuring File Template Actions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For projects using the settings.local.php template file, additional File Template Actions will need to be added to the project for the subsites. Once those actions are added they will also need to be added to the respective code pipelines as pictured below. Be sure to add the File Template Actions for each environment. Detailed instructions on adding a File Template Action can be found in the :ref:`Add a Pipeline Step guide. ` |Multisite FTACs| Multiple Projects Configuration +++++++++++++++++++++++++++++++ For a multiple project configuration, the core site is one project and each subsite will also be in a separate Cascade project. The following are configuration considerations for using multiple projects. * All subsites will have separate repositories from core. The benefit of this is that changes can be made and deployed to the subsites without needing to redeploy core for the changes to go live. * This allows the themes and modules for the subsite to be separate from the core site repository. * With this configuration, on the server, each subsite will have a document root outside of the document root of the core site. A symbolic link will need to be created in the sites directory in the core site location to reference the subsite as expected. * The symbolic link can be created in a number of ways : utilizing the "Links" tab within the project configuration page, using a script action, adding the links to your core site repository. These need be configured in a manner where the links are recreated with the document root on each code deploy for the core site. * Subsite will have the database(s) configured in the separate project. * Subsite will have the assets configured in the separate project. Add A Multiple Project Multisite -------------------------------- This section will cover the project configuration differences for a multiple project multisite configuration. Start by adding the core site project and then add and configure the subsite(s) in separate projects. For a complete walk through on adding a normal project to Cascade, see our :ref:`Quickstart Guides. ` Add Core Project and Configure Links ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For a multiple project multisite configuration, each site will be a seperate Cascade project. Start by adding the inital Drupal project to Cascade for the core project. After adding inital Drupal project, add Links to that project for all subsites as shown below. Detailed instructions on adding Links to a project can be found in the :ref:`Add Links guide. ` |Multisite Links| Add Subsite Projects ~~~~~~~~~~~~~~~~~~~~ Each subsite will be a separate Cascade project as shown below. Add the project using the Other type; once created enable and configure :ref:`Databases ` and :ref:`Assets ` for the subsite. Detailed instructions on adding a project to Cascade can be found in the :ref:`Add a Project guide. ` |Multisite Projects| In addition to enabling the the Databases and Assets, the settings.local.php file needs to be added to the repository for the subsite project. The contents of such file can be found in the repository of your core project under sites/default/settings.local.php. After adding the file to the repository, File Template Actions will need to be added to the subsite project for each environment. Detailed instructions on adding a File Template Action can be found in the :ref:`Add a Pipeline Step guide. ` The File Template Actions will need to be added to the respective code deploy pipelines as shown below. |Multisite FTAC| Considerations for Composer +++++++++++++++++++++++++++ For Drupal 8+ sites, composer is installed on each code deploy. This can be done using a script action as instructed :ref:`here` or it can be done using :doc:`overrides`. For both multisite configuration options, the composer install will need to be executed in the core site project on code deploys.