Skip to content
Snippets Groups Projects
Commit e2a04381 authored by Eric Bremner's avatar Eric Bremner Committed by Eric Bremner
Browse files

ISTWCMS-4704: updating fields for contact

parent 56d45b18
No related branches found
No related tags found
1 merge request!34ISTWCMS-4847: adding preprocess to main content area to add classes for 404...
......@@ -375,6 +375,9 @@ function uw_fdsu_theme_resp_preprocess_node(&$variables) {
if ($variables['node']->getType() == 'uw_ct_contact' && $variables['view_mode'] == 'teaser') {
// The UW service object.
$uwService = \Drupal::service('uw_cfg_common.uw_service');
// Get the node.
$node = $variables['node'];
......@@ -401,6 +404,12 @@ function uw_fdsu_theme_resp_preprocess_node(&$variables) {
// Get the profile.
$profile = $node->field_uw_ct_contact_link_profile->getValue();
// Get personal website or cv.
$personal_website = $node->field_uw_ct_contact_link_persona->getValue();
// Get the additional info field.
$additional_info = $node->field_uw_ct_contact_info->getValue();
// Setup the variables for contact.
$variables['contact'] = [
'title' => $node->getTitle(),
......@@ -409,7 +418,21 @@ function uw_fdsu_theme_resp_preprocess_node(&$variables) {
'email' => $node->field_uw_ct_contact_email->value,
'phone' => $node->field_uw_ct_contact_phone->value,
'location' => $node->field_uw_ct_contact_location->value,
'link_profile' => $profile ? $profile[0]['uri'] : NULL,
'link_profile' => [
'uri' => $profile ? $profile[0]['uri'] : NULL,
'title' => $profile ? $profile[0]['title'] : NULL,
],
'contact_for' => $node->field_uw_ct_contact_for->value,
'personal_website' => [
'uri' => $personal_website ? $personal_website[0]['uri'] : NULL,
'title' => $personal_website ? $personal_website[0]['title'] : NULL,
],
'groups' => $uwService->uwGetTermsFromEntityField($node->field_uw_ct_contact_group, 'tags'),
'additional_info' => [
'#type' => 'processed_text',
'#text' => $additional_info[0]['value'],
'#format' => $additional_info[0]['format'],
],
];
// Unset the content variable so that we do not
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment