Skip to content

Commit

Permalink
add menu message to asu_brand
Browse files Browse the repository at this point in the history
  • Loading branch information
tbutterf committed Nov 12, 2024
1 parent 6415639 commit 54e856a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/mono-package-split.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: 'Split ASU Packages'
on:
push:
branches:
- main
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- WS2-1623
# tags:
# - 'v[0-9]+.[0-9]+.[0-9]+'
# Allow us to manually trigger the workflow
workflow_dispatch:

Expand Down
16 changes: 15 additions & 1 deletion web/modules/asu_modules/asu_brand/asu_brand.module
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function asu_brand_form_alter(&$form, FormStateInterface $form_state, $form_id)
$form['links']['links']['#header'][] = t("Header settings");
foreach (Element::children($form['links']['links']) as $key => $child) {
$link_parts = explode(':', $child);
if ($link_parts[2] && Uuid::isValid($link_parts[2])) { // TODO Is there a better check we can do here?
if (count($link_parts) > 2 && $link_parts[2] && Uuid::isValid($link_parts[2])) { // TODO Is there a better check we can do here?
$link_uuid = $link_parts[2];
$link_entity = \Drupal::service('entity.repository')
->loadEntityByUuid('menu_link_content', $link_uuid);
Expand Down Expand Up @@ -434,3 +434,17 @@ function asu_brand_asu_brand_gtm_datalayer_alter(array &$datalayer) {
$datalayer['site'] = 'My Site';
}
*/

/**
* Implements hook_form_FORM_ID_alter().
*/
function asu_brand_form_menu_edit_form_alter(&$form, FormStateInterface $form_state) {
if (isset($form['id']['#default_value']) && $form['id']['#default_value'] == 'main') {
// Add information text in the main menu on edit.
$form['indicatior'] = [
'#markup' => t('First menu link automatically becomes the home link'),
'#weight' => 1,
];
$form['links']['#weight'] = 2;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,3 @@ function asu_components_appearance_field_widget_entity_reference_paragraphs_form
// Skip "Confirm deletion / Restore actions" behavior for a given paragraph.
$element['top']['links']['remove_button']['#paragraphs_mode'] = 'removed';
}

/**
* Implements hook_form_FORM_ID_alter().
*/
function asu_components_appearance_form_menu_edit_form_alter(&$form, FormStateInterface $form_state) {
if (isset($form['id']['#default_value']) && $form['id']['#default_value'] == 'main') {
// Add information text in the main menu on edit.
$form['indicatior'] = [
'#markup' => t('First menu link automatically becomes the home link'),
'#weight' => 1,
];
$form['links']['#weight'] = 2;
}
}

0 comments on commit 54e856a

Please sign in to comment.