我正在尝试创建一个 Orchard 主题,但不确定我是否在 Orchard 中“正确”地做了正确的事情。
我已将 Layout.html 设置为我的母版页本身,其中有一个名为 Content 的区域,然后我创建了一个名为 Content-Page.html 的页面,现在在里面,我想要不同顺序的不同形状的数据,例如
<h1>onePart.Name</h1>
<p>Hi this is an example twoPart.Data and onePart.Data </p>
如何做我使用形状来散布它?我是否直接访问该字段,使用包装器?目前我正在做这个。
var onePart= Model.ContentItem.CustomPart;
这使我可以将数据放在需要的地方,我找到了许多文章,但它似乎显示了您的形状是否具有所需的所有数据,我的问题是我真的不希望主题具有对模块的依赖。
I'm trying to create an Orchard theme and not sure if I'm doing the correct thing regarding how to it "correctly" in Orchard.
I have set my Layout.html as my Master Page per se, where I have a zone called Content, then I have create a page called Content-Page.html, now inside there, I want different shape's data in different order e.g.
<h1>onePart.Name</h1>
<p>Hi this is an example twoPart.Data and onePart.Data </p>
How do I intersperse this using Shapes? Do I access the field's directly, use a wrapper? Currently I'm doing this.
var onePart= Model.ContentItem.CustomPart;
This allows me to put the data where it needs to be, I've found may of the articles, but it seems to show if your Shapes has all the data it needs, my issue is I don't really want a theme to have a dependency on a Module.
发布评论
评论(1)
您可能想利用
placement.info
文件来定位您的小部件。要找出您正在查看的形状/小部件以及如何覆盖它,您可以安装 设计器工具模块。我建议您还可以下载主题库 并检查这些。我自己从这些中学到了很多东西。
Likely you want to make use of the
placement.info
file to position your widgets. For finding out which shape/widget you're looking at and how to override it you can install the Designer tools module.I suggest you also take a look, by downloading, some of the templates from the theme gallery and inspect these. I learned quite a lot from these myself.