RSS Atom Feed - Need URLs in Ephox body to be published as absolute and not relative

Folks:

I am publishing an Atom feed with snippets generated from various “article” content items gathered into the master feed item and all is good except that I need to have src = “” URLs in these entries to be absolute rather than relative paths. Now this stuff is from the Ephox bodies of the articles and the publsihed <IMG> srcs are of course relative links as are <a> hrefs. I need for them instead to be rendered as absolute paths. How can I do such a thing?

You could create a separate content list, and assembly context (copy your existing one) in Publishing design for the atom feeds. Associate the content list with that new Assembly context on the Edition. Finally, in the new publishing Context change the location schemes to use the absolute URL instead of the relative URL.

-n

[QUOTE=tireregroover;20916]Folks:

I am publishing an Atom feed with snippets generated from various “article” content items gathered into the master feed item and all is good except that I need to have src = “” URLs in these entries to be absolute rather than relative paths. Now this stuff is from the Ephox bodies of the articles and the publsihed <IMG> srcs are of course relative links as are <a> hrefs. I need for them instead to be rendered as absolute paths. How can I do such a thing?[/QUOTE]

Have you looked at the discussion about canonical links? Canonical Links

Also: Rss Feed Absolute Paths
Update:
Sorry, I didn’t address your problem specifically, (ie where the content in say the summary field of a feed needs to have an absolute path). I created a macro (which is being used when displaying feeds) that parses the content and replaces the href and src with absolute urls:


#macro(makeAbsoluteUrls $string $defaultSiteBase $returnStr)##
#set($string = $string.replaceAll("href=\"/", "href=\"${defaultSiteBase}/"))##
#set($string = $string.replaceAll("src=\"/", "src=\"${defaultSiteBase}/"))##
## case when quote has been escaped
#set($string = $string.replaceAll("href="/", "href="${defaultSiteBase}/"))##
#set($string = $string.replaceAll("src="/", "src="${defaultSiteBase}/"))##
#set($returnStr = $string)##
#end##

Then call this macro on the contents of the rendered field.

I have not looked into creating a separate content list as it is not a viable solution for us (or one that would make sense with a couple hundred sites).

Jitendra,

You are right, there are a couple ways to approach this and your method below probably involves less work. In your macro where are you pulling the base url from? Are you using $sys.site.url or is it coming from a different location?

-n

[QUOTE=jitendra;20919]Have you looked at the discussion about canonical links? Canonical Links

Also: Rss Feed Absolute Paths
Update:
Sorry, I didn’t address your problem specifically, (ie where the content in say the summary field of a feed needs to have an absolute path). I created a macro (which is being used when displaying feeds) that parses the content and replaces the href and src with absolute urls:


#macro(makeAbsoluteUrls $string $defaultSiteBase $returnStr)##
#set($string = $string.replaceAll("href=\"/", "href=\"${defaultSiteBase}/"))##
#set($string = $string.replaceAll("src=\"/", "src=\"${defaultSiteBase}/"))##
## case when quote has been escaped
#set($string = $string.replaceAll("href="/", "href="${defaultSiteBase}/"))##
#set($string = $string.replaceAll("src="/", "src="${defaultSiteBase}/"))##
#set($returnStr = $string)##
#end##

Then call this macro on the contents of the rendered field.

I have not looked into creating a separate content list as it is not a viable solution for us (or one that would make sense with a couple hundred sites).[/QUOTE]

I use $rx.location.siteBase (See: Rss Feed Absolute Paths