Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Can wysiwyg editor be modified to allow all tags?


Reply


17 Posts   4293 Views

Avatar
Possibles

Community Member, 16 Posts

27 January 2012 at 2:16am

Edited: 27/01/2012 2:20am

Hello

I have the kind of same problem : I need to be able to use this code

<embed src="sample.mov" width="320" height="256"></embed>


to be able to show quictktime movie in page.

So I tried to use the technqiue you're talking about and added embed[type|width|height|src|*] to the list of elements in _config.php:

The code looks now like this but even after dev/build it doesn't work and turns my <embed> tag into <object>

HtmlEditorConfig::get('cms')->setOption('valid_elements', "@[id|class|style|title],#a[id|rel|rev|dir|tabindex|accesskey|type|name|href|target|title|class],
embed[type|width|height|src|*],-strong/-b[class],-em/-i[class],-strike[class],-u[class],#p[id|dir|class|align|style],-ol[class],
-ul[class],-li[class],br,img[id|dir|longdesc|usemap|class|src|border|alt=|title|width|height|align],-sub[class],-sup[class],-blockquote[dir|class],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|dir|id|style],-tr[id|dir|class|rowspan|width|height|align|valign|bgcolor|background|bordercolor|style],tbody[id|class|style],thead[id|class|style],tfoot[id|class|style],#td[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],-th[id|dir|class|colspan|rowspan|width|height|align|valign|scope|style],caption[id|dir|class],-div[id|dir|class|align|style],-span[class|align|style],-pre[class|align],address[class|align],-h1[id|dir|class|align|style],-h2[id|dir|class|align|style],-h3[id|dir|class|align|style],-h4[id|dir|class|align|style],-h5[id|dir|class|align|style],-h6[id|dir|class|align|style],hr[class],dd[id|class|title|dir],dl[id|class|title|dir],dt[id|class|title|dir],@[id,style,class]");

Any idea why ? Maybe it oesn't work with all tags ?

T

Avatar
x75

Community Member, 42 Posts

27 January 2012 at 2:26am

Just a guess: Try putting a space before the closing </embed> Tag. I know iframe Tags cause trouble without that. maybe this is the same problem.

Johannes

Avatar
Possibles

Community Member, 16 Posts

27 January 2012 at 2:32am

Edited: 27/01/2012 2:38am

Hello thanks

I just tried your suggestion

<embed src="sound.mov" width="216" height="16"> </embed>

I even tried this

HtmlEditorConfig::get('cms')->setOption('verify_html', 'false');

But no luck. I don't get it ???

Maybe I misunderstood something

Thanks

Avatar
x75

Community Member, 42 Posts

27 January 2012 at 2:46am

hm, ok.

What exactly is the problem you have?

Is the embed Tag removed from the HTMLText once you save it, or does it get messed up, or what happens?

Avatar
Possibles

Community Member, 16 Posts

27 January 2012 at 3:31am

Hello

Well this : <embed src="sample.mov" width="320" height="256"> </embed>

Turn into this

<p>
<object width="320" height="256" data="sample.mov" type="application/x-shockwave-flash">
<param name="src" value="sample.mov" />
</object>
</p>

Thank you

Avatar
x75

Community Member, 42 Posts

27 January 2012 at 4:07am

Edited: 27/01/2012 4:07am

have a look at [url]http://www.tinymce.com/forum/viewtopic.php?id=23773 [/url]

that might be your problem.

Avatar
Possibles

Community Member, 16 Posts

27 January 2012 at 4:21am

Thanks

It seems that it could be it .

My problem is to find where I can find the string 'media_strict : false' to change it

I searched SS forum with that string it but nothing came up

Do you know if there is some js file with that setting somewhere ?

Thanks

Avatar
x75

Community Member, 42 Posts

27 January 2012 at 4:27am

I would guess you just need to add it as a new option:

HtmlEditorConfig::get('cms')->setOption('media_strict', 'false');