有没有办法让自定义配方向页面添加一些文字和图像字段?它似乎是配方处理命令的一部分,但我在@ http://docs.orchardproject.net/Documentation/Using-the-command-line-interface
找不到任何执行此操作的命令更新
感谢Bertrand的回应,但是有一些问题。
我从租户中导出了一切配方,其中包含1.添加的字段,2。向页面添加部分以及3.添加的列表和4.添加的容器窗口小部件到显示列表的默认图层。 / p>
<Metadata>
<Types>
<Page ContentTypeSettings.Draftable="True" TypeIndexing.Included="true">
<TagsPart />
<LocalizationPart />
<TitlePart/>
<AutoroutePart />
<ContainablePart />
<AmazonProductsPart />
<YouTubeVideosPart />
</Page>
</Types>
<Parts>
<BodyPart BodyPartSettings.FlavorDefault="html" />
<Page ContentPartSettings.Attachable="True">
<Thumbnail.ImageField DisplayName="Thumbnail" ImageFieldSettings.MaxHeight="75" ImageFieldSettings.MaxWidth="75" ImageFieldSettings.Required="False" ImageFieldSettings.AlternateText="True" ImageFieldSettings.ResizeAction="Validate" />
<PageImage.ImageField DisplayName="PageImage" ImageFieldSettings.MaxHeight="250" ImageFieldSettings.MaxWidth="0" ImageFieldSettings.Required="False" ImageFieldSettings.AlternateText="True" ImageFieldSettings.ResizeAction="Resize" />
<PreContent.TextField DisplayName="PreContent" ImageFieldSettings.MaxHeight="0" ImageFieldSettings.MaxWidth="0" ImageFieldSettings.Required="False" ImageFieldSettings.AlternateText="False" ImageFieldSettings.ResizeAction="Validate" TextFieldSettings.Flavor="Html" TextFieldSettings.Required="False" />
<PostContent.TextField DisplayName="PostContent" ImageFieldSettings.MaxHeight="0" ImageFieldSettings.MaxWidth="0" ImageFieldSettings.Required="False" ImageFieldSettings.AlternateText="False" ImageFieldSettings.ResizeAction="Validate" TextFieldSettings.Flavor="Html" TextFieldSettings.Required="False" />
</Page>
</Parts>
</Metadata>
...
<Data>
<List Id="/alias=page-list" Status="Published">
<CommonPart Owner="/User.UserName=admin" CreatedUtc="2012-05-26T22:52:20Z" PublishedUtc="2012-05-26T22:57:37Z" ModifiedUtc="2012-05-26T22:57:37Z" />
<AutoroutePart Alias="page-list" UseCustomPattern="false" />
<AdminMenuPart AdminMenuPosition="2" OnAdminMenu="false" />
<MenuPart MenuText="Page List" MenuPosition="3" OnMainMenu="false" />
<ContainerPart ItemContentType="Page" ItemsShown="true" Paginated="true" PageSize="10" OrderByProperty="CommonPart.CreatedUtc" OrderByDirection="1" />
<TitlePart Title="Page List" />
</List>
<ContainerWidget Id="" Status="Published">
<CommonPart Owner="/User.UserName=admin" Container="/Layer.LayerName=Default" CreatedUtc="2012-05-26T22:55:42Z" PublishedUtc="2012-05-26T22:55:42Z" ModifiedUtc="2012-05-26T22:55:42Z" />
<WidgetPart Title="Page List" Position="1" Zone="AsideFirst" RenderTitle="false" />
<ContainerWidgetPart Container="/alias=page-list" PageSize="5" OrderByProperty="CommonPart.CreatedUtc" OrderByDirection="1" ApplyFilter="false" FilterByProperty="CustomPropertiesPart.CustomOne" FilterByOperator="=" />
</ContainerWidget>
</Data>
然后我将其注入默认配方的副本,并激活相应的模块。
从该配方创建新租户时,
看起来没有添加部分字段,并且未创建窗口小部件。
我做了另一个简单的测试,看起来像个bug?
Repro步骤:
是假设要尊重页面字段和小部件的方法,我做错了什么,或者这是一个错误?
更新
好的,这必须是一个错误。手动添加字段时,即使没有显示字段,我也会收到此消息:“已存在同名字段。”
答案 0 :(得分:1)
您不需要命令,没有它的食谱支持。获取示例的最简单方法是从管理UI添加一个字段,然后导出元数据并检查创建的配方。