You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

Support is currently Offline

Official support hours
Monday to Friday
09:00 - 17:00 Europe/London (BST)

Please create a new Ticket and we will get back to you as soon as we can.

#116350 root-relative URLs for images upon article saving

Posted in ‘Editor’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by Lobo on Monday, 04 March 2024 15:55 GMT

Lobo
Hi there!
i am using relative urls, but when saving the article/module the leading slash goes away from the image path.
relative URLs (without leading slash "/") encounter issues when used in certain contexts like AJAX requests (like in pagination) because they are resolved based on the current page's URL.
Root-relative URLs (with a leading slash "/") are resolved relative to the root directory of the website, regardless of the current page's URL, so the links will not break in AJAX requests.

my question is, is it possible to adjust the editor settings accordingly to prevent this action and keep the leading slash in the image urls?

thank you in advance
David

Ryan
In Editor Profiles -> Editor Parameters -> Cleanup & Output, set URL Conversion to None.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Lobo
Hello Ryan and thank you for the reply
i did that but the images are still whitout the "/" in the editor.
When rendered by the browser, they get the "/" but not in the html editor, so they do not render with a Ajax call.
any additional advice or hack would be great
thank you
David

Ryan
Apologies I misunderstood. I thought you were adding the leading slash to the images and it was being remobevd by the editor. The URL Conversion = None option would prevent this.

When rendered by the browser, they get the "/" but not in the html editor, so they do not render with a Ajax call.


Relative URLs in the front-end are resolved to the correct URL by the Joomla System SEF plugin, os in this case the plugin is adding the leading slash. Whatever is executing the AJAX call would need to resolve the url values itself, otherwise you need to add the leading slash to the image when you insert it.

Ryan Demmer

Lead Developer / CEO / CTO

Just because you're not paranoid doesn't mean everybody isn't out to get you.

Lobo
Thank you for your reply.
yes, adding the leading slash by hand solves it, but is very annoying for a day-to-day management.
the absolute url solves it as well, and the ajax will have it with no issues.
i will try to see if there is any hack to solve this
thank you