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

ISTWCMS-5234: udpating terminology from hero to media

parent 36f06348
No related branches found
No related tags found
1 merge request!184Feature/istwcms 5234 ebremner hero
......@@ -220,12 +220,11 @@ class UWService implements UWServiceInterface {
];
break;
case 'hero':
case 'media':
$preprocess = [
'uw_ct_blog',
'uw_ct_event',
'uw_ct_news_item',
'uw_ct_web_page',
];
break;
}
......@@ -236,18 +235,18 @@ class UWService implements UWServiceInterface {
/**
* {@inheritDoc}
*/
public function uwCheckNodeForHero(Node $node): string {
public function uwCheckNodeForMedia(Node $node): string {
// Set the node type.
$node_type = $node->getType();
// Get the list of content types that are allowed to have
// hero from our service.
$hero = $this->uwGetNodePreprocessing('hero');
$media = $this->uwGetNodePreprocessing('media');
// If node is allowed to have a hero, make sure that
// node actually has a hero.
if (in_array($node_type, $hero)) {
// If node is allowed to have a media, make sure that
// node actually has a media.
if (in_array($node_type, $media)) {
// Get the type of media value from the node.
$value = $node->field_uw_type_of_media->value;
......
......@@ -68,7 +68,7 @@ interface UWServiceInterface {
* @return string
* Yes or no.
*/
public function uwCheckNodeForHero(Node $node): string;
public function uwCheckNodeForMedia(Node $node): string;
/**
* A function to get or check the attached sidebar.
......
......@@ -240,9 +240,9 @@ class UwNodeContent {
$content_data['header']['author'] = $this->addToContentData('author', 'field_author');
}
// Get the hero image.
if ($node_flags['get_hero']) {
$content_data['hero_image'] = $this->addToContentData('sources', 'field_uw_hero_image');
// Get the media.
if ($node_flags['get_media']) {
$content_data['media'] = $this->addToContentData('media', NULL);
}
// Get the listing image.
......
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