Dynamic Content Types

From SocialStack
Revision as of 13:23, 25 November 2022 by Luke (talk | contribs) (Created page with "In general it's recommended to bake content types in to your codebase because it makes it much simpler for incoming developers to see what is available and use th...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

In general it's recommended to bake content types in to your codebase because it makes it much simpler for incoming developers to see what is available and use things like the events system with autocomplete to quickly link up what they need. However there is also some occasions where it would be useful to create a basic one via the admin panel at runtime. These are dynamic content types, and they are available via the Api/CustomContentTypes module:

socialstack i Api/CustomContentTypes

How it works

Content types created via this module are first class citizens: they have the exact same performance characteristics as ones built in to the codebase. This is because the module generates a controller, service and a C# class to represent your content type at runtime. It then runs it through the regular service startup flow which allows things like the permission system and database engine to mount the content type automatically and in the same way it would if it was built in.