embedding HTML or svg and <embed>
Added by Paul Gresham almost 15 years ago
Hi there,
I would like to use the <embed> tag to be able to display some of our architecture drawings, which are all svg. It would be much nicer to upload the svg than convert to images all the time.
Can I:
- Embed html in wiki pages as per textile? This seems disabled (I can see why), or
- Is anyone working on this. It would seem a logical place to put it would be for the ! markup to detect an svg file and generate the embed tags. Any other ideas?
Thanks
Paul
Replies (7)
RE: embedding HTML or svg and <embed> - Added by Ted Lilley over 14 years ago
I've been successful embedding videos and such by adding all of the necessary tags to the ALLOWED_TAGS constant in the redcloth module. The module is in the redmine installation directory as redmine/lib/redcloth3.rb. Search for the constant, add your tags and restart Redmine.
I added object, script, param, a, img and embed to get the following:
ALLOWED_TAGS = %w(redpre pre code notextile object script param a img embed)
This allows me to embed wmv video in Redmine using the following html:
<object id="MediaPlayer" width=640 height=566 classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"> <param name="filename" value="http://redmine/attachments/220/filename.wmv"> <param name="Showcontrols" value="True"> <param name="autoStart" value="False"> <param name="wmode" value="transparent"> <embed type="application/x-mplayer2" src="http://redmine/attachments/220/filename.wmv" name="MediaPlayer" autoStart="False" wmode="transparent" width="640" height="566" ></embed> </object>
You can attach the filename to the issue (or wiki) and then copy the hyperlink to the attachment in order to fill in the correct filename in the code above.
That code contains embedding twice (once as embed and once as object) in order to work with both Firefox and IE. You need to tweak the player height and width as well as filename (and autostart, if you want) in both links in order for everything to work properly.
RE: embedding HTML or svg and <embed> - Added by arthur me about 14 years ago
This is super helpful- thanks for posting this. It'd be nice if these tags were a configurable option per role (Drupal does something like this with input filters).
RE: embedding HTML or svg and <embed> - Added by Paul Gresham about 14 years ago
This is very useful, embarrassingly I somehow didn't post a thankyou to Ted at the time ... Thanks Ted, much appreciated!!
RE: embedding HTML or svg and <embed> - Added by Ted Lilley about 14 years ago
Hey don't sweat it. I've gotten far more help than I've given, like most of us, just grateful to contribute.
RE: embedding HTML or svg and <embed> - Added by kiran patil about 13 years ago
Hello,
How to embed html5 videos using RedCloth ?
Thanks,
Kiran Patil.
RE: embedding HTML or svg and <embed> - Added by Ivan Cenov over 12 years ago
Ted Lilley wrote:
I've been successful embedding videos and such by adding all of the necessary tags to the ALLOWED_TAGS constant in the redcloth module. The module is in the redmine installation directory as redmine/lib/redcloth3.rb. Search for the constant, add your tags and restart Redmine.
I added object, script, param, a, img and embed to get the following:
[...]
This allows me to embed wmv video in Redmine using the following html:
[...]
You can attach the filename to the issue (or wiki) and then copy the hyperlink to the attachment in order to fill in the correct filename in the code above.
That code contains embedding twice (once as embed and once as object) in order to work with both Firefox and IE. You need to tweak the player height and width as well as filename (and autostart, if you want) in both links in order for everything to work properly.
Technically, how to embed
<object id="MediaPlayer" width=640 height=566 classid="CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Windows Media Player components..." type="application/x-oleobject" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"> <param name="filename" value="http://redmine/attachments/220/filename.wmv"> <param name="Showcontrols" value="True"> <param name="autoStart" value="False"> <param name="wmode" value="transparent"> <embed type="application/x-mplayer2" src="http://redmine/attachments/220/filename.wmv" name="MediaPlayer" autoStart="False" wmode="transparent" width="640" height="566" ></embed> </object>in a issue or a comment or a wiki page? I've just copied above code in a comment (changed the URL only) but saw black square only.
RE: embedding HTML or svg and <embed> - Added by Goran Hasse over 7 years ago
Hello!
I have tried this for svg-images like this
<embed src="process-beskrivning.svg" type="image/svg+xml" />
Is it mandatory to have the "object" tag also?
I have applied the patch from
And then the images shows in an ordinary
tag.
But I want the svg clickable (links) and therefor i need the embed tag.