在ExpressionEngine 2中,是否可以使用相同的“页面”?多页模板?
让我澄清一下:我正在构建一个相对简单的小册子网站,其中有多个部分,我想使用相同的“模板”。例如: http://example.com/section1 & http://example.com/section2。我还希望这两个部分对其各自的条目页面使用相同的“视图”模板,例如在 http:// /example.com/section1/item1 或 http://example.com/section2/item2/< /a>.
这可能吗?我对 EE 和 EE 很陌生。已经阅读了很多更改 url 结构等的方法,但没有什么像我所要求的那样。我还知道我的解决方案可以通过创建两个具有相同索引模板的模板组来实现,但这似乎相当愚蠢。
PS 我知道我的频道设置可能相关,所以请让我知道它们应该是什么才能回答这个问题。
非常感谢
桑德尔
Let me clarify: I am building a relatively simple brochure site that has multiple sections that I would like to use the same 'template'. For example: http://example.com/section1 & http://example.com/section2. I would also like these two sections to use the same 'view' template for their individual entry pages, for example on http://example.com/section1/item1 or http://example.com/section2/item2/.
Is this possible? I am very new to EE & have been reading about lots of ways to change url structure etc but nothing quite like what I'm asking. I am also aware that my solution could be achieved by creating two template groups with identical index templates with them but that seems rather silly.
P.S. I know my channel settings might be relevant so please let me know what they should be in order to answer this.
Many thanks
Zander
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,这是可能的,并且您有几个选择。
第一种是使用 Structure。结构允许您在多个页面上使用相同的页面模板(即 http://example.com/section1 和 < a href="http://example.com/section2" rel="nofollow">http://example.com/section2)。这可能是您最好的选择。
第二种选择是使用 ExpressionEngine 附带的 Pages 模块。
第三个选项是使您的索引模板成为一个简单的“路由器”。它会是这样的:
这将查看 URL 段,然后为每个段嵌入相同的模板,并向其传递可在
{exp:channel:entries}
标记中使用的条目 ID显示相应条目的内容。Yes, this is possible, and you've got a few options.
The first is to use Structure. Structure allows you to use the same page templates across multiple pages (ie http://example.com/section1 and http://example.com/section2). This is probably your best bet.
The second option is to use the Pages Module that comes with ExpressionEngine.
The third option is to make your index template a simple 'router'. It would go something like this:
This will look at the URL segments and then embed the same template for each, and pass it the entry ID which you can use in your
{exp:channel:entries}
tag to display the content from the appropriate entry.是的,这是可能的。检查页面模块。
页面模块将允许您选择 URL 和模板。安装后,页面模块将在编辑屏幕上添加一个新的“页面”选项卡。确保您没有在 {exp:channel:entries} 标记对中将动态参数设置为“no”。
这个问题还有其他解决方案,但这是最直接的。
Yes, this is possible. Checkout the Pages module.
The Pages module will allow you select the URL as well as the template. When installed the Pages module will add a new 'pages' tab to the edit screen. Make sure you are not setting the dynamic parameter to 'no' in your {exp:channel:entries} tag pair.
There are other solutions to this problem, but this is the most straight forward.