MicroTiny remove first slash from image URL

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
minik
Forum Members
Forum Members
Posts: 11
Joined: Tue Feb 08, 2011 4:07 pm

MicroTiny remove first slash from image URL

Post by minik »

Hello,

I have some problem with Tiny WYSIWYG. I use pretty URL, and when I insert image to the content using WYSIWYG, the image URL is always relative. When I insert first slash to the image URL, WYSIWYG remove it automatically.

Example:
I have image.jpg in directory /uploads
When I insert this image to the page content, WYSIWYG generate its URL like uploads/image.jpg
I manually rewrite this URL to /uploads/image.jpg, but WYSIWYG automatically rewrite this to upload/image.jpg again.

The result is that if I have image on the page in second and deeper level, image URL looks for example:
http://www.domain.tld/first-level-page/uploads/image.jpg which is wrong.

Correct URL is http://www.domain.tld/uploads/image.jpg.

I'm using CMSMS 2.2.7. I tried MicroTiny and TinyMCE with the same results.

Doing something wrong? Miss I some settings somewhere?

Thank you for any help or idea.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3484
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: MicroTiny remove first slash from image URL

Post by velden »

Well, a solution to this can be to use the <base href="{cms_rooturl}"> tag in your page template (<head> section) https://www.w3schools.com/tags/tag_base.asp

By default this <base> tag comes with the {metadata} tag.
Locked

Return to “Modules/Add-Ons”