Skip to content
Snippets Groups Projects
Commit 00a7471b authored by Eric Bremner's avatar Eric Bremner Committed by Igor Biki
Browse files

ISTWCMS-5195: updating profiles to new node theming

parent 0b35918d
No related branches found
No related tags found
1 merge request!169Feature/istwcms 5195 ebremner node theming
......@@ -140,7 +140,8 @@ class UwNodeContent {
else {
if ($content == 'header') {
$node_flags['get_header'] = TRUE;
$node_flags['get_image'] = TRUE;
$node_flags['get_title'] = TRUE;
$node_flags['get_hero'] = TRUE;
}
if ($content == 'footer') {
......@@ -485,22 +486,33 @@ class UwNodeContent {
*/
public function getProfileContent(array $node_flags): array {
$tag_list = [
'field_uw_ct_profile_type',
];
// Get the content data.
$content_data = $this->setupContentData($node_flags);
return [
'title' => $node_flags['get_title'] ? TRUE : NULL,
'position' => $node_flags['get_header'] ? 'field_uw_ct_profile_title' : NULL,
'affiliation' => $node_flags['get_header'] ? 'field_uw_ct_profile_affiliation' : NULL,
'content' => $node_flags['get_content'] ? 'field_uw_profile_summary' : NULL,
'image' => $node_flags['get_header'] ? 'field_uw_ct_profile_image' : NULL,
'sources' => $node_flags['get_image'] ? 'field_uw_ct_profile_image' : NULL,
'tags' => $node_flags['get_footer'] ? $tag_list : NULL,
'link_profile' => $node_flags['get_footer'] ? 'field_uw_ct_profile_info_link' : NULL,
'personal_webpage' => $node_flags['get_footer'] ? 'field_uw_ct_profile_link_persona' : NULL,
'url' => TRUE,
];
// Setup the header content.
if ($node_flags['get_header']) {
$content_data['header']['position'] = $this->addToContentData('plain_text', 'field_uw_ct_profile_title');
}
// Setup the actual content.
if ($node_flags['get_content']) {
$content_data['content'] = $this->addToContentData('content', 'field_uw_news_summary');
}
// Get the footer for the profile.
if ($node_flags['get_footer']) {
$content_data['footer']['links']['has_children'] = TRUE;
$content_data['footer']['links']['profile'] = $this->addToContentData('link', 'field_uw_ct_profile_info_link');
$content_data['footer']['links']['webpage'] = $this->addToContentData('link', 'field_uw_ct_profile_link_persona');
$content_data['footer']['tags'] = $this->addToContentData(
'terms',
[
'field_uw_ct_profile_type',
]
);
}
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