Skip to content

Commit

Permalink
feat(SLB-413): add page templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Leksat committed Jul 5, 2024
1 parent 5f6855e commit c5b22ac
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 2 deletions.
1 change: 1 addition & 0 deletions apps/cms/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"drupal/masquerade": "^2.0@RC",
"drupal/menu_admin_per_menu": "^1.5",
"drupal/metatag": "^2.0",
"drupal/pate": "^1.2",
"drupal/pathauto": "^1.11",
"drupal/redirect": "^1.8",
"drupal/replicate_ui": "^1.1",
Expand Down
55 changes: 54 additions & 1 deletion apps/cms/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions apps/cms/config/sync/core.extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ module:
node: 0
options: 0
page_cache: 0
pate: 0
path: 0
path_alias: 0
phpass: 0
Expand Down
3 changes: 3 additions & 0 deletions apps/cms/config/sync/node.type.page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ status: true
dependencies:
module:
- menu_ui
- pate
third_party_settings:
menu_ui:
available_menus:
- footer
- main
parent: 'main:'
pate:
is_templatable: true
name: 'Basic page'
type: page
description: ''
Expand Down
3 changes: 3 additions & 0 deletions apps/cms/config/sync/user.role.administrator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ dependencies:
- media
- menu_admin_per_menu
- node
- pate
- path
- redirect
- replicate_ui
Expand Down Expand Up @@ -72,6 +73,7 @@ permissions:
- 'edit config_pages entity'
- 'edit own webform'
- 'edit own webform submission'
- 'manage page templates'
- 'replicate entities'
- 'translate editable entities'
- 'translate interface'
Expand All @@ -82,6 +84,7 @@ permissions:
- 'use basic transition unpublish'
- 'use external preview'
- 'use gutenberg'
- 'use page templates'
- 'use text format gutenberg'
- 'view all media revisions'
- 'view any unpublished content'
Expand Down
3 changes: 3 additions & 0 deletions apps/cms/config/sync/user.role.editor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies:
- gutenberg
- media
- node
- pate
- path
- redirect
- replicate_ui
Expand Down Expand Up @@ -52,6 +53,7 @@ permissions:
- 'dropzone upload files'
- 'edit any page content'
- 'edit own page content'
- 'manage page templates'
- 'replicate entities'
- 'revert page revisions'
- 'translate editable entities'
Expand All @@ -62,6 +64,7 @@ permissions:
- 'use basic transition unpublish'
- 'use external preview'
- 'use gutenberg'
- 'use page templates'
- 'use text format gutenberg'
- 'view all media revisions'
- 'view any unpublished content'
Expand Down
10 changes: 9 additions & 1 deletion packages/drupal/entity_create_split/entity_create_split.module
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ function entity_create_split_gutenberg_enabled(EntityInterface $entity) {
*/
function entity_create_split_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
$formObject = $form_state->getFormObject();
if ($formObject instanceof ContentEntityForm && $formObject->getFormDisplay($form_state)->getMode() === 'split') {
if (
$formObject instanceof ContentEntityForm &&
(
// getFormDisplay should return an object, but in fact it might return
// null. This happens on `/node/{node}/templatize` route.
$formDisplay = $formObject->getFormDisplay($form_state)
) &&
$formDisplay->getMode() === 'split'
) {
if (empty($form['#submit'])) {
$form['#submit'] = [];
}
Expand Down

0 comments on commit c5b22ac

Please sign in to comment.