Orchard CMS - 主题

发布于 2024-10-28 18:44:51 字数 715 浏览 5 评论 0原文

我对 Orchard CMS 主题有一些疑问。那么,让我们开始...我有一个网站,有 5 个页面,其中一些页面有不同的布局。

其中的页面和区域:

主页 - 内容、TripelFirst、TripelSecond、TripelThird
概念租赁页面 - 内容、AsideFirst、AsideSecond
新闻服务部门页面 - 内容、AsideFirst、AsideSecond(布局与前两页不同)

注意:尽管所有页面都有内容区域,除了主页之外,没有任何页面使用它。其他页面只有位于其中一个区域的 HTML 小部件。

1) 我读到可以为特定 ID 创建布局,问题是我找不到该 ID 来为特定 ID 创建布局。

2)如您所见,几个页面具有相同的布局,如何将它们分配给特定的布局?例如,如果我为概念租赁页面创建布局,如何为它们分配特定布局以及如何将布局分配给新闻< /strong> 和服务部门 页面?

3)如何将class标签添加到body中?问题是 Orchard CMS 在其他所有内容之前创建正文,因此它不包含在布局 cshtml 文件中。

先感谢您!

I have some questions regarding theming Orchard CMS. So, let's begin... I have a website that will have 5 pages and some of them have different layouts.

Pages and zones within it:

Homepage - Content, TripelFirst, TripelSecond, TripelThird

Concept and Rentals page - Content, AsideFirst, AsideSecond

Press and Service Department page - Content, AsideFirst, AsideSecond (different layout then the previous two pages)

Note: Even though all of the pages have the Content zone, except Homepage none of the pages uses it. Other pages only have HTML widgets located in one of the zones.

1) I've read that it is possible to create the layout for the specific ID, the problem is I can't find that ID to create the layout for specific ID.

2) As you can see, couple of pages have the same layout, how to assign them to the specific layout? For example, if I create the layout for Concept and Rentals page how can I assign the specific layout to them and also how can I assign the layout to Press and Service Department pages?

3) How to add the class tag to the body? The problem is that Orchard CMS creates the body before everything else so it isn't contained in the layout cshtml files.

Thank you in advance!

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

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

发布评论

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

评论(3

め七分饶幸 2024-11-04 18:44:51
  1. 当您在管理员中编辑页面时,网址将类似于 http://localhost:30320/OrchardLocal/Admin/Contents/Edit/16

    16 是这里的 id。

  2. 您可以做几件事。最简单的是使用此模块: http://orchardproject.net/gallery/List/Modules /Orchard.Module.Downplay.Orchard.LayoutSelector

    或者,您可以根据任意条件以编程方式创建替代项:http://weblogs.asp.net/bleroy/ archive/2010/12/14/switching-the-layout-in-orchard-cms.aspx

    最后,您通常可以通过使用图层改变小部件的位置来避免创建实际的单独布局。

  3. body 标记位于 document.cshtml 中,您可以在自己的主题中覆盖该标记。

  1. when you edit the page in the admin, the url will look something like http://localhost:30320/OrchardLocal/Admin/Contents/Edit/16

    16 is the id here.

  2. Several things you can do. Easiest is to use this module: http://orchardproject.net/gallery/List/Modules/Orchard.Module.Downplay.Orchard.LayoutSelector

    Alternatively, you could programmatically create alternates based on arbitrary criteria: http://weblogs.asp.net/bleroy/archive/2010/12/14/switching-the-layout-in-orchard-cms.aspx

    Finally, you can often avoid to have to create an actual separate layout by just varying what widgets go where, using layers.

  3. The body tag is in document.cshtml, which you can override in your own theme.

心意如水 2024-11-04 18:44:51

1. 不确定 ID 是什么意思?如果您单击仪表板上的Widgets,那里就会有图层。图层是针对特定事物激活的小部件的集合,就像经过身份验证的图层将在用户通过身份验证时显示您定义的那些小部件。

扩展 (1) 和 (2),您将能够通过向图层添加小部件来创建新布局。

查看:
标记层规则 - 允许您添加基于一个标签。现在,您可以添加概念租赁页面,然后为这些标签指定一个层,在该层中,您可以添加您喜欢的任何小部件。这些仅在遇到该标签时才会出现。

另请查看:
内容类型层规则 - 还没有尝试过这个,但它属于同一行。

3. 要自定义外观,可以使用“形状”。我认为的每个区域都有相应的cshtml 文件。您甚至可以使用 ShaperBuilder 在代码中渲染 html,同样,对此不太了解,但我可以告诉您,您需要查看这些文章。

HTH,我会尝试联系一些果园里的人。

1. Not sure what you mean by ID? If you click Widgets on the DashBoard, there are Layers there. A layer is a collection of widgets that will activate for a specific thing, Like the authenticated Layer will display those widgets you define when a user is authenticated.

Expanding on (1) and for (2), you will be able to create a new layout by adding widgets to a layer.

Check out:
Tagged Layer Rule - Allows you to add widgets based on a tag. Now, you can add pages for concepts and rentals and then specify a layer for these tags, within that layer, you can add any widgets you like. These will only appear when that tag is encountered.

Also check out:
Content Type Layer Rule - Haven't tried this, but it falls on the same lines.

3. To customize the look there is something called Shapes. Each Zone I think has a corresponding cshtml files. You can even use the ShaperBuilder to even render html in code, again, don't know too much about this but I can tell you, you need to look into these articles.

HTH, I'll try and contact some orchard folk that are on SO.

黎夕旧梦 2024-11-04 18:44:51

因此,为了帮助您,

  1. 对于全新安装,主页的 ID 始终为 11,但我想您可以删除主页并创建一个新页面并为其提供另一个 ID。要查找其他页面的 ID,请打开数据库并查看内容项。

  2. 我知道除了通过 ID 之外没有其他方法可以应用布局,因此只需复制布局页面,因为页面太少了。

  3. 我只使用一个小的 jQuery 脚本

    $(文档).ready(函数{
    $('body').addClass('SomeClass');
    });

So to help you out here

  1. The ID of the Home Page is always 11 for a fresh install though I imagine that you can delete the home page and create a new one and give it another ID. To find the ID of the other pages open up the DB and look at the Content Items.

  2. I know of no way to apply Layouts other than by ID so just duplicate the layout pages as you have so few pages.

  3. I would just use a small jQuery script

    $(document).ready(function{
    $('body').addClass('SomeClass');
    });

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