Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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(',')));
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?
Hey, @Justin, did you ever get this figured out? I would like to know how you reconciled the IDs.
Sorry this is a year late, but we resigned to string comparisons for the name, which, obviously, could screw us up if that changes. Without a better direction, we went with what.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted