Bug reports
Version 3.x > Bug reports > Images in RSS feeds View modes: 
User avatar
Member
Member
gavin.bates@eggheaddesign.co.uk - 8/6/2008 4:16:08 AM
   
Images in RSS feeds
Have set up RSS feed for articles on a site - although when someone views it, none of the images within the articles load - just displays the red cross icon in IE 7.

It seems that when images are inserted the path is local, eg "<img src="../app_themes/....""

So for it to work it needs to have the full URL eg "<img src="http://www.dent...../../...."

Feel it is a minor issue although may prove frustrating for clients that are not HTML 'savvy' Is there anything that can be done in future releases? or have i missed something that avoids this?

Thanks

Gavin

User avatar
Guest
kentico_mirekr - 8/6/2008 9:33:59 AM
   
RE:Images in RSS feeds
Hi Gavin,

Could you please write us here the transformation you are using to display the articles in RSS feed?

Thank you.

Best Regards,
Miroslav Remias

User avatar
Member
Member
gavin.bates@eggheaddesign.co.uk - 8/6/2008 10:07:07 AM
   
RE:Images in RSS feeds
Hi Miroslav

As far as I am aware i just took it from the 3.1 dev guide (pg 528) so the transformation is copied below

*************************************
<item>
<guid isPermaLink="true"><![CDATA[<%# GetAbsoluteUrl
(GetDocumentUrl()) %>]]></guid>
<title><![CDATA[<%# Eval("ArticleTitle") %>]]></title>
<description><![CDATA[<%# Eval("ArticleText") %>]]></description>
<pubDate><%# Convert.ToDateTime(Eval("DocumentModifiedWhen")).
ToString("r") %></pubDate>
<link><![CDATA[<%# GetAbsoluteUrl(GetDocumentUrl()) %>]]></link>
</item>
*************************************

Should a section be included to convert image URL's?

Thanks for the help.

Gavin

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 8/7/2008 12:21:11 PM
   
RE:Images in RSS feeds
Hi Gavin,

The code you are using to render RSS feed seems to be all right. Unfortunately, we were not able to reproduce this issue on our machines while using IE7. Could you please write us also the transformation that you are using when displaying mentioned <img> tag with picture source?

Best Regards,
Miroslav Remias

User avatar
Member
Member
gavin.bates@eggheaddesign.co.uk - 8/8/2008 3:11:51 AM
   
RE:Images in RSS feeds
Ok not sure if i have understood correctly what you have asked but have pasted below the transformation used to view an article on the site (which loads everything fine)...

-----------------------------------------------------------------

<h1><%# Eval("ArticleName") %></h1>
<p>
<%# Eval("ArticleText") %>
</p>
<br />
<div class="clear"></div>
<br />
<!-- AddThis Button BEGIN -->
<div class="article_bott">
<div style="float: left">
<a href="http://www.addthis.com/bookmark.php" onclick="addthis_url = location.href; addthis_title = document.title; return addthis_click(this);" target="_blank"><img src="http://s9.addthis.com/button1-share.gif" width="125" height="16" border="0" alt="Bookmark and Share" /></a> <script type="text/javascript">var addthis_pub = 'gavb24';</script><script type="text/javascript" src="http://s9.addthis.com/js/widget.php?v=10"></script> </div>
<!-- AddThis Button END -->
<div style="float:right;position: relative; margin: -10px 0 0 0;">
<a href="http://www.dental-learninghub.com/CMSPages/articles_rss.aspx" style="border:0;" >
<img src="http://www.dental-learninghub.com/App_Themes/Default/Images/rss.gif" alt="rss" border="0">
</a>
</div>
<div class="clear"></div>
<hr />
<h3>Related Articles</h3>
</div>

--------------------------------------------------------

Hope this can shed some light??

Thanks

Gavin

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 8/11/2008 6:07:55 AM
   
RE:Images in RSS feeds
Hi Gavin,

I'm sorry for misunderstanding, but we basically wanted you to send us your "cms.article.rssitem" transformation. However, it seems that you are not generating your img tag correctly in your cms.article.rssitem transformation.

You can use following example to resolve your links:

<img alt="SomeAlt" src="<%# GetFileUrl("ArticleTeaserImage") %>" />

If this solution is not sufficient for you, you can write your own function that will return full URL path of your source according this http://www.kentico.com/docs/devguide/index.html?adding_custom_functions_to_tra.htm section from the developer's guide.

Best Regards,
Miroslav Remias

User avatar
Member
Member
gavin.bates@eggheaddesign.co.uk - 8/11/2008 7:08:34 AM
   
RE:Images in RSS feeds
Hmm the transformation i use in "cms.article.rssitem" is in my second post on this thread??

The issue seems to be when inserting the images into the article itself (using the wysiwyg) and not the teaser image. It only inserts a relative path. so when converted to the RSS feed the relative paths of the images no longer work.

Is there a way of setting up so inserting image within the text areas automatically has absolute paths?

Thanks

Gavin

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 8/11/2008 8:19:56 AM
   
RE:Images in RSS feeds
Hi Gavin,

Thank you for the "(using the wysiwyg) and not the teaser image" information, it was very helpful.

I suggest you to use following transformation:

<description><![CDATA[ <%# HTMLHelper.ResolveUrls(Eval("ArticleText").ToString(),HttpContext.Current.Request.ApplicationPath.ToString()) %> ]]></description>

This method ensures, that all of the relative URLs will be resolved if "src" or "href" is presented.

Best Regards,
Miroslav Remias

User avatar
Member
Member
gavin.bates@eggheaddesign.co.uk - 8/18/2008 5:39:01 AM
   
RE:Images in RSS feeds
Thanks Miroslav

Added the code to the transformation and worked fine in Firefox - although it has been a few days and the issue persists in at least IE7 and Safari.

Please find below the transfomation 'rssitem'

/***************************************/

<item>
<img alt="SomeAlt" src="<%# GetFileUrl("ArticleTeaserImage") %>" />
<guid isPermaLink="true"><![CDATA[<%# GetAbsoluteUrl
(GetDocumentUrl()) %>]]></guid>
<title><![CDATA[<%# Eval("ArticleTitle") %>]]></title>
<description><![CDATA[<%# Eval("ArticleText") %>]]>
</description>
<description><![CDATA[ <%# HTMLHelper.ResolveUrls(Eval("ArticleText").ToString(),HttpContext.Current.Request.ApplicationPath.ToString()) %> ]]></description>
<pubDate><%# Convert.ToDateTime(Eval("DocumentModifiedWhen")).
ToString("r") %></pubDate>
<link><![CDATA[<%# GetAbsoluteUrl(GetDocumentUrl()) %>]]></link>
</item>

/*************************************/

here is the address for the RSS feed =
www.dental-learninghub.com/CMSPages/articles_rss.aspx

I have also noticed the the article titles do not appear, is there anything obvious that i have missed from the transformation?

Thanks for all the help...

Gavin

User avatar
Member
Member
gavin.bates@eggheaddesign.co.uk - 8/18/2008 5:42:46 AM
   
RE:Images in RSS feeds
Just a quick update - the aticle title just need changing from

<%# Eval("ArticleTitle") %>]]>
to
<%# Eval("ArticleName") %>]]>

So it was something minor...

User avatar
Guest
gavin.bates@eggheaddesign.co.uk - 8/18/2008 6:33:51 AM
   
RE:Images in RSS feeds
Just a quick update - the aticle title just need changing from

<%# Eval("ArticleTitle") %>]]>
to
<%# Eval("ArticleName") %>]]>

So it was something minor...

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 8/18/2008 6:37:28 AM
   
RE:Images in RSS feeds
Hello,

Thanks for the update.

Best Regards,
Boris Pocatko

User avatar
Member
Member
gavin.bates@eggheaddesign.co.uk - 8/18/2008 6:43:46 AM
   
RE:Images in RSS feeds
Sorry i was just informing that the title issue i mentioned is resolved although i am still having problems with RSS images as mentioned a few posts above.

Incase there was any confusion...

Gavin

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 8/18/2008 8:04:22 AM
   
RE:Images in RSS feeds
Hi Gavin,

The problem you are having now is due to the limitation in IE and Opera. You can only have one <description> tag in your transformation. Firefox can handle this operation.

I suggest you to use only one <description> tag in your transformation.

Your transformation should look like this:

<item>
<img alt="SomeAlt" src="<%# GetFileUrl("ArticleTeaserImage") %>" />
<guid isPermaLink="true"><![CDATA[<%# GetAbsoluteUrl
(GetDocumentUrl()) %>]]></guid>
<title><![CDATA[<%# Eval("ArticleName") %>]]></title>
<description><![CDATA[ <%# HTMLHelper.ResolveUrls(Eval("ArticleText").ToString(),HttpContext.Current.Request.ApplicationPath.ToString()) %> ]]></description>
<pubDate><%# Convert.ToDateTime(Eval("DocumentModifiedWhen")).
ToString("r") %></pubDate>
<link><![CDATA[<%# GetAbsoluteUrl(GetDocumentUrl()) %>]]></link>
</item>

Best Regards,
Miroslav Remias

User avatar
Member
Member
gavin.bates@eggheaddesign.co.uk - 8/18/2008 8:29:34 AM
   
RE:Images in RSS feeds
Ahhh! easy when you know how...

Works a treat - thanks for all the quick responses.