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
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).
Thank you so much. It now works!
I love this mailing list, always can get help!
Bin
On Mar 24, 2008, at 3:55 PM, Platonides wrote:
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).
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
mediawiki-l@lists.wikimedia.org