I made a dashboard for reporting on where each Content Type (doctype) is used (in terms of content nodes) in our Umbraco 12.0.0 installation. This is going to be helpful to clean up configuration that isn’t being used, or isn’t being used much.
The problem I’m having is that we have a lot of “Element Types” that are being used, but since they’re element types, they’re used inside of properties, instead of directly on the Document Type. I can figure out Doctype usage by looping through content nodes and looking at their “ContentType” property, but the Element Types are showing as being unused, when that’s not really true. The problem is, I don’t see any good way to figure out what Document Types the Element Types are used in.
I’m using the IContentTypeService to get data on the Document Types. Those IContentType objects contain a lot of data on the properties, but I don’t see any clear way to pull out the Element Type aliases, unless maybe I hard-code the Data Type Alias of every property editor that uses Element Types, and dig through their data for the Element Type alias.
Is there an easier/cleaner way to do this?
This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/112439-how-can-i-identify-what-element-types-a-doctype-uses-v12-c-api