$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>Set tinymce direction to rtl|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

Set tinymce direction to rtl

matteradmin8PV0评论

I install Tinymce editor to my site. And now i need to set the default direction to RTL not LTR.

I try this way but not work with me :-

#tinymce p {
 direction : rtl;
}

How can do that ??

I install Tinymce editor to my site. And now i need to set the default direction to RTL not LTR.

I try this way but not work with me :-

#tinymce p {
 direction : rtl;
}

How can do that ??

Share Improve this question asked Feb 18, 2015 at 16:31 Kotsh GFXKotsh GFX 436 bronze badges 5
  • In WordPress, if you enable a RTL language, TinyMCE directionaly setting is atuomatically set to RTL. What are trying to do exactly? – cybmeta Commented Feb 18, 2015 at 17:47
  • where can set this setting – Kotsh GFX Commented Feb 18, 2015 at 17:52
  • "I install Tinymce editor to my site" - are you actually using WordPress? – vancoder Commented Feb 18, 2015 at 18:53
  • yes i use WordPress – Kotsh GFX Commented Feb 19, 2015 at 9:45
  • 1 3 years later, RTL editing still a PITA. I thought Wordpress was a good choice. I thought a decade-old global platform would have ironed out such issues. I thought wrong. – Rolf Commented May 11, 2018 at 4:15
Add a comment  | 

2 Answers 2

Reset to default 6

In wordpress, the editor will support and will be in RTL by default if you install it in an rtl language, for example, if you install wordpress with the hebrew UI the editor will be rtl by default.

The problem is if you install the hebrew UI but change your profile to use the English one, in order to still use the editor in rtl mode while using the English UI you can add this code to functions.php or a site plugin:

function Eyal_setEditorToRTL($settings)
{
    $settings['directionality'] = 'rtl';
    return $settings;
}
add_filter('tiny_mce_before_init', 'Eyal_setEditorToRTL');

The filter alters the default settings for the tinyMCE editor and set it in rtl mode.

 tinymce.init({
        selector: 'textarea#editor', 
        directionality :"rtl"
});

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far