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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

has_one and ImageField for multilang website


Reply


915 Views

Avatar
LANKO

Community Member, 3 Posts

7 November 2008 at 7:31am

Edited: 07/11/2008 7:32am

how can i add different image for different languages?

i'v

...
class Page extends SiteTree
{
   static $has_one = array(
      'MenuImg' => 'Image'
   )

...

than

...

$fields->addFieldToTab("Root.Content.Images", new ImageField('MenuImg','Menu image'));

...

but when i change image for one language version it's changed for another.

i try:

...
   static $extensions = array(
      "Translatable('MenuImg')"
   );
...

but it doesn't help, and what is more using $extensions and Translatable it seems to me that other fields from Page became one language field.

can someone explain how i can meke it works?