Copied to clipboard

Flag this post as spam?

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


  • Thomas 8 posts 119 karma points c-trib
    Feb 05, 2018 @ 09:55
    Thomas
    0

    Read the mapped nodes in code

    Hi, i just installed the multilingual tools, created a property editor for the ActionBar and added it to my document type. Selecting the translations nodes in the content section works without problems but i cannot figure out how to get the selected values in code:

    // using models builder
    var translations = Model.Content.Translations;
    
    // accessing property directly
    var translations2 = Model.Content.GetPropertyValue("translations");
    

    But the variable translations (translations2) is always empty. What am i doing wrong?

    Thanks!

  • Alex Skrypnyk 6055 posts 23216 karma points MVP 5x admin c-trib
    Feb 05, 2018 @ 21:33
    Alex Skrypnyk
    0

    Hi Thomas

    Can you have a look at /App_Data/umbraco.config file - "translations" field, does it store some info?

    /Alex

  • Martijn Maris 37 posts 235 karma points MVP
    Feb 06, 2018 @ 10:37
    Martijn Maris
    100

    Hello Thomas,

    Unfortunately the linked translations aren't accessible as property value (yet). The purpose of the actionbar is to allow you to switch languages in the backoffice only.

    We do, however, have plans to extend the package to make this data available as property value in the near future.

  • Thomas 8 posts 119 karma points c-trib
    Feb 06, 2018 @ 12:35
    Thomas
    0

    Thanks Alex and Martijn for your feedback!

    I really need access to the linked language nodes via the property value, so i'm looking forward for the update :)

  • Davy Lowyck 8 posts 110 karma points
    Apr 18, 2018 @ 09:29
    Davy Lowyck
    0

    The translations are stored as Umbraco Relations so I am assuming we can fetch them with the Relations API?

  • Martijn Maris 37 posts 235 karma points MVP
    Apr 19, 2018 @ 13:37
    Martijn Maris
    0

    That is correct however gathering information about multiple related nodes via the relations API is a bit tricky. The easiest way is probably to call the "Gettranslations" stored procedure and supply the correct relationTypeId and the nodeId you want to get translations for.

    As I said the related nodes aren't available via property value yet.

  • Davy Lowyck 8 posts 110 karma points
    Jun 07, 2018 @ 14:41
    Davy Lowyck
    0

    Thanks!

    Any news on the package extension? Or maybe we can see the source and perhaps contribute?

    Kind regards,

    Davy

  • Martijn Maris 37 posts 235 karma points MVP
    Jul 19, 2018 @ 07:51
    Martijn Maris
    0

    A new package version has just been published. It now allows you to see related nodes via the actionbar property. I did not have enough time to automatically update all actionbar properties so it will only work for newly created translations or when updating translations on a node.

  • Wesley Herpoelaert 52 posts 123 karma points
    Nov 12, 2018 @ 15:00
    Wesley Herpoelaert
    0

    Can you provide some more information how to do this?

    The following code is always empty:

    var translations2 = Model.Content.GetPropertyValue<ActionBar>("translations");
    
  • Martijn Maris 37 posts 235 karma points MVP
    Nov 14, 2018 @ 15:20
    Martijn Maris
    0

    Have you looked into the value stored in the umbraco.config? You can find it in ~/App_Data/umbraco.config. The actionbar value should be set there if you have the latest version of the package. If it's not, try to republish.

    I'm not sure if converting to the actionbar object works.

Please Sign in or register to post replies

Write your reply to:

Draft