Jump to:

3431 Posts in 1058 Topics by 734 members

Data Model Questions

SilverStripe Forums » Data Model Questions » Translation Relationship between pages, parents and children

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

Page: 1
Go to End
Author Topic: 830 Views
  • Ironcheese
    Avatar
    Community Member
    33 Posts

    Translation Relationship between pages, parents and children Link to this post

    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

    cheers,
    alex

    Attached Files
    830 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.