Hopefully you can help me with a problem I'm finding hard to figure out the answer to!
I have a custom module which has various orchard content types and so on. It's all working fine and now I'd like to add a piece of functionality where the users can set up content type definitions and then map them to sets of data that are pulled from outside
Orchard (and that I don't want or need to be persisted in Orchard). The reason for creating content items and content parts is so that the user can use the existing, user-friendly way of creating definitions and mapping them to content parts that we also supply
in our module.
So! The problem is that I need to create a non-persisting content item which welds the correct content parts as set out in the definition, and therefore hits the correct drivers and handlers for those parts.
(Sorry that this must be quite confusing for people! )
We definitely don't want to create an actual content item that is saved in the database, we simply want to create on on the fly so that the built in display methods load up the various parts defined on the content type definition.
I found this blog post about faking content items for testing purposes -
, but one issue is that I'm not sure how to retrieve a class of the correct ContentPart type based on the information supplied by the ContentTypeDefinition.
If you could help point me in the right direction to either retrieve or create new instances of ContentParts (based on info from the definition) I think this would help me get further.