TinyMCE and url handling

4 posts by 3 authors in: Forums > CMS Builder
Last Post: February 13, 2023   (RSS)

By pgplast - February 7, 2023

I have a section editor I use to allow admins to send emails to individuals or groups from the backemnd of my app.

I wish for them to be able to paste or copy urls into the wysiwyg editor field and have an absolute url sent out in the email message.

No matter how I set TinyMCE/s init valiues it continues to change everything to a relartive url. Hence, anyone receiving the email gets a dead link.

The function initWysiwyg has the following:

$includeDomainsInLinks = $SETTINGS['wysiwyg']['includeDomainInLinks'] ? "remove_script_host: false, // domain name won't be removed from absolute links" : '';

Your settings are:

relative_urls: false,
 document_base_url: "/",

I have changed both of these values but cannot get an absolute url such as 

https://nypqcme.org/survey_nl.php?Using-WhatsApp-1

to appear as anything but

/survey_nl.php?Using-WhatsApp-1  or survey_nl.php?Using-WhatsApp-1

I'd appreciate a little primer here!

Thanks.

I found the answer to the issue.

While I had set the following values:

relative_urls :false,
remove_script_host :false,
document_base_url :"http://www.example.com/path1/"

I had been placing the filename alone in my field (e.g. filename.php), thinking that the application would add the document_base_url.

However, I found that if the settings are set as above and the full link is typed into the field, the full link appears in the email, e.g. https://mydomain.com/filename.php

Anyway, thought I would put this up for anyone else who may have been trying for similar outcome.

By Dave - February 13, 2023

Hi pgplast, 

Did you try this setting? 

Admin > General > Advanced Settings > WYSIWYG Options [_] Save full URL for local links and images (for viewers on other domains)

No worries if you didn't catch that, but if you tried it and it didn't work let me know so we can take a look.

Thanks, 

Dave Edis - Senior Developer
interactivetools.com