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:

Archive /

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

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

has_one and ImageField for multilang website


Go to End


1131 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?