在 Orchard 中制作不同类型的主页
我刚刚开始使用 Orchard CMS,我可以看到我可以创建一个页面并在其上包含不同的小部件,但我需要主页具有不同的布局。
我希望主页有某种不同的 cshtml 文件,但我似乎无法从文档中找出如何做到这一点。我还需要在主页上有四个不在主页上的文本区域。
做过这件事的人能给我指出正确的方向吗?
I've just started with the Orchard CMS and I can see that I can create a page and have different widgets on them, but I need the homepage to have a different layout.
I'd like to have some sort of different cshtml file for the homepage, but I can't seem to work out how to do it from the documentation. I also need to have four text areas on the home page that aren't on the main page.
Can someone who has done this point me in the right direction?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您使用 Orchard 1.1 +,则应该使用设计器工具模块。只需在管理中搜索 Shapes 并安装工具即可。然后,您可以通过在浏览器中查看形状来创建替代品。
在您的情况下,您应该能够创建一个名为:Content-url-homepage.cshtml 的视图
You should use designer tools module if you are using Orchard 1.1 +. Just search for Shapes in the admin and install the tools. Then you can create Alternates by reviewing the shapes in-browser.
In your case you should be able to create a view with the name: Content-url-homepage.cshtml
这可能对您有帮助,这是我发现的关于制作自己的主题的帖子,是一个相当简单的示例,但涵盖了您正在寻找的内容:
http://www.nogginbox.co.uk/blog/theming-orchard
This may help you, it's a post I found about making your own themes and is a fairly simple example but covers what you are looking for:
http://www.nogginbox.co.uk/blog/theming-orchard
您可以尝试以下方法来改变主页布局: http://weblogs.asp.net/bleroy/archive/2010/12/14/switching-the-layout-in-orchard-cms.aspx
Orchard 1.1还会给你一个主页开箱即用。
You can try this to vary the homepage layout: http://weblogs.asp.net/bleroy/archive/2010/12/14/switching-the-layout-in-orchard-cms.aspx
Orchard 1.1 will also give you a homepage alternate out of the box.