From 9f86b54d2bd4da43ef03523de9289028a6656e48 Mon Sep 17 00:00:00 2001
From: ebremner <ebremner@uwaterloo.ca>
Date: Wed, 16 Jun 2021 15:14:50 -0400
Subject: [PATCH] ISTWCMS-4704: udpating getting node data to exclude title on
 node page

---
 src/Service/UWService.php | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/Service/UWService.php b/src/Service/UWService.php
index f6f0612b..9caa77be 100644
--- a/src/Service/UWService.php
+++ b/src/Service/UWService.php
@@ -112,6 +112,7 @@ class UWService implements UWServiceInterface {
     $get_footer = FALSE;
     $get_image = FALSE;
     $get_content = FALSE;
+    $get_title = TRUE;
 
     // Setup flags based on teaser content argument.
     if ($content == 'all') {
@@ -122,6 +123,10 @@ class UWService implements UWServiceInterface {
       if ($view_mode == 'teaser') {
         $get_image = TRUE;
       }
+
+      if ($view_mode == 'full') {
+        $get_title = FALSE;
+      }
     }
     else {
       if ($content == 'header') {
@@ -145,7 +150,7 @@ class UWService implements UWServiceInterface {
         ];
 
         $content_data = [
-          'title' => $get_header ? TRUE : NULL,
+          'title' => $get_title ? TRUE : NULL,
           'url' => TRUE,
           'date' => $get_header ? 'field_uw_blog_date' : NULL,
           'author' => $get_header ? TRUE : NULL,
@@ -165,7 +170,7 @@ class UWService implements UWServiceInterface {
         ];
 
         $content_data = [
-          'title' => $get_header ? TRUE : NULL,
+          'title' => $get_title ? TRUE : NULL,
           'url' => TRUE,
           'date' => $get_header ? 'field_uw_event_date' : NULL,
           'sources' => $get_image ? 'field_uw_event_listing_page_img' : NULL,
@@ -183,7 +188,7 @@ class UWService implements UWServiceInterface {
         ];
 
         $content_data = [
-          'title' => $get_header ? TRUE : NULL,
+          'title' => $get_title ? TRUE : NULL,
           'url' => TRUE,
           'date' => $get_header ? 'field_uw_news_date' : NULL,
           'sources' => $get_image ? 'field_uw_news_listing_page_image' : NULL,
@@ -195,7 +200,7 @@ class UWService implements UWServiceInterface {
       case 'uw_ct_web_page':
 
         $content_data = [
-          'title' => $get_header ? TRUE : NULL,
+          'title' => $get_title ? TRUE : NULL,
           'content' => $get_content ? 'layout_builder__layout' : NULL,
         ];
         break;
@@ -203,7 +208,7 @@ class UWService implements UWServiceInterface {
       case 'uw_ct_catalog_item':
 
         $content_data = [
-          'title' => $get_header ? TRUE : NULL,
+          'title' => $get_title ? TRUE : NULL,
           'content' => $get_content ? 'layout_builder__layout' : NULL,
         ];
         break;
@@ -211,7 +216,7 @@ class UWService implements UWServiceInterface {
       case 'uw_ct_contact':
 
         $content_data = [
-          'title' => $get_header ? TRUE : NULL,
+          'title' => $get_title ? TRUE : NULL,
           'sub_title' => $get_header ? 'field_uw_ct_contact_title' : NULL,
           'affiliation' => $get_header ? 'field_uw_ct_contact_affiliation' : NULL,
           'image' => $get_header ? 'field_uw_ct_contact_image' : NULL,
@@ -235,7 +240,7 @@ class UWService implements UWServiceInterface {
         ];
 
         $content_data = [
-          'title' => $get_header ? TRUE : NULL,
+          'title' => $get_title ? TRUE : NULL,
           'sub_title' => $get_header ? 'field_uw_ct_profile_title' : NULL,
           'affiliation' => $get_header ? 'field_uw_ct_profile_affiliation' : NULL,
           'content' => $get_content ? 'field_uw_profile_summary' : NULL,
-- 
GitLab