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.

Thanks for sharing that

Jerry Kornbluth

The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php