Full Image Path in Product Feed?

Greg Laycock asked on February 1, 2017 23:37

Good afternoon. This is a simple question that I'm sure has a simple answer that has so far eluded me. I have created an RSS feed of a product catalog with the Products RSS Feed webpart. I'm trying to display a full-path link to the image SKUImagePath. I can get everything but the domain, so it seems.

This snippet in the tranformation <image_link><%# EvalCDATA("SKUImagePath") %></image_link>

outputs this in the RSS feed <image_link><![CDATA[~/getmetafile/604511c3-7350-47e8-808a-02649df13f41/TS4000_6002_Cropped.aspx]]></image_link>

The path is correct, but how do I add the domain? Thanks!

Kentico 10.0 ASPX templates + portal

Recent Answers


Brenden Kehren answered on February 1, 2017 23:54

Try using <%# URLHelper.GetAbsoluteUrl(EvalCDATA("SKUImagePath")) %>

1 votesVote for this answer Mark as a Correct answer

Greg Laycock answered on February 2, 2017 17:15

This was the first thing I tried, Brenden. (I suppose I should have mentioned this. My apologies.) Oddly enough, adding this breaks the feed entirely: the output doesn't contain any product items.

0 votesVote for this answer Mark as a Correct answer

Greg Laycock answered on February 2, 2017 17:19

For reference sake, here the entire transformation:

<item>
    <id><%# EvalCDATA("SKUNumber") %></id>
    <title><%# EvalCDATA("SKUName") %></title>    
    <description><%# EvalCDATA("SKUShortDescription") %></description>
    <image_link><%# EvalCDATA("SKUImagePath") %></image_link>
    <link><![CDATA[<%# GetAbsoluteUrl(GetProductUrlForFeed(Eval("SKUGUID"),Eval("SKUName"),Eval<int>("NodeSiteID")),Eval<int>("NodeSiteID")) %>]]></link>
</item>
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.