Jump to:

23478 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » multilingual ChildrenOf()?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 616 Views
  • repoman
    Avatar
    Community Member
    6 Posts

    multilingual ChildrenOf()? Link to this post

    helo,

    I have a problem with my animation on a multilingual page.

    the jquery animation is put together with

    <% control ChildrenOf(about) %>$image<% end_control %>.

    I probably need an alternative for ChildrenOf(about) as I want to make it work on the German page also but can't come up with one.

    Anyone already dealt with that problem?

    Thanks! reepoman

  • martimiz
    Avatar
    Forum Moderator
    1086 Posts

    Re: multilingual ChildrenOf()? Link to this post

    Assuming you've enabled Translatable for your site, probably the supersimplest way would be someting like this (untested):

    <% if Locale = de_DE %>
    <% control ChildrenOf(germanAbout) %>$image<% end_control %>
    <% else %>
    <% control ChildrenOf(about) %>$image<% end_control %>
    <% end_if %>

    ]

    Else you'd have to create a Page_Controller method returning the right set of children based on the Locale.

  • repoman
    Avatar
    Community Member
    6 Posts

    Re: multilingual ChildrenOf()? Link to this post

    Works perfectly! Thanks!

    616 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.