2

I'm trying to insert a simple image link in a TinyMCE-wrapped text field, but it's stripping out all of my markup. My markup looks like:

<a class="video-launcher lightbox-video-launcher" href="http://www.youtube.com/watch?v=blah" ><span class="video-launcher-bg"></span><span class="video-launcher-button"></span></a>

My tinymce_config_url_init.html looks like:

{
  "theme_advanced_toolbar_align":"left",
  "content_css":"/media/css/cms_tinymce.css,/media/css/cms_tinymce_admin.css",
  "theme_advanced_blockformats":"p,h2,h3,div,customformat",
  "theme_advanced_statusbar_location":"bottom",
  "theme_advanced_path":false,
  "plugins":"fullscreen,paste",
  "valid_elements":"*[*]",
  "media_strict":false,
  "paste_auto_cleanup_on_paste":true,
  "theme_advanced_styles":"Header 1=header1;Header 2=header2;Header 3=header3;Table Row=tableRow1",
  "width":"680",
  "theme":"advanced",
  "theme_advanced_font_sizes":"8px,10px,12px,14px,16px,18px,20px,24px,36px",
  "theme_advanced_resizing":true,
  "height":"300",
  "relative_urls":false,
  "theme_advanced_toolbar_location":"top",
  "inline_styles":true,
  "language":"en",
  "theme_advanced_buttons1":"fullscreen,|,undo,redo,|,bullist,numlist,|,anchor,link,unlink,charmap,|,code,|,justifyleft,justifycenter,justifyright,|,image,",
  "theme_advanced_buttons3":"",
  "theme_advanced_buttons2":"removeformat,styleselect,formatselect,fontselect,fontsizeselect,|,bold,italic,underline,|,forecolor,backcolor",
  "removeformat_selector":"span,div,p,h1,h2,h3"
}

I know the problem is with TinyMCE, because without submitting the form, and just clicking the "html" button again, TinyMCE's popup shows no content.

I'm assuming TinyMCE is striping out anything it thinks looks insecurity or invalid. For my app, it's being used in an admin section, so the content can be trusted. How do I disable the TinyMCE config causing this markup from being stripped out?

Cerin
  • 60,957
  • 96
  • 316
  • 522

2 Answers2

0

Add your website's css stylesheet to the "content_css" variable, perhaps?

And also set "paste_auto_cleanup_on_paste" to false, not true.

darkAsPitch
  • 1,855
  • 4
  • 23
  • 35
0

You should have a closer look at the tinymce configuration paramters valid_elements. You need to set them accoring to your needs and define valid elements and attributes.

Thariama
  • 50,002
  • 13
  • 138
  • 166