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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

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

Switch directionality per instance ?


Go to End


1421 Views

Avatar
rob.s

Community Member, 78 Posts

27 April 2012 at 9:59pm

when having multiple instances on one page, is it possible to switch the directionality per instance

E.G.:

public function getCMSFields() {
	$f = parent::getCMSFields();
	foreach($this->getTranslationFields() as $field) {		    
		$title = $field->Title();
		// last 5 characters are respresenting the locale 
		// en_GB, de_DE, ar_SA
		$locale = substr($title, strlen($title)-5));
		if( $field instanceof HtmlEditorField && $locale == 'ar_SA' ) {
			// what to do here, to switch the directionality?????
		}
		$f->addFieldToTab("Root.Translations", $field);
	}
	return $f;
}

Any ideas would be great !