Skip to main content

Posts

Showing posts with the label TinyMCE

CakePHP TinyMCE Validation Problem

In development world, daily we face lot of problems, some are big while some are minor. Sometimes it takes a lot of time to fix small one than bigger ones. Similar to this, today I faced a small issue with TinyMCE in CakePHP. It was to set an attribute and to figure it out itself took couple of hours of mine. Then I decided to share it with my readers, thinking that it may save those couple of hours of someone else at some point of time. Problem : TinyMCE notempty validation was not working fine and it was showing following message on console. An invalid form control with name='page [description]' is not focusable Solution :  Set required attribute to be false in view file. For example : <div>                 <div class="umstyle3"><?php echo __('Page Description');?></div>              ...

TinyMCE Common Problems

1)      TinyMCE deletes empty block elements? If you are facing above problem and using version < 3.5.x then following link will be useful. https://github.com/tinymce/tinymce/commit/0eb73591f0d573bd2aee6a07a16ea1d0f51d6742 2)     TinyMCE turning/converting <i> into <em> or something like that? Following answer may be helpful for you. http://stackoverflow.com/questions/3105656/tinymce-turning-i-into-em-on-getcontent you have to change valid_elements option in tiny_mce.js file. 3)     Removing some custom attributes you have entered for an element? For example :  <a data-toggle="collapse" href=”http://dirtyhandsphp.blogspot.in/”>DirtyHandsPHP</a> TinyMCE will remove this custom attributes : data-toggle . Again to keep this as it, you have to add the element attribute in valid_elements as explained in 2nd point as below : a[rel|rev|charset|hreflang|tabindex|accesskey|ty...