创建 Orchard 主题

发布于 2024-12-17 05:44:58 字数 500 浏览 2 评论 0 原文

我正在尝试创建一个 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

向地狱狂奔 2024-12-24 05:44:58

您可能想利用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文