Skip to content

Commit

Permalink
Closes #2645: Add events to Quickstart for Marketing Cloud module (#2666
Browse files Browse the repository at this point in the history
)
  • Loading branch information
danahertzberg committed Aug 25, 2023
1 parent 7e72740 commit 61ef742
Show file tree
Hide file tree
Showing 6 changed files with 621 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ type: module
package: 'The University of Arizona - Experimental'
dependencies:
- az_news
- az_event
13 changes: 12 additions & 1 deletion modules/custom/az_marketing_cloud/az_marketing_cloud.module
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ function az_marketing_cloud_theme($existing, $type, $theme, $path) {
'template' => 'node--view--az-marketing-cloud--text-layout',
'base hook' => 'node',
],
'node__view__az_marketing_cloud__event_layout' => [
'template' => 'node--view--az-marketing-cloud--event-layout',
'base hook' => 'node',
],
'region__az_marketing_cloud' => [
'template' => 'region--az-marketing-cloud',
'base hook' => 'region',
Expand Down Expand Up @@ -70,7 +74,8 @@ function az_marketing_cloud_theme($existing, $type, $theme, $path) {
*/
function az_marketing_cloud_preprocess_node__view__az_marketing_cloud(&$variables) {
$node = $variables['node'];
if ($node->getType() === 'az_news') {
$content_type = $node->getType();
if (in_array($content_type, ['az_news', 'az_event'])) {
$token_service = \Drupal::token();
$bubbleable_metadata = new BubbleableMetadata();
$az_canonical_url = $token_service->replace('[node:az-canonical-url]', ['node' => $node], [], $bubbleable_metadata);
Expand Down Expand Up @@ -127,6 +132,9 @@ function az_marketing_cloud_theme_suggestions_region_alter(array &$suggestions,
if ($route_name === 'view.az_marketing_cloud.text_layout') {
$suggestions[] = 'region__az_marketing_cloud';
}
if ($route_name === 'view.az_marketing_cloud.event_layout') {
$suggestions[] = 'region__az_marketing_cloud';
}
}

/**
Expand All @@ -143,6 +151,9 @@ function az_marketing_cloud_theme_suggestions_views_view_alter(array &$suggestio
if ($route_name === 'view.az_marketing_cloud.text_layout') {
$suggestions[] = 'views_view__az_marketing_cloud';
}
if ($route_name === 'view.az_marketing_cloud.event_layout') {
$suggestions[] = 'views_view__az_marketing_cloud';
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
langcode: en
status: true
dependencies:
config:
- core.entity_view_mode.node.az_marketing_cloud_event_layout
- field.field.node.az_event.field_az_attachments
- field.field.node.az_event.field_az_body
- field.field.node.az_event.field_az_contacts
- field.field.node.az_event.field_az_event_category
- field.field.node.az_event.field_az_event_date
- field.field.node.az_event.field_az_featured_image_as_thumb
- field.field.node.az_event.field_az_link
- field.field.node.az_event.field_az_location
- field.field.node.az_event.field_az_media_thumbnail_image
- field.field.node.az_event.field_az_photos
- field.field.node.az_event.field_az_subheading
- field.field.node.az_event.field_az_summary
- field.field.node.az_event.field_az_trellis_id
- node.type.az_event
module:
- smart_title
- text
- user
third_party_settings:
smart_title:
enabled: true
settings:
smart_title__link: false
smart_title__tag: ''
smart_title__classes:
- node__title
id: node.az_event.az_marketing_cloud_event_layout
targetEntityType: node
bundle: az_event
mode: az_marketing_cloud_event_layout
content:
az_event_day:
settings: { }
third_party_settings: { }
weight: 2
region: content
az_event_month:
settings: { }
third_party_settings: { }
weight: 1
region: content
field_az_summary:
type: text_default
label: hidden
settings: { }
third_party_settings: { }
weight: 3
region: content
links:
settings: { }
third_party_settings: { }
weight: 4
region: content
smart_title:
settings: { }
third_party_settings: { }
weight: 0
region: content
hidden:
field_az_attachments: true
field_az_body: true
field_az_contacts: true
field_az_event_category: true
field_az_event_date: true
field_az_featured_image_as_thumb: true
field_az_link: true
field_az_location: true
field_az_media_thumbnail_image: true
field_az_metatag: true
field_az_photos: true
field_az_subheading: true
field_az_trellis_id: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
langcode: en
status: true
dependencies:
module:
- node
id: node.az_marketing_cloud_event_layout
label: 'Marketing Cloud - Event Layout'
targetEntityType: node
cache: true
Loading

0 comments on commit 61ef742

Please sign in to comment.