1 jignaciols Jan 27, 2014 12:29
3 mgsolipa Jan 28, 2014 07:50
Hello @jignaciols,
Technically, there is no way to do that with the standard release because linked images are not included in the RSS skin when the Post feed contents = Post excerpts (http://b2evolution.net/man/back-office-reference/managing-collections/collection-features/item-list-features/item-feeds-features). Also, the content of the excerpt will be filtered deleting any html code you have included there.
If you choose "After more" as RSS output mode (check the page linked above), the Teaser images will be included in the output. If this is not good for you, there is a little hack that maybe could be useful:
Locate the file /blogs/skins/_rss2/index.main.php
and look for this line
$content = $Item->get_excerpt();
Note: If you are using version 5.0.6, and have not touched this file before, it should be the line number 127.
Replace that line with this code:
// Display images that are linked to this post:
$content = $Item->get_images( array(
'before' => '<div>',
'before_image' => '<div>',
'before_image_legend' => '<div><i>',
'after_image_legend' => '</i></div>',
'after_image' => '</div>',
'after' => '</div>',
'image_size' => $image_size,
'restrict_to_image_position' => 'teaser' //this line defines which image types will be included in the output
), 'htmlbody' );
$content .= $Item->get_excerpt();
Regards!
4 jignaciols Jan 28, 2014 10:07
Hi mgsolipa,
That code solved my problem perfectly. Thank you very much!
Best regards,
José Ignacio.
5 mgsolipa Jan 28, 2014 11:40
Excellent! You're welcome :D
I explain a bit more,
What I need is that the rss2.0 feed contains the first image of my posts in such a manner that I can extract it with rss2html script, that is to say that could be selected by this script through the order ~~~feedimageurl~~~
Another possibility would be the first one that I asked, that is to say using the excerpt box in the posts, but I have been trying and it looks like only text could be inserted in that box.
Anyone has had this problem before?
How did you solve it?
Best,
José Ignacio López