diff --git a/core/modules/aggregator/aggregator.pages.inc b/core/modules/aggregator/aggregator.pages.inc index 57339b4..ec3f5a7 100644 --- a/core/modules/aggregator/aggregator.pages.inc +++ b/core/modules/aggregator/aggregator.pages.inc @@ -7,6 +7,7 @@ use Drupal\aggregator\Plugin\Core\Entity\Feed; use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Language\Language; /** * Page callback: Displays all the items captured from the particular feed. @@ -416,11 +417,9 @@ function aggregator_page_rss() { } $feeds = $result->fetchAll(); - return array( - '#theme' => 'aggregator_page_rss', - '#feeds' => $feeds, - '#category' => $category, - ); + + print theme('aggregator_page_rss', array('feeds' => $feeds, 'category' => $category)); + drupal_exit(); } /** @@ -478,8 +477,14 @@ function template_preprocess_aggregator_page_rss(&$variables) { $variables['description'] = check_plain(decode_entities(strip_tags($description))); $variables['items'] = $items; - $langcode = (isset($category['langcode']) ? $category['langcode'] : language(LANGUAGE_TYPE_CONTENT)->langcode); - $variables['langcode'] = check_plain($langcode); + /** + * Use RSS language code if found, otherwise default to existing page language code + */ + if (isset($category['langcode'])) + $variables['langcode'] = check_plain($category['langcode']); + // Try to default to the site language code + elseif (!isset($variables['langcode'])) + $variables['langcode'] = language(Language::TYPE_CONTENT)->langcode; // Pass along any channel args to be rendered after the language code. if (isset($category['args']) && is_array($category['args'])) { @@ -510,7 +515,8 @@ function aggregator_page_opml($cid = NULL) { } $feeds = $result->fetchAll(); - return theme('aggregator_page_opml', array('feeds' => $feeds)); + print theme('aggregator_page_opml', array('feeds' => $feeds)); + drupal_exit(); } /** diff --git a/core/modules/aggregator/templates/aggregator-page-opml.html.twig b/core/modules/aggregator/templates/aggregator-page-opml.html.twig index 035d76c..8132624 100644 --- a/core/modules/aggregator/templates/aggregator-page-opml.html.twig +++ b/core/modules/aggregator/templates/aggregator-page-opml.html.twig @@ -4,11 +4,11 @@ * Default theme implementation to present @todo. * * Available variables: - * - title: @todo. - * - date: @todo. - * - feeds: @todo. - * - feed.title: @todo. - * - feed.url: @todo. + * - title: Title of the feed. + * - date: Last date feed was modified. + * - feeds: An associative array of feed items containing: + * - feed.title: Title of the feed item. + * - feed.url: URL to the feed item. * * @see template_preprocess() * @see template_preprocess_aggregator_page_opml() @@ -16,8 +16,8 @@ * @ingroup themeable */ #} - - + + {{ title }} {{ date }} diff --git a/core/modules/aggregator/templates/aggregator-page-rss.html.twig b/core/modules/aggregator/templates/aggregator-page-rss.html.twig index 9ad37ea..9c121c5 100644 --- a/core/modules/aggregator/templates/aggregator-page-rss.html.twig +++ b/core/modules/aggregator/templates/aggregator-page-rss.html.twig @@ -9,6 +9,7 @@ * - description: RSS channel description. * - language: RSS channel language code. * - items: RSS feed items. + * - args: Any channel args to be rendered after the language code. * * @see template_preprocess() * @see template_preprocess_aggregator_page_rss() @@ -16,8 +17,8 @@ * @ingroup themeable */ #} - - + + {{ title }} {{ link }}