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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

multilingual ChildrenOf()?


Go to End


3 Posts   1300 Views

Avatar
repoman

Community Member, 6 Posts

8 April 2011 at 10:37pm

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

Avatar
martimiz

Forum Moderator, 1391 Posts

8 April 2011 at 11:15pm

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.

Avatar
repoman

Community Member, 6 Posts

9 April 2011 at 12:13am

Works perfectly! Thanks!