This project is read-only.

Multiple Same Parts in a Content Type

Topics: Customizing Orchard, Writing modules
Apr 18, 2011 at 4:48 PM

Is there a way I can included same parts more than once in a content type?
For example I have a Market Content Type with has Body part, route part, insight part(custom).

And now I want the have 5 insight part in the market type like insight1, insight2...up to insight5.

I read the 1.n n.n tutorial

but the example Address part only has one StateRecord. What if I want the Address part to have five StateRecord (for instance).


Apr 18, 2011 at 5:20 PM

Each part can only occur once in a given content type.

There are various options you can look at;

- If your Insight data can be described as a single string, you could implement it as a Field instead. Fields can be added as many times as needed.

- You could modify your insight part to itself hold a list of items (for instance as a comma-delimited string).

- Your insight part can perform a 1-n join with another table or content item, to hold a list of items.

Which of the above you choose depends on what data is in your part.

Apr 18, 2011 at 6:37 PM

@kailei: that's n-n. Read on the doc topic :)