0
votes

I have added a content type in my custom orchard recipe but when I try to create an instance of that content type within the recipe nothing happens.

Declaration:

<Metadata>
    <Types>
      <Speedbump ContentTypeSettings.Creatable="True" ContentTypeSettings.Draftable="True" TypeIndexing.Indexes="Search">
        <TitlePart />
        <BodyPart />
        <CommonPart />
      </Speedbump>
    </Types>
    <Parts>
      <BodyPart BodyPartSettings.FlavorDefault="html" />
    </Parts>
  </Metadata>

Creation:

<Command>
 Speedbump create /Slug:"valid-url" /Title:"Valid URL" /Path:"valid-url" /Homepage:false /Publish:true /UseWelcomeText:false
</Command>

Any ideas as to why this isn't working? I can go into the site after it is created and my speedbump type is defined and creatable but the instance that should have been created by the recipe doesn't exist. Thank you.

1
Is that speedbump create command implemented in your module? It is not a standard Orchard command.devqon

1 Answers

1
votes

This isn't how you create content items in recipes. You add xml in the <Data> tag like so:

<Data>
    <Speedbump Id="" Status="Published">
          <BodyPart Text="Hello this needs to be encoded" />
          <CommonPart Owner="/User.UserName=admin" CreatedUtc="2014-09-05T16:09:13Z" PublishedUtc="2014-09-05T16:15:43Z" ModifiedUtc="2014-09-05T16:15:43Z" />
          <TitlePart Title="My Page" />
    </Speedbump>
</Data>

For any custom parts, you will need to implement Import and Export functions in your driver method. Check core modules for good examples