Javascript fileobj.url returning absolute path when I want relative
I've begun bending Habari to my will, and just noticed that the javascript-driven image insert feature returns the absolute path by calling fileobj.url
when building the HTML.
This is a bit of a problem when one wants to be able to run a blog mirror on a testbed, since my testbed image inserts are all sourced to d:\websites\habari\...
Is there an easy way to get fileobj
to c开发者_C百科ough out a relative path rather than absolute?
(found all sorts of questions about relative --> absolute, but none the other way!)
You should be able to add Javascript to override habari.media.output
. See the wiki page on Adding Javascript and CSS, as well as the editor plugins, for example jwysiwyg, which do something similar. Then you should be able to remove the domain and path to Habari with a call to Site::url('habari')
and some string munging.
精彩评论