Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. Bug Reports
  3. TinyMCE Bug

TinyMCE Bug

Scheduled Pinned Locked Moved Bug Reports
7 Posts 4 Posters 639 Views
  • 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.
  • T Offline
    T Offline
    Timm
    wrote on last edited by
    #1

    Hello! I am getting an error in combination with the Popup Maker Plugin (https://de.wordpress.org/plugins/popup-maker/). The plugin creates a custom post type which uses the normal WP Editor (visual & text).

    customizer/assets/js/tinymce_set_customizer_css.js

    ReferenceError: customizerPassedData is not defined

    This results in tinymce isn´t working anymore.

    I had a look into customizer/customizer.php and commented out the lines 81&82. After that the editor is working correctly. Is there anyway to hook into the method and prevent to load the js for specific post types?

    Thanks in advance!

    1 Reply Last reply
    0
    • mariusjopenM Offline
      mariusjopenM Offline
      mariusjopen
      Global Moderator
      wrote on last edited by
      #2

      Dear @Timm
      because LayTheme is written as a single Javascript-Application some things are not possible.
      For example use extra post types, or include some jQuery scripts.
      Also it is not recommended to modify the theme files, because the changes will get overwritten with the next update.

      It's all a compromise. If you want to use those features, I recommend to have a look at LayGridder.

      Hope I could make things clear :-)

      Best!

      Marius

      www.mariusjopen.world

      1 Reply Last reply
      0
      • T Offline
        T Offline
        Timm
        wrote on last edited by Timm
        #3

        Hi @mariusjopen Marius! Thank you for the answer. I totally understand your position. Using LayGridder isn´t an option at the moment. So I had a look at the the JavaScript itself and fixed it by simply checking the type of the variable before executing the function.

        tinymce.PluginManager.add('setcustomizercss', function( editor ) {
        	
            if(typeof customizerPassedData !== 'undefined') {
                
                var css = String()
                +'a{'
                    +'color:'+customizerPassedData.linkcolor+';'
                    +'border-bottom-style: solid;'
                    +'border-bottom-width: '+customizerPassedData.linkUnderlineStrokeWidth+'px;'
                +'}'
                +'body{'
                    +'background-color:rgb(235,235,235)!important;'
                +'}';
        
                editor.on('PreInit', function(e){
                    editor.contentStyles.push(css);
                });
                
            }
        
        } );
        

        This fixed the problem with tinymce in custom post types. And the customizer still works. Do you see any problem with this fix? If not it would be great if you could have a look at it and propably integrate it within the next update?

        Thank you for your feedack!

        1 Reply Last reply
        0
        • mariusjopenM Offline
          mariusjopenM Offline
          mariusjopen
          Global Moderator
          wrote on last edited by
          #4

          Dear @Timm
          thank you for contributing this!

          We will check if the code fits into the rest of LayTheme.

          All the best and heads up!

          Marius

          www.mariusjopen.world

          1 Reply Last reply
          0
          • arminunruhA Offline
            arminunruhA Offline
            arminunruh
            Global Moderator
            wrote on last edited by
            #5

            Hey thanks!

            I will include it in the next update <3

            1 Reply Last reply
            1
            • T Offline
              T Offline
              Timm
              wrote on last edited by
              #6

              Hey @arminunruh

              great! Thank you!

              1 Reply Last reply
              1
              • A Offline
                A Offline
                auffi
                wrote on last edited by
                #7

                Great! Was looking for this feature for a long time!

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                I also code custom websites or custom Lay features.
                💿 Email me here: 💿
                info@laytheme.com

                Before you post:
                1. When using a WordPress Cache plugin, disable it or clear your cache.
                2. Update Lay Theme and all Lay Theme Addons
                3. Disable all Plugins
                4. Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"

                This often solves issues you might run into

                When you post:
                1. Post a link to where the problem is
                2. Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
                3. If the problem is difficult to explain, post screenshots / link to a video to explain it
                Online Users
                Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                laytheme.com
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Recent
                • Tags
                • Popular
                • Users
                • Search