Skip to content
Snippets Groups Projects

Issue #3334211: Implement layout builder styles on products

1 file
+ 15
1
Compare changes
  • Side-by-side
  • Inline
+ 15
1
@@ -930,6 +930,7 @@ function rocketship_core_local_tasks_alter(&$local_tasks) {
@@ -930,6 +930,7 @@ function rocketship_core_local_tasks_alter(&$local_tasks) {
$allowed_entity_types = [
$allowed_entity_types = [
'node',
'node',
'taxonomy_term',
'taxonomy_term',
 
'commerce_product',
];
];
foreach ($allowed_entity_types as $entity_type) {
foreach ($allowed_entity_types as $entity_type) {
@@ -944,6 +945,10 @@ function rocketship_core_local_tasks_alter(&$local_tasks) {
@@ -944,6 +945,10 @@ function rocketship_core_local_tasks_alter(&$local_tasks) {
$local_tasks["entity.{$entity_type}.edit_form"]['title'] = t('Structure & Metadata');
$local_tasks["entity.{$entity_type}.edit_form"]['title'] = t('Structure & Metadata');
$local_tasks["entity.{$entity_type}.edit_form"]['weight'] = 2;
$local_tasks["entity.{$entity_type}.edit_form"]['weight'] = 2;
}
}
 
if (isset($local_tasks["entity.entity_tasks:entity.{$entity_type}.edit_form"])) {
 
$local_tasks["entity.entity_tasks:entity.{$entity_type}.edit_form"]['title'] = t('Structure & Metadata');
 
$local_tasks["entity.entity_tasks:entity.{$entity_type}.edit_form"]['weight'] = 2;
 
}
// We move the view link to the front.
// We move the view link to the front.
if (isset($local_tasks["entity.{$entity_type}.canonical"])) {
if (isset($local_tasks["entity.{$entity_type}.canonical"])) {
@@ -967,7 +972,7 @@ function rocketship_core_local_tasks_alter(&$local_tasks) {
@@ -967,7 +972,7 @@ function rocketship_core_local_tasks_alter(&$local_tasks) {
*/
*/
function rocketship_core_entity_operation_alter(array &$operations, EntityInterface $entity) {
function rocketship_core_entity_operation_alter(array &$operations, EntityInterface $entity) {
$entity_type_id = $entity->getEntityTypeId();
$entity_type_id = $entity->getEntityTypeId();
if (!in_array($entity_type_id, ['node', 'taxonomy_term'])) {
if (!in_array($entity_type_id, ['node', 'taxonomy_term', 'commerce_product'])) {
return;
return;
}
}
if (isset($operations['edit'])) {
if (isset($operations['edit'])) {
@@ -992,6 +997,15 @@ function rocketship_core_module_implements_alter(&$implementations, $hook) {
@@ -992,6 +997,15 @@ function rocketship_core_module_implements_alter(&$implementations, $hook) {
}
}
}
}
 
/**
 
* Implements hook_form_BASE_FORM_ID_alter() for commerce_product_layout_builder_form.
 
*/
 
function rocketship_core_form_commerce_product_layout_builder_form_alter(&$form, FormStateInterface $form_state, $form_id) {
 
$form['actions']['submit']['#value'] = t('Save content');
 
 
rocketship_core_form_entity_view_display_layout_builder_form_alter($form, $form_state, $form_id);
 
}
 
/**
/**
* Implements hook_form_BASE_FORM_ID_alter() for node_layout_builder_form.
* Implements hook_form_BASE_FORM_ID_alter() for node_layout_builder_form.
*/
*/
Loading