Absolute urls for internal links added via the Rich Text Editor
We have a multi-site install and for each site there is an RSS feed of news and blog items from the sites. The customer uses a service from MailChimp to consume the RSS feed and send out notifications of new content.
It has come to our attention recently that all internal links inserted via an RTE are being rendered in the feed as relative rather than absolute urls and so when notifications are sent out the links are broken. I should be able to address this in the code we use to generate the RSS feed by parsing the RTE content for links however I am curious to know if it is possible for them to default to absolute via a configuration especially since we have the option useDomainPrefixes set to true in umbracoSettings.config.
Dave, thanks again for pointing me towards that source, it's not something I've stumbled across before now and might come in handy in the future.
On further investigation of this issue it looks like in the case of the relative urls the site editors may have manually entered the urls rather than using the link picker and so the data attributes required to resolve them later on do not exist!
Absolute urls for internal links added via the Rich Text Editor
We have a multi-site install and for each site there is an RSS feed of news and blog items from the sites. The customer uses a service from MailChimp to consume the RSS feed and send out notifications of new content.
It has come to our attention recently that all internal links inserted via an RTE are being rendered in the feed as relative rather than absolute urls and so when notifications are sent out the links are broken. I should be able to address this in the code we use to generate the RSS feed by parsing the RTE content for links however I am curious to know if it is possible for them to default to absolute via a configuration especially since we have the option
useDomainPrefixes
set to true inumbracoSettings.config
.Cheers, Simon
Hi Simon,
Parsing internal links is done using this function :
https://github.com/umbraco/Umbraco-CMS/blob/26a04ca7e91750a796c753f2f071cb1af8045cb1/src/Umbraco.Web/Templates/TemplateUtilities.cs#L43
It uses the url provider, so in theory it should render them absolute.
Dave
Thanks David,
If that is the case then I wonder why it's not already happening? I'll give it a try though and let you know how I get on.
Cheers, Simon
Dave, thanks again for pointing me towards that source, it's not something I've stumbled across before now and might come in handy in the future.
On further investigation of this issue it looks like in the case of the relative urls the site editors may have manually entered the urls rather than using the link picker and so the data attributes required to resolve them later on do not exist!
Hi Simon,
Glad that you found the source of the issue. You can always parse the RTE content using HtmlAgilityPack and fixes the broken links.
But better is to instruct your editors not to put in links manually.
Dave
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.