Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Emil Schoelzer Schnohr 24 posts 144 karma points
    Sep 23, 2022 @ 08:53
    Emil Schoelzer Schnohr
    0

    Translation Manager - Get related/language variant node

    I got a site using the Jumoo Translation Manager package, and with 2 languages (english and spanish). They are created separately under 2 root nodes, one for /en and one for /es.

    When creating a node in the english site, one is automatically created in the spanish one too (TM package handles this). I need to programmatically (C#/razor) find the spanish version of i.e. the home page and vice versa. The whole point is that the user can stay on i.e. the contact page, when changing language. Right now it just send them to the frontpage.

    The database has a table called dbo.Translate_Nodes, and this is what I need. Every line here has a "masterId" (id of the english node) and a "targetId" (id of the spanish node). So there's my link.

    I guess one way is to write an API getting them with SQL, but I'm wondering if the Translation Manager package might have some built in APIs or something, that I can use? Their documentation doesn't really mention this as far as I can tell, so I hope some bright person out there can help me out!

  • Marc Goodson 2155 posts 14408 karma points MVP 9x c-trib
    Sep 24, 2022 @ 08:20
    Marc Goodson
    100

    Hi Emil

    When the page is copied then a link between the two may be created as an Umbraco Relation... Look in the settings section for Relation types...

    You.can use the Relations Service to programmatically find pages related to another page for a particular relation type...

    There is a good introduction here:

    https://our.umbraco.com/documentation/Fundamentals/Data/Relations/

    There is another JuMoo package called Linked Pages that I usually add on 1-1 translated sites that shows on a particular page what the equivalent linked pages are in each language site...

    https://our.umbraco.com/packages/backoffice-extensions/linked-pages/

    Regards

    Marc

  • Emil Schoelzer Schnohr 24 posts 144 karma points
    Sep 26, 2022 @ 06:27
    Emil Schoelzer Schnohr
    0

    Hi Marc

    The Relations Service is what I was looking, I haven't used it before.

    Big thanks!

Please Sign in or register to post replies

Write your reply to:

Draft