how to trigger TINYMCE editor to custom field in admin panel
-
Hi, is anyone how to initialize the TinyMCE Editor to our custom field? I have added a field at Configuration -> Email and I was following the template of Edit Product but it is not working. I am not sure did I miss out something else. Thank You in advance.
@push('scripts') <script src="{{ asset('vendor/webkul/admin/assets/js/tinyMCE/tinymce.min.js') }}"></script> <script> $(document).ready(function () { $('#channel-switcher, #locale-switcher').on('change', function (e) { $('#channel-switcher').val() var query = '?channel=' + $('#channel-switcher').val() + '&locale=' + $('#locale-switcher').val(); window.location.href = "{{ route('admin.configuration.index', [request()->route('slug'), request()->route('slug2')]) }}" + query; }) }); tinymce.init({ selector: 'textarea', height: 200, width: "100%", plugins: 'image imagetools media wordcount save fullscreen code table lists link hr', toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor link hr | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat | code | table', image_advtab: true }); </script> @endpush
-
Hi,
You just need to add that snippet to the configuration page. It will work as it will trigger the text area.