Jump to:

7940 Posts in 1543 Topics by 946 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Making DataObjects stay in new translations

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 775 Views
  • oleze
    Community Member
    65 Posts

    Making DataObjects stay in new translations Link to this post

    I have added GalleryImageResources and HighlightImageResources to every of my pages. Both extend DataObject. But if I add a new translation to the page, the DataObjects are not inherited from the standard-language version of the page. Can I implement a function to do so?

  • hornergraphic
    Community Member
    4 Posts

    Re: Making DataObjects stay in new translations Link to this post

    Hi Oleze,

    I'm fairly new to SilverStripe but this thread helped me out trying to solve a similar problem to the one you described:


    Seems like you need to implement a function something like this on your Page.php

    public function TranslatedMediaObjects() {
       $Data = $this -> MediaObjects();
       // Get dataobjects from default language page
       if ($this->Locale != Translatable::default_locale()) {
          $Data = $this->getTranslation(Translatable::default_locale()) -> MediaObjects();
       return $Data;

    Then include $TranslatedMediaObjects in your Page.ss template.

Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.