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

ISTWCMS-5195: fixing up contact to use new node theming

parent 1617c275
No related branches found
No related tags found
1 merge request!172Feature/istwcms 5128 ebremner theme node services
...@@ -437,22 +437,47 @@ class UwNodeContent { ...@@ -437,22 +437,47 @@ class UwNodeContent {
*/ */
public function getContactContent(array $node_flags): array { public function getContactContent(array $node_flags): array {
return [ // Get the content data.
'title' => $node_flags['get_title'] ? TRUE : NULL, $content_data = $this->setupContentData($node_flags);
'position' => $node_flags['get_header'] ? 'field_uw_ct_contact_title' : NULL,
'affiliation' => $node_flags['get_header'] ? 'field_uw_ct_contact_affiliation' : NULL, // Setup the header content.
'image' => $node_flags['get_image'] ? 'field_uw_ct_contact_image' : NULL, if ($node_flags['get_header']) {
'content' => $node_flags['get_content'] ? 'layout_builder__layout' : NULL, $content_data['header']['position'] = $this->addToContentData('plain_text', 'field_uw_ct_contact_title');
'email' => $node_flags['get_footer'] ? 'field_uw_ct_contact_email' : NULL, }
'location' => $node_flags['get_footer'] ? 'field_uw_ct_contact_location' : NULL,
'phone' => $node_flags['get_footer'] ? 'field_uw_ct_contact_phone' : NULL, // Setup the actual content.
'additional_info' => $node_flags['get_footer'] ? 'field_uw_ct_contact_info' : NULL, if ($node_flags['get_content']) {
'link_profile' => $node_flags['get_footer'] ? 'field_uw_ct_contact_link_profile' : NULL, $content_data['content'] = $this->addToContentData('content', 'field_uw_news_summary');
'personal_webpage' => $node_flags['get_footer'] ? 'field_uw_ct_contact_link_persona' : NULL, }
'contact_for' => $node_flags['get_footer'] ? 'field_uw_ct_contact_contact_for' : NULL,
'groups' => $node_flags['get_footer'] ? 'field_uw_ct_contact_group' : NULL, // Get the footer data.
'url' => TRUE, if ($node_flags['get_footer']) {
];
// Get the additional info.
$content_data['footer']['additional_info']['has_children'] = TRUE;
$content_data['footer']['additional_info']['info'] = $this->addToContentData('formatted_text', 'field_uw_ct_contact_info');
// Get the contact information.
$content_data['footer']['contact_info']['has_children'] = TRUE;
$content_data['footer']['contact_info']['email'] = $this->addToContentData('plain_text', 'field_uw_ct_contact_email');
$content_data['footer']['contact_info']['phone'] = $this->addToContentData('plain_text', 'field_uw_ct_contact_phone');
$content_data['footer']['contact_info']['location'] = $this->addToContentData('plain_text', 'field_uw_ct_contact_location', 'Location');
// Get the links for the profile.
$content_data['footer']['links']['has_children'] = TRUE;
$content_data['footer']['links']['profile'] = $this->addToContentData('link', 'field_uw_ct_contact_link_profile', 'Link to profile');
$content_data['footer']['links']['webpage'] = $this->addToContentData('link', 'field_uw_ct_contact_link_persona', 'Link to personal webpage');
// Get the contact for, for the profile.
$content_data['footer']['contact_for']['has_children'] = TRUE;
$content_data['footer']['contact_for']['contact'] = $this->addToContentData('plain_text', 'field_uw_ct_contact_contact_for');
// Get the groups for the profile.
$content_data['footer']['groups']['has_children'] = TRUE;
$content_data['footer']['groups']['groups'] = $this->addToContentData('terms', ['field_uw_ct_contact_group']);
}
return $content_data;
} }
/** /**
......
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