如何在 Zotonic 中设置页面以使用不同的模板?

发布于 2024-09-25 05:38:07 字数 62 浏览 0 评论 0原文

我希望为我的网站的每个部分提供替代模板。

如何在 Zotonic 中设置页面以使用不同的模板?

I would like to have alternative templates for each section of my website.

How do you set up a page to use a different template in Zotonic?

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

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

发布评论

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

评论(2

淡墨 2024-10-02 05:38:07

以下是使用自定义模板呈现 about 页面的方法:

{about,      ["about"], resource_page, [ {template, "about.tpl"}, {id, page_about}]}

如果将上述调度规则添加到站点的调度规则(位于 yoursite/dispatch/dispatch)中,它将使用 about.tpl 呈现具有唯一名称 page_about 的页面。

您可以在 zotonic 管理页面的高级选项卡中设置页面的唯一名称。

Here is how you could render the about page with a custom template:

{about,      ["about"], resource_page, [ {template, "about.tpl"}, {id, page_about}]}

If you add the above dispatch rule to your site's dispatch rules (found at yoursite/dispatch/dispatch) it will render a page with the unique name of page_about using about.tpl.

You can set the unique name for a page in the advanced tab of the page in the zotonic admin.

羁绊已千年 2024-10-02 05:38:07

好的做法是将 page_path 属性设置为您在调度规则中定义的 url。这样(在示例中)page_about 的 page_url 也是“/about”。

Good practice is to set the page_path property to the url you define in the dispatch rule. So that the page_url of the (in the example) page_about is also "/about".

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