21309 Posts in 5738 Topics by 2603 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1518 Views |
-
Direct edited HTML content being dropped?

20 February 2009 at 5:54am
I am trying to use the Content Editor and in particular the 'Edit HTML Source' button to input some HTML directly into the content.
However when I enter the HTML and then look at what has been saved - certain sections are missing. An example of a piece of code I am trying to insert is as follows:
<img CLASS="imagelinkpointerout" onmouseover="this.className='imagelinkpointerover'" onmouseout="this.className='imagelinkpointerout'" src="themes/tutorial/images/links/test_logo.gif" width="170" height="106" ALT="Test Logo">
The resultant code is:
<img class="imagelinkpointerout" src="themes/tutorial/images/links/test_logo.gif" border="0" width="170" height="106" ALT="Test Logo">
The onmouseover="this.className='imagelinkpointerover'" and onmouseout="this.className='imagelinkpointerout'" have been dropped for some reason.
I am confused as to why this is happening. Any suggestions on how I can resolve this would be appreciated.
btw - I am running SilverStripe-v2.3.0-rc4
-
Re: Direct edited HTML content being dropped?

20 February 2009 at 5:39pm
The TinyMCE Configuration strips out things like onmouseout. You will have to edit the config settings in cms/javascript/tinymce.template.js under the 'allowed_elements'
-
Re: Direct edited HTML content being dropped?

20 February 2009 at 5:39pm
The TinyMCE Configuration strips out things like onmouseout. You will have to edit the config settings in cms/javascript/tinymce.template.js under the 'allowed_elements'
-
Re: Direct edited HTML content being dropped?

21 February 2009 at 12:06am Last edited: 21 February 2009 12:11am
Thanks for the pointer
Having done some additional reading on TinyMCE, I assume by 'allowed_elements' that you mean 'valid_elements'.
However in the cms/javascript/tinymce.template.js file in SilverStripe-v2.3.0-rc4 there is no 'valid_elements' line. I t seems to have been removed since the SilverStripe-v2.2.3 version - I can't (at the moment) find any mention as to why this should be.Anyway, I followed these recommendations:
http://doc.silverstripe.org/doku.php?id=tinymce&s=tinymce
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration/extended_valid_elementsand added these lines:
valid_elements : "*{*}",
extended_valid_elements : "img[class|src|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]"
Note: The '{' & '}' above are open and close square brackets - had to substitute as Code block incorrectly reformats it :-|Whether the 'extended_valid_elements' line is necessary given that I have selected all elements, I don't know?
However, It still isn't accepting the onmouse over tag :-|
This is becoming frustrating, so any suggestions as to what I am doing wrong would be gratefully received
-
Re: Direct edited HTML content being dropped?

7 May 2009 at 12:59am
Even i m getting the same problem........... pls help us...........
i desperately need help from somebody ................ if there is no solution then i m in trouble...........i added this line
valid_elements : "*
- ",
but no luck...........
- ",
| 1518 Views | ||
|
Page:
1
|
Go to Top |



