CLU Posted December 15, 2011 Report Posted December 15, 2011 HI Guys, Just wondering if anyone got this issue that I have been having, sometimes when i paste content directly into tinymce and try to input more content after the part pasted prior it does not update the database. Even if i safely paste the content in by pressing the paste button, I still get this issue. It doesn't happen all the time, just every so often... Checked the entire cms and cannot spot any errors. the code for Tiny MCE within the v_edit file is the following <!-- jQuery Block Start--> <!-- jQuery is used to catch the forms submit process --> <script type="text/javascript"> jQuery(document).ready(function($){ $('#edit').submit(function(e){ //Disable the default browser refresh e.preventDefault(); //Ajax to process the form var id = "<?php echo $this->getData('block_id')?>"; var type = $('#type').val(); //This is for TinyMCE Ajax <?php if($this->getData('block_type') == 'wysiwyg') {?> tinyMCE.triggerSave(); <?php }?> var content = $('#field').val(); //Passing the values onto Ajax var dataString = 'id=' + id + '&field=' + content + '&type=' +type; //Call ajax $.ajax({ type: "POST", url: "<?php echo SITE_PATH; ?>app/cms/edit.php", data: dataString, cache: false, success: function(html) { $('#cboxLoadedContent').html(html); } }); }); //jQuery to close the box $('#fs_cancel').live('click', function(e){ //This is addressing the issue with open close then reopen issue if(tinyMCE.getInstanceById('field')) { tinyMCE.execCommand('mceFocus', false, 'field'); tinyMCE.execCommand('mceRemoveControl', false, 'field'); } }); }); </script> <?php if($this->getData('block_type') == 'wysiwyg') { ?> <script type="text/javascript"> tinyMCE.init({ // General options mode : "none", skin : "thebigreason", theme : "advanced", plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,\n\ preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,\n\ visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,vimeo,jbimages", // Theme options theme_advanced_buttons1 : "fontsizeselect,bold,italic,underline,strikethrough,justifyleft,justifycenter,justifyright,\n\ justifyfull,link,unlink,paste,pasteword,pastetext,fullscreen,undo,redo,forecolor,backcolor,\n\ code,vimeo,jbimages", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "sub,sup,|,charmap,iespell,advhr,", theme_advanced_buttons4 : "", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "center", height:"300", width:"700" }); //once again below is to load the editor addressing open close issue setTimeout(function() {tinyMCE.execCommand('mceAddControl', false, 'field');}, 0); </script> <? }?> <!-- jQuery Block End--> <div id="fs_wrapper"> <form action="" method="post" id="edit"> <div class="row"> <h1>Edit Content <?php // echo $this->getData('block_id'); ?></h1> <p>Click and edit below</p> </div> <div class="row"> <?php echo $this->getData('cms_field');?> <input type="hidden" id="type" value="<?php $this->getData('block_type');?>"> </div> <br/> <input type="submit" name="submit" class="green_button" value="Submit"> <br/><br/> <a href="#" id="fs_cancel">Cancel</a> </form> If anyone could help that would be great. Kind Regards
CLU Posted December 15, 2011 Author Report Posted December 15, 2011 It seems to be trying to input any content after I have pasted and updated prior, that it does not update the database... so odd.
falkencreative Posted December 15, 2011 Report Posted December 15, 2011 I'd suggest taking a look at the last few posts in this topic: http://www.killersites.com/community/index.php?/topic/5878-cms-tutorial-having-issues/page__p__26818__hl__cms__fromsearch__1#entry26818
CLU Posted December 15, 2011 Author Report Posted December 15, 2011 The post was very helpful, this should prevent the issue that I have been having. Do you think this could be the reason as to why the Vimeo Video was plugin was not working? as this also seemed to break it.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now