summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Pott2013-05-24 17:21:31 (GMT)
committerAlex Pott2013-05-24 17:21:31 (GMT)
commit7016229fc1ccf1cd449e5f12312a3889dba5ac67 (patch)
treeda98ac04eec0f9b831443abd7a1bb8c14b8025ea
parentf202b5625ae4afcfeba2aa17e5e7430b24319f77 (diff)
Issue #1843758 by joelpittet, jpamental, tlattimore: Convert views/templates/views-view-row-rss.tpl.php to twig.
-rw-r--r--core/modules/views/templates/views-view-row-rss.html.twig23
-rw-r--r--core/modules/views/templates/views-view-row-rss.tpl.php15
-rw-r--r--core/modules/views/views.theme.inc12
3 files changed, 31 insertions, 19 deletions
diff --git a/core/modules/views/templates/views-view-row-rss.html.twig b/core/modules/views/templates/views-view-row-rss.html.twig
new file mode 100644
index 0000000..0622e09
--- /dev/null
+++ b/core/modules/views/templates/views-view-row-rss.html.twig
@@ -0,0 +1,23 @@
+{#
+/**
+ * @file
+ * Default theme implementation to display an item in a views RSS feed.
+ *
+ * Available variables:
+ * - title: RSS item title.
+ * - link: RSS item link.
+ * - description: RSS body text.
+ * - item_elements: RSS item elements rendered as XML (pubDate, creator, guid).
+ *
+ * @see template_preprocess()
+ * @see template_preprocess_views_view_row_rss()
+ *
+ * @ingroup themeable
+ */
+#}
+ <item>
+ <title>{{ title }}</title>
+ <link>{{ link }}</link>
+ <description>{{ description }}</description>
+ {{ item_elements }}
+ </item>
diff --git a/core/modules/views/templates/views-view-row-rss.tpl.php b/core/modules/views/templates/views-view-row-rss.tpl.php
deleted file mode 100644
index 01e0696..0000000
--- a/core/modules/views/templates/views-view-row-rss.tpl.php
+++ /dev/null
@@ -1,15 +0,0 @@
-<?php
-
-/**
- * @file
- * Default view template to display a item in an RSS feed.
- *
- * @ingroup views_templates
- */
-?>
- <item>
- <title><?php print $title; ?></title>
- <link><?php print $link; ?></link>
- <description><?php print $description; ?></description>
- <?php print $item_elements; ?>
- </item>
diff --git a/core/modules/views/views.theme.inc b/core/modules/views/views.theme.inc
index e987ffd..e17f44f 100644
--- a/core/modules/views/views.theme.inc
+++ b/core/modules/views/views.theme.inc
@@ -910,12 +910,16 @@ function template_preprocess_views_view_rss(&$vars) {
}
/**
- * Default theme function for all RSS rows.
+ * Prepares variables for views RSS item templates.
+ *
+ * Default template: views-view-row-rss.html.twig.
+ *
+ * @param array $vars
+ * An associative array containing:
+ * - row: The raw results rows.
*/
function template_preprocess_views_view_row_rss(&$vars) {
- $view = &$vars['view'];
- $options = &$vars['options'];
- $item = &$vars['row'];
+ $item = $vars['row'];
$vars['title'] = check_plain($item->title);
$vars['link'] = check_url($item->link);