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.

Content Editor Discussions

Forum for content editors and CMS users.

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

tiny mce image edit problem


Go to End
Reply

10 Posts   4320 Views

Avatar
mattman

9 February 2010 at 9:25pm Community Member, 18 Posts

Hi

I am trying to replace the code:

img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|name]

with

img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|style]

hoping to get the image positioning to work for my client - and cannot find out where to do this as there is no tinymce config file to edit??

IMAGE EDITING IS CURRENTLY COMPLETELY DISFUNCTIONAL which is a major PROBLEM - it does not remember / publish horizontal, vertical space and border when right click edited and the alignment options do not match the insert options which I can edit through the typography.css, which means I have to delete the picture and reinsert. My clients cannot edit the site easily which is a major concern!!!

I have searched for hours and cannot find a solution. PLLLLLLLLLLLLLLS HEEEEEEEEEEEEEELP this is urgent.

MANY THANKS!!!

Avatar
Willr

10 February 2010 at 11:19am Forum Moderator, 5511 Posts

Its defined in the cms/_config.php file under the 'extended_valid_elements' option in HtmlEditorConfig settings. If you want to customize the valid elements you'll probably want to do so from your own code rather than editing core http://doc.silverstripe.org/doku.php?id=htmleditorconfig

Avatar
mattman

10 February 2010 at 11:53am Community Member, 18 Posts

Hi Willr

Thanks so much for responding - I had a look at this and cannot figure out how the required code fits into the setOption(’optionname’, ‘value’) ? - I am very new to Silverstripe.

Any assistance would be greatly appreciated as the deadline is tomorrow!

Many thanks again

Avatar
Willr

10 February 2010 at 12:13pm Forum Moderator, 5511 Posts

In your mysite/_config file add

HtmlEditorConfig::get('cms')->setOption('extended_valid_elements', "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap|style],iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]");

Avatar
mattman

10 February 2010 at 12:42pm Community Member, 18 Posts

Thanks a MILLION Willr - unfortunately the end of your code got cut off - can you please resend??

Avatar
mattman

10 February 2010 at 12:57pm Community Member, 18 Posts

Please dont waste your time I figured it out - THANKS AGAIN!

HtmlEditorConfig::get('cms')->setOption('extended_valid_elements', "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap|style],iframe[src|n");

Avatar
mattman

10 February 2010 at 1:01pm Community Member, 18 Posts

HtmlEditorConfig::get('cms')->setOption('extended_valid_elements', "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|
usemap|style],iframe[src|n");

Avatar
Tomae

15 June 2010 at 10:42pm Community Member, 14 Posts

Hi all... I want to have "onmouseover" & "onmouseout" functionality for "<a>" tags .... I tried this way

HtmlEditorConfig::get('cms')->setOption('extended_valid_elements', "a[id|class|style|href|onmouseout|onmouseover],script[type|src],img[id|class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name|usemap],iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling],object[width|height|data|type],param[name|value],map[class|name|id],area[shape|coords|href|target|alt]");

but again tinyMCE strips out my code.....

Pls help me to figure out the problem.....

Thanks

Go to Top