horst Posted June 7, 2013 Posted June 7, 2013 Hi, I have read in a thread that one can access other language versions from a LanguageTextfield with $myField->->getLanguageValue($language->id); Unfortunately it doesn't work when the LanguageField is within a Repeater. Is this, because the class that serves the getLanguageValue function is LanguagesPageFieldValue , and within a Repeater a Textfield isn't a PageField? And is there a alternative solution ?
ryan Posted June 9, 2013 Posted June 9, 2013 It actually shouldn't matter whether it's in a repeater or not. Repeaters don't change the type of any fields. But your code above has "->->" which looks like a typo? The nice thing about repeaters is that they really aren't anything more than a regular PageArray like any other. And is there a alternative solution ? An alternative is to set $user->language to the language you want the field to return its value in, before you retrieve the value. Then return $user->language back to the language it was before.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now