TinyMce 'Insert Image' function, cuts off Source URL

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

TinyMce 'Insert Image' function, cuts off Source URL

Post by simonmlewis »

Hi

I've just decided to use the Insert Image function of TinyMCE.
I will build a little tool for a Media Gallery for this website, so users can grab the full URL of the image to use.

However, when you do Insert and the popup appears, the source field doesn't allow all what I am trying in.

I want to put in "/images/pagephotos/filename.jpg", but if I put any / before images, it removes everything before "images".

So even if I put in the full local URL, it stops and shows only what you see in the screenshot.
If I put in //images...... then that DOES work.

I did have some escape code in my script, but have remove that for the moment. I'm a bit stuck.
Attachments
Screenshot
Screenshot
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: TinyMce 'Insert Image' function, cuts off Source URL

Post by simonmlewis »

Love it when I find the answer an can reply to myself:

https://www.drupal.org/node/23182

It's the relative URLs. Tweaking it to:
[text]relative_urls: false, [/text]
.. enables the first slash.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
Post Reply