Copied to clipboard

Flag this post as spam?

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


  • David Burrows 7 posts 77 karma points
    Feb 10, 2020 @ 11:51
    David Burrows
    0

    Reading Custom Property Editor configuration settings from C#

    Hi all,

    I'm trying to get the Custom Property Editor's setting from within C#. I can find the custom property "attached" to a node using the following code, but not sure how then to get its Editor settings related to this instance of the Property Type?

    Thanks Dave

            var _umbracoHelper = new UmbracoHelper( UmbracoContext.Current );
            var homeNode = _umbracoHelper.TypedContentAtRoot().FirstOrDefault();
            var streamNode = homeNode.Descendants( node_alias ).FirstOrDefault(); 
    
            // Trying to find the Stream Id from the Property Editor Settings/Config
            foreach( var prop in streamNode.Properties )
            {
                var propType = streamNode.ContentType.GetPropertyType(prop.PropertyTypeAlias);
                if( propType.PropertyEditorAlias == "Damibu.CustomEditor"){
                    //then do something here
                }
            }
    
Please Sign in or register to post replies

Write your reply to:

Draft