How to use relative paths for image files?

Post Reply
johannesh19
Ssr. Bludit
Posts: 14
Joined: Fri Mar 12, 2021 5:05 pm
Has thanked: 1 time

Hello everyone!

After some toying around with Bludit I quite like the software. However, there are some quirks that make its use IMO unneccessarily complicated/confusing. I'll address some of those in this and other posts (in order not to mix up subjects).

The first problem is that Bludit, or rather TinyMCE, always creates absolute paths for images. Even if I change the URL in the HTML editor view to a relative path, TinyMCE always changes them back.

This is especially annoying as I usually 1. create pages on localhost, 2. sync them to a non-public URL on my server for 3rd party proofreading and testing and 3. finally push them to their final, publicly available URL. While doing so, the linked images always break.

Of course, I could use the Domain Migrator Plugin, but even that gets annoying if you have to use it 30 times a day. Also it doesn't fit into my mostly automated workflow (which basically consists of a script synchronizing the bl-themes and bl-content folders sans the databases/site.php).

The simplest way to avoid this hassle would be to just use relative paths. Possibly accompanied by the <base>-Tag which could be generated from the site.php.

I couldn't think of any disadvantages of relative paths, so I looked some up – apparently they are problematic in the context of SEO if a website is improperly configured, and they make scraping content slightly easier (although this can be avoided using <base>).

On the plus side, moving content would be much easier, as would be changing server settings, e. g. from http to https. And also apparently they load a wee bit faster, although I've never heard of that and don't have an explanation.

Is there another reason why Bludit forces me to have absolute paths? I'm not familiar with the innards of the system, so I'm open to any explanation.

Also is there a way to change the automatic absolute-ification of my image paths?

Regards,
Johannes

edit: Minor clarification
User avatar
Edi
Site Admin
Posts: 3121
Joined: Sun Aug 09, 2015 5:01 pm
Location: Zurich
Has thanked: 54 times
Been thanked: 77 times
Contact:

Set in the file plugin.php in the directory /bl-plugins/tinymce (line 105)

Code: Select all

relative_urls: true,
instead of

Code: Select all

relative_urls: false,
Clickwork - Websites mit Bludit | Planet Bludit - Tipps und Snippets
Post Reply