I'm attempting to add a new property to the Image media type. Pretty simple, just want to add a Description property I can use for alt text without having to set this up every time.
I've done a fair bit with data types and content types so my code feels right but clearly I'm either missing something, or there's something wrong with the saving of media types.
So, kicks on on startup. As I step through the code it all looks correct, I can see the Image property group gets assigned the new property (please see image below). There are no errors thrown but the property just doesn't display on the media type.
Anyone done this successfully or fancy giving it a go and telling me where I'm going wrong?
Add Property to Media Type Programatically
Hi,
I'm attempting to add a new property to the
Image
media type. Pretty simple, just want to add aDescription
property I can use for alt text without having to set this up every time.I've done a fair bit with data types and content types so my code feels right but clearly I'm either missing something, or there's something wrong with the saving of media types.
My code is as follows:
So, kicks on on startup. As I step through the code it all looks correct, I can see the
Image
property group gets assigned the new property (please see image below). There are no errors thrown but the property just doesn't display on the media type.Anyone done this successfully or fancy giving it a go and telling me where I'm going wrong?
Thanks,
Ben
Hi,
Umbraco has a collection of components, which is created during composition. So if you want the component to run, you need to register it.
Example
Then register it like this:
is working on a reply...