Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Simon Dingley 1470 posts 3427 karma points c-trib
    Mar 10, 2017 @ 09:17
    Simon Dingley
    0

    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.

    Cheers, Simon

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Mar 11, 2017 @ 07:59
    Dave Woestenborghs
    1

    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

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Mar 12, 2017 @ 07:45
    Simon Dingley
    0

    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

  • Simon Dingley 1470 posts 3427 karma points c-trib
    Mar 13, 2017 @ 11:31
    Simon Dingley
    0

    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!

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Mar 13, 2017 @ 11:45
    Dave Woestenborghs
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft