表达式引擎:如何将一个通道包含在另一个通道中?

发布于 2024-12-01 00:51:28 字数 147 浏览 1 评论 0原文

如何将一个频道的内容纳入另一频道? 例如,如果我有一个项目频道。然后我想在该项目中添加项目。

Project
- Item 
   - url
   - caption
- Item 
   - url
   - caption

How would I include contents from one channel into another channel?
For instance, If I have a channel of projects. And then I'd like to add items within that project.

Project
- Item 
   - url
   - caption
- Item 
   - url
   - caption

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

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

发布评论

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

评论(3

尐籹人 2024-12-08 00:51:28

Matrix 有一个新的免费替代品:Grid Lite

Matrix 可能是最好的选择满足您的需求,即使它是我最喜欢的 EE 插件之一。

There is an new free alternative to Matrix: Grid Lite

Matrix is maybe over the top for your needs, even if it is one of my favorite EE addon.

倦话 2024-12-08 00:51:28

我在这里可以想到三种方法:

  1. 在项目频道中使用 Matrix 字段来添加多个每个项目的项目。
  2. 创建一个“项目项目”频道,并在该频道中添加一个关系字段(或 Playa字段)指向您的项目频道。这会将每个项目与其父项目链接起来。在前端显示您的项目时,您可以使用反向相关条目 显示该项目的项目。
  3. 将每个项目设为一个类别,然后将项目项频道中的每个条目分配给正确的项目类别。 (这里的缺点是类别只能有非常有限的与之相关的数据 - 名称、描述和图像。)在前端,您可以使用 频道类别标签来显示您的项目(类别),然后使用频道条目标签和类别 参数。

这些方法中的每一种都有效!

I can think of three approaches here:

  1. Use a Matrix field within your Project channel to add multiple items to each project.
  2. Make a "Project Items" channel, and in that channel add a relationship field (or Playa field) that points to your Projects channel. This would link each item with its parent Project. When displaying your Project on the front-end, you'd use reverse-related entries to display that Project's items.
  3. Make each Project a category, and then assign each entry in your Project Items channel to the proper Project category. (The downside here is that categories can only have very limited data associated with them - name, description, and image.) On the front-end you'd use the Channel Categories tag to display your Projects (categories), then then list that Projects items below using the Channel Entries tag and the category parameter.

Each of these approaches would work!

拿命拼未来 2024-12-08 00:51:28

听起来您已经设置了这两个通道,因此 Matrix 或 Grid Lite 虽然是很好的解决方案,但需要您进行大量的迁移工作。

您现在有关联两个渠道的自定义字段吗?即在“项目”频道中,是否有一个自定义字段允许您选择(或写入)该项目属于哪个项目?如果是这样的话,我可以从那里寻求解决方案。

It sounds like you already have these two channels set up, so Matrix or Grid Lite, while great solutions, would require a lot of migrating work on your part.

Do you have a custom field that relates the two channels right now? i.e. in the Items channel, is there a custom field that allows you to choose (or write) which project the item belongs to? If that's the case, I can work toward a solution from there.

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