문제

I've been asked to create several content types that similar, and some that are the same.

For example: Tutorial & Video Tutorial, they're almost the same, but the Video Tutorial has the video id.

Another example: How To Article, Overview Article, etc ... they're all exactly the same (for now anyway), so I'd like to create a single Article type, and basically 'inherit' it somehow.

Can I create an 'IS A' relationship between different types?

Am I asking the wrong question and I should be doing something different?

Or should I just copy & paste the AlterTypeDefinition() multiple times in my migration file? With the richness of Orchard, I'm assuming copy & pasting types isn't the way it should be done.

도움이 되었습니까?

해결책

Just create several different content types, Orchard is all about being able to reuse the parts and fields you make for different content types. No reason why you cant have a bunch of similar but slightly different content types.

For your article content type, as they are the same, have you considered using Taxonomies to classify your articles? So create a taxonomy of ArticleType with all your different article types: How To Article, Overview Article, etc. Create a Article content type and attach a taxonomy field linking to ArticleType so when you create an article there will be a list of available articletypes to classify said article as. Can easily add more later if the need should arise.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top