change request for Joomla 3: show intro image in RSS feed

1085 views
Skip to first unread message

Tino Wegner

unread,
Jun 26, 2012, 8:46:21 AM6/26/12
to joomla-...@googlegroups.com
Hello,

I think it would be a nice feature or rather extension if the intro image is shown (if it exists) for every feed entry.
For that I've prepared a code change for view.feed.php located in /components/com_content/views/category and /components/com_content/views/featured:
diff:
- $description = ($params->get('feed_summary', 0) ? $row->introtext.$row->fulltext : $row->introtext);
+ $description = '';
+ $obj = json_decode($row->images);
+ $introImage = ( isset( $obj->{'image_intro'} ) ) ? $obj->{'image_intro'} : '' ;
+ if (isset($introImage) && ($introImage != "")) {
+   $image = preg_match('/http/', $introImage)? $introImage : JURI::root().$introImage;
+   $description = '<p><img src="'.$image.'" /></p>';
+ }
+ $description .= ($params->get('feed_summary', 0) ? $row->introtext.$row->fulltext : $row->introtext);

Mayby someone can forward this request to the Joomla development team.

Thanks & Greetings
Tino

Rune V. Sjøen

unread,
Jun 26, 2012, 8:57:17 AM6/26/12
to joomla-...@googlegroups.com
Hi Tino,

I would encourage you to create a new feature request in the feature tracker at joomlacode and add your patch there.


Regards,
Rune
Reply all
Reply to author
Forward
0 new messages