Bagisto Forum

    Bagisto

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    how to trigger TINYMCE editor to custom field in admin panel

    General Discussion
    2
    2
    314
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      SP last edited by

      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
      

      11e5bfe6-4bb0-472b-83ca-0283698555aa-Screenshot 2022-03-30 at 3.25.51 PM.png

      1 Reply Last reply Reply Quote 0
      • devansh-webkul
        devansh-webkul last edited by

        Hi,

        You just need to add that snippet to the configuration page. It will work as it will trigger the text area.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post