We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29525
    • 388 Posts

    I’m trying to add some classes on the appearance tab of the image insert/edit dialogue box.

    On the TinyMCE plugin configuration tab, I enter
    Image Right=imageright; Image Left=imageleft;

    in the Advanced Image Styles field and save the document. However, anything after the first = disappears. So only Image Right remains in the field and appears on the class pull down.

    I’m logged in as the default admin.

    I’m stumped.

    Terry

      www.terrybarthdesign.com
      • 10449
      • 956 Posts
      Well, I’m stumped too >:(

      I see my class-name in the dropdown, I can select it, but when I view the generated code in my browser, it’s just
      class="undefined"

      When I go back to the plugin configuration page of tinyMCE, I see that everything after the first class name is cut off (i.e. everything after - and including - the first = character).

      Assuming this is a limitation of MODx (you can’t use certain special characters in snippet values such as = & ?): Is there a way I can hard-code those custom classes in a tinymce config file?
      And if yes, which one? The plugin folder has 901 files... too much to scan them all through.
        • 10449
        • 956 Posts
        Here’s a little update:

        I tried adding the classes in tinymce.functions.php, but then suddenly tinyMCE stopped working altogether!
        Probably wrongly escaped double quotes, but I don’t have time to fiddle around with that now...
        FYI:
        I replaced
        $tinymceInit .= (!empty($advimage_styles) ? "		  advimage_styles : \"".$advimage_styles."\",\n" : "");

        with:
        $tinymceInit .= "		  advimage_styles : \"Copy Image Right=copy-image-right\"\",\n";


        approx. at line 180.


        What DID work, however, was to change assets/plugins/tinymce212/jscripts/tiny_mce/plugins/advimage/image.htm

        <select id="classlist" name="classlist">
        
        <!--	
        original line:
        <option value="" selected>{$lang_not_set}</option>	
        -->
        
        <option value="">{$lang_not_set}</option>
        <option value="copy-image-right">Copy Image Right</option>
        
        </select>
        


        Ugly? Maybe. But it works smiley
          • 29525
          • 388 Posts
          Ganeshxl

          Well I was relieved to know it’s not just me and that I’m not losing my mind. I’ve done this on other sites with no problem.

          However, now I think I AM losing my mind!

          I hadn’t looked this for a while, so just went back to it now. Guess what? Now it seems to be working perfectly! I have no idea what changed. Ugh!

          I appreciate you taking time to look at it! I guess this means I can’t help you resolve this either. Sorry man.

          Terry
            www.terrybarthdesign.com