vanilla-thunder / oxid-module-tinymce

TinyMCE + Roxy Filemanager for OXID eShop CE 4.7 - 4.10
GNU General Public License v3.0
20 stars 13 forks source link

use relative urls based on the document root #20

Open kaluzki opened 6 years ago

kaluzki commented 6 years ago

Meanwhile we use relative urls in our shop environments relative_urls => true. IMO it could be the default behaviour.

But actually relative urls (without leading slash) don't work properly:

Loading the image

<img src="images/example.jpg">

from seo url http://shop/category/product.html instead of http://shop/index.php?id=<id> will end up in 404 Not Found http://shop/category/images/example.jpg

Possible solution

https://github.com/vanilla-thunder/bla-tinymce/blob/3abd1dbeb8ff26e31ebf1c2e9c3f456c36f2cd19/copy_this/modules/bla/bla-tinymce/application/core/blatinymceoxviewconfig.php#L196

return (tinyMCE.activeEditor.settings.relative_urls) ? "/" + tinyMCE.activeEditor.documentBaseURI.toRelative(url) : tinyMCE.activeEditor.documentBaseURI.toAbsolute(url);