Search code examples
orchardcmsorchard-modulesorchardcms-1.9

Orchard Content Part


I want to create simple page in orchard that has a list of my contentPart (for example: MyTemplatePart).

"MyTemplatePart" has two fields: Title (simple text) and Text (using html editor)

  1. How can I assign the BodyPart type to my field (Text) in orchard? What type must be used for show Bodypart in the View?
  2. How can I attach a list of my contentPart(MyTemplatePart) to a ContentType?

Solution

  • Attaching multiple of the same parts to a content type is not how orchard works. There can always be a maximum of one unique part per content type.

    What you might consider is that your MyTemplate might be a type instead of a part. To create your functionality simply follow these steps:

    1. Create a content type called MyTemplate
    2. Attach the titlepart, bodypart and the containablepart
    3. Attach the containerpart to your page type
    4. Create some instances of MyTemplate and attach them (through the containable) to your page content type instance
    5. Done