Copied to clipboard

Flag this post as spam?

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


  • Justin 1 post 71 karma points
    Jan 30, 2019 @ 22:06
    Justin
    0

    How to match the alias id that is preserved in Usync with the value stored in a document type

    Greetings!

    Starting off, I'm just getting into Umbraco, so apologies if this is super obvious.

    I have a radio button that selects different presentation configurations for the screen. I can see when I add elements to the radio button, Usync creates elements in their proper location, but when I set and attempt to retrieve values, they come back not as the alias Usync has, but rather an id that was incremented (I'm guessing) from how the CMS was created document and data types in the database.

        var umbracoHelper = new Umbraco.Web.UmbracoHelper(Umbraco.Web.UmbracoContext.Current);
        Node currentNode = Node.GetCurrent();
        Node currentHomeNode = new Node(int.Parse(currentNode.Path.Split(',')[1]));
        var currentHome = umbracoHelper.TypedContent(currentHomeNode.Id);
    
        //get the document type
        var settings = currentHome.Children.First(x => x.IsDocumentType("settings"));
    
        //get the value saved on the document type
        var idValue = settings.GetProperty("ThemeSelector").Value;
    

    In this instance, IdValue is 527 instead of 3. (it's the third element in the Usync radio button)

    How do I reconcile the id that Umbraco has assigned the radio button with the underlying Usync id or alias?

  • Lee 35 posts 83 karma points
    May 14, 2019 @ 13:33
    Lee
    0

    Hey, @Justin, did you ever get this figured out? I would like to know how you reconciled the IDs.

    , Lee

Please Sign in or register to post replies

Write your reply to:

Draft