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.

Data Model Questions

Translation Relationship between pages, parents and children




6 June 2010 at 11:57am (Last edited: 6 June 2010 11:59am), Community Member, 33 Posts

Hi there,

please take a look at my image i attached, first. ;) It will make my text understandable.

I have following situation. My site structure is like in the image shown and what i need is something of a bit more sophisticated TranslationGroupID function.

I have to display a overview off all available SubCategories on my MainCategory page. With each SubCategory I want to display the 5 (or more) latest Projects in that SubCategory. (on the MainCategory page)
On my SubCategory Page i want to list all Projects from this SubCategory.

So far so good. (I managed that, but now comes the tricky part: *drum rolls* Multilanguage!)

First: I dont know how many SubCategories the final Website will have.
Secound: I dont know in which languages the Projects will be saved/created! (So I dont really have something like a "default-language")

I need a solution to display ALL projects, no matter what languages they have and what language my visitor has currently selected.

For example: There will be Projects which are just in German and... lets say: Spanish. A english user, or someone who selected english as language WONT see those projects and thats...well... not good for my client/myself xD

So i need something like a fallback: if this project doesnt have the currently language as translation then display the link with additional informations like: "this project is available in: 'English', 'Spanish' <- the languages it HAS a translation of...

I managed to pull the projects from the vanilla database on the SubCategory Level BUT with a lot of aweful database and dataobject raping... on the MainCategory Level it wont work at all.

Are there functions in silverstripe i have overseen or do i have to set up relationships between the projects and their "language siblings"? And if i have to: how?`How do i dynamicly write something like a "internationalID" to the database and update/check that ID when the project gets translated via translatables....

i hope this makes any sense at all.

Any help would be appreciated :)


Attached Files