2

I am beginner to Orchard. My purpose of starting this discussion is, to make beginners aware about Orchard Fundamentals.

I am currently Developing on web site using Orchard. But most of the times I am facing difficulty in rendering contents and how to place content on front end. As well, use of content items, content types and modules. Usually, I get confuse in using all these things. For example : I have created new content type for displaying latest post on my site, with date and user's profile picture. So for that my question is, "Is it right that I have created content type for it? or should I have to make module? and if yes than can I use my content type as a widget on my homepage? "

FYI: I went through the documentation and plural sight's video. But I was not able to clear above fundamentals.

Sorry for any inconvenience or any stupid questions, but at this time it seems bit complex for me. Can anybody please help me to clear my fundamentals of orchard?

Thank you, Sohil Shah

4

1 回答 1

0

我目前正在使用 Orchard 在网站上进行开发。但大多数时候,我在渲染内容以及如何在前端放置内容时遇到困难。同样,使用内容项、内容类型和模块。通常,我对使用所有这些东西感到困惑。例如:我创建了新的内容类型,用于在我的网站上显示最新帖子,包括日期和用户的个人资料图片。所以我的问题是,“我为它创建内容类型对吗?还是我必须制作模块?如果是,我可以将我的内容类型用作主页上的小部件吗?”

我为它创建了内容类型对吗?还是我必须制作模块?

当然,ContentType这意味着您可以通过 CMS 创建该特定类型的实例

还是我必须制作模块?

您想在不同的项目中重复使用您的内容类型吗?如果是这样,那么您应该创建为您创建内容类型的代码(在迁移脚本中)并将其放入模块中。

我可以将我的内容类型用作主页上的小部件吗?

是的,您需要使您的内容类型成为一个小部件。您也可以使用像这样的迁移脚本来执行此操作(添加WidgetPart和设置Widget原型:

ContentDefinitionManager.AlterTypeDefinition(
    "MyWidget", 
     x => x.WithPart("WidgetPart")
           .WithSetting("Stereotype", "Widget")
);
于 2014-05-18T10:43:36.773 回答