newbthenewbd / grav-plugin-tinymce-editor

TinyMCE Editor Integration Plugin for Grav
Other
60 stars 10 forks source link

Use twig-y paths (page://, theme:// etc.) for images #41

Closed OndraX closed 4 years ago

OndraX commented 4 years ago

I'm using Grav in a project for a client, so the markdown editor's not suitable, and I'd like to let him add images but with relative paths. With TinyMCE, clicking the "plus" icon next to an image in the media tray autofills the absolute path. Since I'll often be working on my local copy during development and maintenance, I really can't do with the absolute paths. Grav's twig-y paths would be ideal, but I suppose relative paths will do (though they're quite subpar given how ModRewrite works out -- you have to include the current page's name in the portion after the dot, so no changes to the page name allowed for the client) Now when I semi-automatically change all the paths to relative, this shows up correct online, in my local copy and in my local copy's editor, but on the online editor, the images turn up blank, which won't do. I'm synchronising the two versions via git.

newbthenewbd commented 4 years ago

The soon-to-be release of the plugin is planned to deprecate the currently used semi-absolute paths, in favor of fully relative paths.

Could You please install the latest development version as described here and report back on whether that solution completely suits Your needs? The way it is implemented - just like Grav sets up the paths for Markdown - it does not require the inclusion of the page's name.

Thanks!

OndraX commented 4 years ago

Many thanks, this is precisely it! Thanks for the info, should have been obvious to use the newest version.

newbthenewbd commented 4 years ago

Glad that You like it! Certainly there exists no need to assume that it should have been obvious, though, primarily because development versions may likely contain bugs (feel free and welcome to notify, should some be found), and thus aren't yet full-fledged releases, but also because I've only uploaded that version two days ago... :slightly_smiling_face:

Thanks for the feedback!