Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Switching tinyMCE direction with RTL content


Go to End


2656 Views

Avatar
sajok

Community Member, 82 Posts

26 January 2010 at 5:13am

Hello

I'm working on a mulitilanguage website with arabic as the default language and French. I'm trying to set the directionality option in TinyMCE to RTL for Arabic content only:

In mysite/code/page.php I added:

public function getCMSFields() {
$fields = parent::getCMSFields();
$locale = Translatable::get_current_locale();
if ($locale == 'ar_MA') {
HtmlEditorConfig::get('cms')->setOption('directionality', 'rtl');

return $fields;
}
}

Using this code I can edite content in Arabic easily from right to left. However, I can't access to the french translation pagewhen I click on it.

I assume the problem is caused by the conditional "if ($locale == 'ar_MA')" which I added to the code, since i'm not sure of the correct way to do it. I appreciate any help..

thanks