Skip to content
Snippets Groups Projects

Feature/istwcms 4619 ebremner variables for listing page

2 files
+ 28
4
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 26
4
@@ -8,7 +8,6 @@ use Drupal\Core\Entity\EntityTypeManagerInterface;
use Drupal\Core\Field\EntityReferenceFieldItemListInterface;
use Drupal\Core\Url;
use Drupal\node\Entity\Node;
use Drupal\node\NodeInterface;
use Drupal\simplify_menu\MenuItems;
use Drupal\path_alias\AliasManager;
@@ -133,7 +132,15 @@ class UWService implements UWServiceInterface {
// Setup the teaser data array, based on flags.
switch ($teaser_type) {
case 'blog':
// The list of tags for blogs.
$tag_list = [
'field_uw_blog_tags',
'field_uw_audience',
];
$teaser_data = [
'title' => $get_header ? TRUE : NULL,
'url' => TRUE,
@@ -141,29 +148,44 @@ class UWService implements UWServiceInterface {
'author' => $get_header ? TRUE : NULL,
'sources' => $get_image ? 'field_uw_blog_listing_page_image' : NULL,
'content' => $get_content ? 'field_uw_blog_summary' : NULL,
'tags' => $get_footer ? ['field_uw_blog_tags', 'field_uw_audience'] : NULL
'tags' => $get_footer ? $tag_list : NULL,
];
break;
case 'events':
// The list of tags for events.
$tag_list = [
'field_uw_event_tags',
'field_uw_audience',
'field_uw_event_type',
];
$teaser_data = [
'title' => $get_header ? TRUE : NULL,
'url' => TRUE,
'date' => $get_header ? 'field_uw_event_date' : NULL,
'sources' => $get_image ? 'field_uw_event_listing_page_img' : NULL,
'content' => $get_content ? 'field_uw_event_summary' : NULL,
'tags' => $get_footer ? ['field_uw_event_tags', 'field_uw_audience', 'field_uw_event_type'] : NULL,
'tags' => $get_footer ? $tag_list : NULL,
];
break;
case 'news':
// The list of tags for news.
$tag_list = [
'field_uw_news_tags',
'field_uw_audience',
];
$teaser_data = [
'title' => $get_header ? TRUE : NULL,
'url' => TRUE,
'date' => $get_header ? 'field_uw_news_date' : NULL,
'sources' => $get_image ? 'field_uw_news_listing_page_image' : NULL,
'content' => $get_content ? 'field_uw_news_summary' : NULL,
'tags' => $get_footer ? ['field_uw_news_tags', 'field_uw_audience'] : NULL,
'tags' => $get_footer ? $tag_list : NULL,
];
break;
}
Loading