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.

Archive /

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

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

Trying to get two different news archives for two different languages


Go to End


3 Posts   1757 Views

Avatar
cabrilo

Community Member, 3 Posts

15 October 2008 at 6:55am

Hello all!

I'm new to SilverStrip, so please if you tell me to RTFM please provide a link as well :) Anyway, here is my problem:

I have a website in two languages. I want each language to have it's own news archive (much like the one created in tutorial). So, I would present totally different content depending on the language, not just translate news...

How would I go about this?

My original idea was to create two holders, one for Default Language, other for Secondary Language. Then, I would, depending on the language, get Childrenof (HolderForLanguage), and display them. However, in order for Secondary Language pages to display at all, I would have to write a dummy page in Default Language, and then translate into Secondary Language, which seems like a hassle.

Any ideas?

Avatar
(deleted)

Community Member, 473 Posts

15 October 2008 at 8:10am

If I understand how i18n works in SilverStripe, you should be able to use the same code, just create articles in the language, and the method that gets the articles should only return articles written in the current language.

Avatar
cabrilo

Community Member, 3 Posts

15 October 2008 at 9:16am

Simon,

Thanks, but how can I write an article in any language? i.e. without doing a translation?