表达引擎成员到类别到渠道的关系

发布于 2024-10-19 13:43:00 字数 619 浏览 1 评论 0原文

可能的重复:
一对多成员到文章关系

我们是新的表达引擎,也许可以使用任何使用此 CMS 构建了一些网站的人的帮助。

我们有一个小型仪表板系统,用户可以登录并阅读其他作者提交的文章。我们希望有一个表单,允许会员在登录时选择他希望在主页上显示哪些类别的文章。然后我们想弄清楚如何实际创建该主页,以便只有用户选择的文章类别是可见的。

从数据库的角度来看,这似乎是用户和类别之间的一对多关系,但我们不知道如何在 ee 内部实现此目的,特别是使用成员,因为它不是通道并且似乎不允许创建成员自定义字段中的关系。

我们考虑为每种类别类型创建一个自定义字段,但大约有 95 个类别类型,当我们添加或删除它们时,尝试跟上所有类别类型将非常麻烦。即使我们这样做了,我们仍然不确定如何将 1 个成员连接到多个类别或通过一个类别连接多个条目。

总之,其想法是,使用登录的成员获取已分配给多个类别之一的文章的快速列表,这些类别已被该登录的成员选择为首选项。

Possible Duplicate:
One-To-Many member-to-articles relationship

We are new to expression engine and could maybe use some help from anyone who has built a few sites using this CMS.

We have a small dashboard system where users log in and read articles that are submitted from other authors. We are wanting to have a form which allows a member to chose which categories of articles he would like to be on his home page when he logs in. Then we'd like to figure out how to actually create that home page so that only the categories of articles that the user has chosen are visible.

From a db standpoint this seems to be a one to many relationship between a user and categories, but we have no idea how to accomplish this inside of ee, especially using the members, since it isn't a channel and doesnt seem to allow creating relationships in the member custom fields.

We looked at creating a custom field for every category type, but there are about 95, and as we add or remove them, it would be extremely cumbersome to try keep up with them all. Even if we did we still aren't sure how to connect 1 member to many categories or many entries via a category.

In sum, the idea is to, using the logged in member, get a quick list of articles, which have been assigned to one of multiple categories, which have been selected as preferences by that logged in member.

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

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

发布评论

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

评论(1

陌上青苔 2024-10-26 13:43:00

Create a form that shows all available categories to the logged-in user (use channel:categories) in either multi-select or checkbox format. POST that form to a template that either has PHP-enabled, or contains a plugin tag of a simple custom plugin ... either one should take the posted array of categories, concatenate them into a pipe-delimited list, and either insert that into a simple new database table (with member_id (use the {logged_in_member_id} variable, or in PHP mode, $this->EE->session->userdata['member_id']) and category list as columns), or less-ideally (but more simply) place them in a cookie.

You can then pull that category list out of the database or cookie and use that as the "category" parameter on the channel:entries tag.

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