acquia / cohesion
Site Studio
Installs: 1 091 893
Dependents: 4
Suggesters: 0
Security: 0
Stars: 21
Watchers: 17
Forks: 40
Type:drupal-module
Requires
- ext-json: *
- cweagans/composer-patches: ^1.7
- drupal/entity_reference_revisions: ^1.11
- drupal/imce: ^3.1
- drupal/jquery_ui: ^1.7
- drupal/stable: ^2.0 || ^2.1
- drupal/token: ^1.14
- drush/drush: ^11.6 || ^12 || ^13
Requires (Dev)
- acquia/coding-standards: ^3.0
- dealerdirect/phpcodesniffer-composer-installer: ^1.0
- drupal/core-dev: ^10 || ^11
- e0ipso/shaper: ^1.2
Suggests
- drupal/admin_toolbar: Provides a better UX for the standard admin toolbar
- drupal/context: Provides a UI for contexts.
- drupal/google_analytics: Provides integration with Google Analytics
- drupal/menu_item_extras: Make the Menu Link Content entity fully fieldable.
- drupal/menu_link_attributes: This module allows you to add attributes to your menu links or their wrapping <li> elements.
- drupal/node_revision_delete: Provides tools to help manage node revisions and keep your database to a reasonable size.
- drupal/request_data_conditions: Defines a set of conditions via the Drupal 8 Conditions Plugin API for use with the context module
- drupal/search_api: Provides a framework for easily creating searches on any entity known to Drupal, using any kind of search engine.
- drupal/views_infinite_scroll: Provides infinite scroll functionality to Views
- drupal/webform: This module allows you to use webforms.
- dev-master
- 8.1.x-dev
- 8.0.x-dev
- 8.0.2
- 8.0.1
- 8.0.0
- 8.0.0-beta4
- 8.0.0-beta3
- 8.0.0-beta2
- 8.0.0-beta1
- 7.5.x-dev
- 7.5.2
- 7.5.1
- 7.5.1-beta1
- 7.5.0
- 7.5.0-beta2
- 7.5.0-beta1
- 7.4.x-dev
- 7.4.3
- 7.4.2
- 7.4.1
- 7.4.0
- 7.4.0-beta3
- 7.4.0-beta2
- 7.4.0-beta1
- 7.3.x-dev
- 7.3.2
- 7.3.1
- 7.3.0
- 7.2.x-dev
- 7.2.3
- 7.2.2
- 7.2.1
- 7.2.0
- 7.1.x-dev
- 7.1.2
- 7.1.1
- 7.1.0
- 7.0.x-dev
- 7.0.5
- 7.0.4
- 7.0.3
- 7.0.2
- 7.0.1
- 7.0.0
- 6.9.x-dev
- 6.9.5
- 6.9.4
- 6.9.3
- 6.9.2
- 6.9.1
- 6.9.0
- 6.8.x-dev
- 6.8.2
- 6.8.1
- 6.8.0
- 6.7.x-dev
- 6.7.0
- 6.6.x-dev
- 6.6.1
- 6.6.0
- 6.5.x-dev
- 6.5.1
- 6.5.0
- 6.4.x-dev
- 6.4.3
- 6.4.2
- 6.4.1
- 6.4.0
- 6.3.x-dev
- 6.3.5
- 6.3.4
- 6.3.3
- 6.3.2
- 6.3.1
- 6.3.0
- 6.2.x-dev
- 6.2.1
- 6.2.0
- 6.1.x-dev
- 6.1.4
- 6.1.3
- 6.1.2
- 6.1.1
- 6.1.0
- 6.0.x-dev
- 6.0.3
- 6.0.2
- 6.0.1
- 6.0.0
- dev-8.0.x-rc
- dev-feature-aco-2515
- dev-develop
- dev-DIT-445-add-gitignore-gitattributes-files
This package is auto-updated.
Last update: 2024-11-20 19:35:41 UTC
README
Installation with composer
Using composer is the preferred way of managing your modules and themes as composer handles dependencies automatically and there is less margin for error. You can find out more about composer and how to install it here: https://getcomposer.org/. It is not recommended to edit your composer.json file manually.
Open up your terminal and navigate to your project root directory.
Run the following commands to require the module and minimal theme:
composer require acquia/cohesion
composer require acquia/cohesion-theme
Site Studio will install along with several module dependencies from drupal.org.
You can now enable the modules via drush with the following commands:
drush cr
drush pm-enable cohesion cohesion_base_styles cohesion_custom_styles cohesion_elements cohesion_style_helpers cohesion_sync cohesion_templates cohesion_website_settings sitestudio_page_builder -y
Upgrading Site Studio
When upgrading to a newer version of Site Studio, the following series of commands will need to be run in this order:
drush cr
drush updb -y
drush cohesion:import
drush cohesion:rebuild
Drush integration
The cohesion
drush command has the following operations:
cohesion:rebuild
Re-save and run pending updates on all Site Studio config entities.
drush cohesion:rebuild
cohesion:import
Import assets and rebuild element styles (replacement for the CRON).
drush cohesion:import
Hooks
Several hooks are provided and documented in ./cohesion.api.php.
All hooks are in the sitestudio
group, so can be implemented in a
MODULE.sitestudio.inc file under your module's root if you wish.
note: the previous dx8
group is also included for backwards compatibility.
Global $settings options
Show the JSON fields for debugging:
$settings['dx8_json_fields'] = TRUE;
Allow the API URL field on the account settings page to be editable:
$settings['dx8_editable_api_url'] = TRUE;
Expose a version number field on the account settings page (for development):
$settings['dx8_editable_version_number'] = TRUE;
Don't show the API key field on the account settings page:
$settings['dx8_no_api_keys'] = TRUE;
Don't show the Google API key page:
$settings['dx8_no_google_keys'] = TRUE;
Set the temporary stream wrapper that cohesion should use:
$settings['coh_temporary_stream_wrapper'] = 'mytemp://';
Utilise the database as a scratch directory during rebuild operations:
$settings['stylesheet_json_storage_keyvalue'] = TRUE;
Set the sync directory that Site studio should use:
$settings['site_studio_sync'] = '../config/sync';
Set the max number of entities to import via sync in the batch process:
$settings['sync_max_entity'] = 10;
Set the max number of entities to rebuild at one time in the rebuild batch process:
$settings['rebuild_max_entity'] = 10;
Global $config options
Set API key:
$config['cohesion.settings']['api_key'] = 'api-key';
Set organization key:
$config['cohesion.settings']['organization_key'] = 'org-key';
Show legacy sync options in the UI:
$config['cohesion.settings']['sync_legacy_visibility'] = TRUE;
Site Studio Events
When certain Site Studio operations are taking place events are dispatched so that you can interact with it, but you must write your own event subscribers to subscribe to the relevant events.
The main Site Studio module's events can be found within the \Drupal\cohesion\SiteStudioEvents
class.
Pre Site Studio Rebuild
When a Site Studio rebuild operation is started the PreRebuildEvent will be dispatched.
To subscribe: Drupal\cohesion\SiteStudioEvents::PRE_REBUILD
The dispatched event is Drupal\cohesion\Event\PreRebuildEvent
.
Post Site Studio Rebuild
When a Site Studio rebuild operation is complete the PostRebuildEvent will be dispatched.
To subscribe: Drupal\cohesion\SiteStudioEvents::POST_REBUILD
The dispatched event is Drupal\cohesion\Event\PostRebuildEvent
.
Tests
Run something like: vendor/bin/phpunit -c docroot/core/phpunit.xml.dist --testsuite=unit --group Cohesion
License
Copyright (C) 2024 Acquia, Inc.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.