开发者

Anyone successfully using SVGs in Joomla?

Anyone managed to do this?

I've tried using embed, object, and iframe, entered from either the TinyMCE or the CodeMirror editors. I'm turning on html view and directly adding someth开发者_高级运维ing like this to a page:

<embed src="rect.svg" width="300" height="100"
type="image/svg+xml"
pluginspage="http://www.adobe.com/svg/viewer/install/" />

This doesn't work on either editor. When I 'save', both editors silently remove my new HTML. TinyMCE will show the graphic in the editor window, but it disappears as soon as I save. I can't find anything in Google, and I can't immediately see why Joomla would have enough interest in an embed element to remove it. If Joomla can't do it, can anyone suggest a CMS that can display SVGs? I need to produce a website whose sole purpose is to display SVGs... :(


Various good answers at http://forum.joomla.org/viewtopic.php?f=615&t=628714.


In Joomla! 1.5.8 and later, a default filtering choice is in place for those who have not selected an Article Filter option. The default applied for those who have not made a selection implements "black list" filtering as a security precaution against possible XSS. In version 1.5.8, all users, including members of the Super Admin group, have this set by default. In versions 1.5.9 and later, users in the Super Admin group do not have any filtering by default.

Due to this change, you might notice problems trying to save a Youtube video, or embedding other Javascript or Flash objects into your Articles or as in your case, adding SVG.

Changing the Article Global Configuration

If the default filtering option is not suitable for your needs, you can change it by using the Article Global Configuration options. For example, to change the default settings so that no filtering happens for members of the Super Administrator group:

  1. Navigate to Content → Article Manager.
  2. Press the Parameters icon in the toolbar to show the Articles - Global Configuration screen.
  3. Scroll down to Filtering Options, highlight all Filter groups except Super Aministrator, and select Filter type of Blacklist (Default), as shown in the screenshot below.

Anyone successfully using SVGs in Joomla?

With this setting, Joomla! will use the default Blacklist filter for all users except for the Super Administrator group. If you want to let other groups of Users submit content with no filtering, just modify the instructions above to exclude these groups. If you want no filtering on any groups, follow the instructions above but select only the Registered group.

TinyMCE Editor Configuration

If you are using the Tiny MCE Editor, you may also want to adjust these settings in the plugin:

  • Code Cleanup on Startup → Off
  • Code Cleanup on Save → Always (TinyMCE since Joomla! version 1.5.12)
  • Do Not Clean HTML Entities → Yes (In Joomla! version 1.5.15 and later, it is called Entity Encoding -> Raw)

I would recommend you use JCE ... It's way more advanced than TinyMCE. You can toggle code display by clicking (show/hide) to see the code or move to the WYSIWYG


A different approach is to use plugins and modules to display SVGs. www.netriver.co.uk uses Joomla and embeds SVGs with a little XSLT to add animations.


Check this plugin: http://www.jkr.su/joomla-extensions/plugins/svg-helper

It was written to solve this issue.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜