mascotasavila Posted August 26, 2015 Share Posted August 26, 2015 Hi, i'm try to add tinyMCE or Ckeditor to textarea used on customizes products on front end. Anyone have a idea? Thanks! Link to comment Share on other sites More sharing options...
vekia Posted August 27, 2015 Share Posted August 27, 2015 if your textarea contains own class / id you can do it easily insert this code to product.tpl {literal} <script type="text/javascript" src="path-to-the/tinymce/tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ selector: "#mytextarea" }); </script> {/literal} this is for id #mytextarea but you can add it to .mytextarea or any other class / id you want Link to comment Share on other sites More sharing options...
mascotasavila Posted August 28, 2015 Author Share Posted August 28, 2015 This is my code textarea on product.tpl <textarea class="form-control customization_block_input" id="textField{$customizationField}" name="textField{$field.id_customization_field}" rows="3" cols="20"> {strip} {if isset($textFields.$key)} {$textFields.$key|stripslashes} {/if} {/strip}</textarea> And then i add the code: <textarea class="form-control customization_block_input" id="textField{$customizationField}" name="textField{$field.id_customization_field}" rows="3" cols="20"> {strip} {if isset($textFields.$key)} {$textFields.$key|stripslashes} {/if} {/strip}</textarea> {literal} <script type="text/javascript" src="../js/tiny_mce/tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ selector: "#form-control customization_block_input" }); </script> But don't work, i think ii'm doing something wrong... Link to comment Share on other sites More sharing options...
vekia Posted August 30, 2015 Share Posted August 30, 2015 hello does it spawn some js errors in browser console? Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted August 30, 2015 Share Posted August 30, 2015 Hello... <script type="text/javascript" src="../js/tiny_mce/tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ selector: "#form-control customization_block_input" }); </script> may be your selector is wrong.try this <script type="text/javascript" src="../js/tiny_mce/tinymce.min.js"></script> <script type="text/javascript"> tinymce.init({ selector: ".customization_block_input" }); </script> Link to comment Share on other sites More sharing options...
vekia Posted September 1, 2015 Share Posted September 1, 2015 yea sure this can generate problems since in tinymce we have to select only one-level css element Link to comment Share on other sites More sharing options...
mascotasavila Posted September 3, 2015 Author Share Posted September 3, 2015 Hi , thanks for the replies .I tried using the options of class " .customization_block_input " and class " .rte " .When using class " .customization_block_input " there is an error in js :Uncaught TypeError : Can not read property 'split ' of undefinedB @ tinymce.min.js : 2 ( anonymous function) @ tinymce.min.js : 2u @ tinymce.min.js : 2nd @ tinymce.min.js : 2h @ tinymce . min.js : 2x @ tinymce.min.js : 2u @ tinymce.min.js : 2When using class " rte " no js error but neither works. Link to comment Share on other sites More sharing options...
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