Jump to:

5513 Posts in 1732 Topics by 1218 members

Customising the CMS

SilverStripe Forums » Customising the CMS » TreeMultiselectField with translated sitetree

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

Page: 1
Go to End
Author Topic: 989 Views
  • lx
    Avatar
    Community Member
    82 Posts

    TreeMultiselectField with translated sitetree Link to this post

    Hi,

    i have a translated website in 4 languages:

    Object::add_extension('SiteTree', 'Translatable');
    Object::add_extension('SiteConfig', 'Translatable');

    I also have a class for Teasers, just like this:

    class Teaser extends DataObject {
    ...
    public static $db = array('Text' => 'HTMLText');
    public static $belongs_many_many = array('Pages' => 'Page');

    The Teaserclass ist also multilanguage
    Object::add_extension('Teaser', 'Translatable');

    In Modeladmin i am editing all 4 languages of the teasers at once (each in a tab).

    When I add a new teaser in Modeladmin I want to choose on which pages this teaser is shown.

    Therefore I use:

    ...
    $field_Pages_de = new TreeMultiselectField ('Pages', 'show on Pages', 'SiteTree');
    ...

    But now my question
    The SiteTree always shows the Sitetree of the default Language. How can I show the 4 sitetrees for each language?

    thanks

    989 Views
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.