I'm creating a newsletter using my umbraco site's backoffice. I created a
custom section where editors can add content to the newsletter using RTE.
This content is saved in a custom DB but can reference site content.
The problem arrises when editors, in RTE, add a link for a site's content. RTE
witll render it locally, with {locallink:umb} etc attrs, but I reealy need all URLs to be
absolute ones.
Using bellow statment I managed to get relative paths but still need absolute ones because the newsletter is to be sent by email and all links must be absolute.
var content = new HtmlLocalLinkParser(base.UmbracoContextAccessor).EnsureInternalLinks(rteArticle);
// Change from
// href="/{localLink:umb://media/14508b4c10c64f8586bcbb0e933f38fd}"
// to
// href="/media/ksffafgg/wp216_en.pdf"
// but need
// href="https://www.mysite.com/media/ksffafgg/wp216_en.pdf"
Does umbraco have tools to change this or do I have to parse RTE text by myself changing element's href and src?
I would expect you need to do it manually, I would not expect this behavior to be normal since you would not be able to move content from say dev to prod if url's were absolute not relative
I would parse the rte content prior to emailing it out.
I would not expect this behavior to be normal since you would not be able to move content from say dev to prod if url's were absolute not relative
Whilst I accept that this post was made some time ago it is still relevant to a task I am working on now. I don't believe this statement to be correct since the URLs in the RTE should remain as they have always been and will be returned as relative or absolute when a request is made.
RTE transform local urls to absolute
Hi
I'm creating a newsletter using my umbraco site's backoffice. I created a custom section where editors can add content to the newsletter using RTE. This content is saved in a custom DB but can reference site content.
The problem arrises when editors, in RTE, add a link for a site's content. RTE witll render it locally, with {locallink:umb} etc attrs, but I reealy need all URLs to be absolute ones.
Using bellow statment I managed to get relative paths but still need absolute ones because the newsletter is to be sent by email and all links must be absolute.
Does umbraco have tools to change this or do I have to parse RTE text by myself changing element's href and src?
Regards,
Jorge
I would expect you need to do it manually, I would not expect this behavior to be normal since you would not be able to move content from say dev to prod if url's were absolute not relative
I would parse the rte content prior to emailing it out.
Makes sense!
Thanks!!
Whilst I accept that this post was made some time ago it is still relevant to a task I am working on now. I don't believe this statement to be correct since the URLs in the RTE should remain as they have always been and will be returned as relative or absolute when a request is made.
is working on a reply...