Bin Hu wrote:
Hi,
Can anyone tell me how to include svg in mediawiki?
I wrote some hook function to process a special markup, which returns
something like this:
$svg = '<div><object data="images/test.svg" width=100%
height=100%
type="image/svg+xml"/></div>';
return ($svg);
In the page view this code brings me to the new page: Images/test.svg
test.svg does exist in images directory. I guess the path in PHP is
incorrect? Can anyone point me out the error I made? Thanks.
Bin
You probably are accessing it from /wiki/Article, so image/text.svg is
treated as relative, ie: /wiki/image/text.svg which is article
Image/text.svg
If your $wgScriptPath is "/w" you want to link to /w/images/test.svg
Not being absolute to the server root only causes headaches (think in
subarticles).