From 58f609a54bf21cf2ff595b784f89433e871c11a3 Mon Sep 17 00:00:00 2001 From: ebremner <ebremner@uwaterloo.ca> Date: Wed, 16 Jun 2021 00:58:42 -0400 Subject: [PATCH] ISTWCMS-4704: fixing field name in getting image and adding in profiles to node content --- src/Service/UWService.php | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/Service/UWService.php b/src/Service/UWService.php index be9897d9..e4053d13 100644 --- a/src/Service/UWService.php +++ b/src/Service/UWService.php @@ -227,6 +227,24 @@ class UWService implements UWServiceInterface { 'url' => TRUE, ]; break; + + case 'uw_ct_profile': + + $tag_list = [ + 'field_uw_ct_profile_type', + ]; + + $content_data = [ + 'title' => $get_header ? TRUE : NULL, + 'sub_title' => $get_header ? 'field_uw_ct_profile_title' : NULL, + 'affiliation' => $get_header ? 'field_uw_ct_profile_affiliation' : NULL, + 'content' => $get_content ? 'layout_builder__layout' : NULL, + 'image' => $get_header ? 'field_uw_ct_profile_image' : NULL, + 'tags' => $get_footer ? $tag_list : NULL, + 'link_profile' => $get_footer ? 'field_uw_ct_profile_info_link' : NULL, + 'personal_webpage' => $get_footer ? 'field_uw_ct_profile_link_persona' : NULL, + ]; + break; } return $this->uwGetNodeData($node, $view_mode, $content_data); @@ -353,7 +371,7 @@ class UWService implements UWServiceInterface { $image = []; // Get the media id. - $mid = $node->field_uw_ct_contact_image->getValue(); + $mid = $node->$field_name->getValue(); // If there is an image, process it. if ($mid) { -- GitLab