We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 14779
    • 256 Posts
    I just upgraded to 0.9.6, and was very suprised at the changes in TinyMCE. I read the wiki article, but am unable to change the template. I select a new template, and click save, but it does not change off simple. I would prefer Advanced, or Content Editor. What’s going on?
      PM me to find out how you can get a FREE ipad 2!
    • Check your user profile for overrides.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 14779
        • 256 Posts
        Ah, Marvelous! Thanks.
          PM me to find out how you can get a FREE ipad 2!
          • 20944
          • 3 Posts
          After upgrading to 0.9.6, I have a strange problem that seems to be related. The TinyMCE Theme does not print the "selected" text to indicate which option I have selected in the Manager Settings Interface, so the Simple theme is always shown even though it is not what is in the database settings. The change to a different editor theme is recorded in the database and the setting is pulled from the database without a problem. I have even duplicated the code for the $themeOptions variable as shown to see how it prints out and it works fine on the snippet I created to test the code. I have been scratching my head as to why the selected text is not printing. Any thoughts would be much appreciated.

          I have been looking at the following code:

          From the TinyMCE Snippet:
          case "OnInterfaceSettingsRender":
          		$manager_language = $modx->config['manager_language'];                
          		$html = getTinyMCESettings($_lang, $tinyPath, $modx->config['manager_language'], $modx->config['use_editor'], $modx->config['tinymce_editor_theme'], $modx->config['tinymce_css_selectors'], $modx->config['tinymce_custom_plugins'], $modx->config['tinymce_custom_buttons1'], $modx->config['tinymce_custom_buttons2'], $modx->config['tinymce_custom_buttons3'], $modx->config['tinymce_custom_buttons4'], $displayStyle);
          		$e->output($html);
          		break;
          


          From the TinyMCE.functions.php:
          		$arrThemes[] = array("simple",$_lang['tinymce_theme_simple']);
          		$arrThemes[] = array("advanced",$_lang['tinymce_theme_advanced']);
          		$arrThemes[] = array("editor",$_lang['tinymce_theme_editor']);
          		$arrThemes[] = array("custom",$_lang['tinymce_theme_custom']);
          		$arrThemesCount = count($arrThemes);
          		for ($i=0;$i<$arrThemesCount;$i++) {
          				$themeOptions .= "					<option value=\"".$arrThemes[$i][0]."\"".($arrThemes[$i][0] == $theme ? " selected=\"selected\"" : "").">".$arrThemes[$i][1]."</option>\n";
          		}
          

          The HTML output from TinyMCE for the theme info.
          <tr class='row1' style="display: $display"> 
          
          <td nowrap class="warning"><b>{$_lang["tinymce_editor_theme_title"]}</b></td> 
          
          <td><select name="tinymce_editor_theme">{$themeOptions}</select></td> 
          
          </tr> 


          My Custom snippet, which successfully displays the select option from the database:
          $manager_language = $modx->config['manager_language'];
          $path = $modx->config['base_path'].'assets/plugins/tinymce2111'; 
          include_once($path.'/lang/'.$manager_language.'.inc.php');
          $theme = $modx->config['tinymce_editor_theme'];
          
                         $arrThemes[] = array("simple",$_lang['tinymce_theme_simple']);
          		$arrThemes[] = array("advanced",$_lang['tinymce_theme_advanced']);
          		$arrThemes[] = array("editor",$_lang['tinymce_theme_editor']);
          		$arrThemes[] = array("custom",$_lang['tinymce_theme_custom']);
          		$arrThemesCount = count($arrThemes);
          		for ($i=0;$i<$arrThemesCount;$i++) {
          				$themeOptions .= "					<option value=\"".$arrThemes[$i][0]."\"".($arrThemes[$i][0] == $theme ? " selected=\"selected\"" : "").">".$arrThemes[$i][1]."</option>\n";
          		}
                          echo("<select>".$themeOptions."</select>");
          

            • 20944
            • 3 Posts
            I figured out the problem. There was an issue with IIS permissions on the cache folder in the assets folder. For some reason, even though I had this setup during the upgrade, and things worked well, something did not stick or wasn’t applied properly. Therefore, the settings weren’t being stored as necessary. I really dislike IIS but I have little choice in the matter.