Advanced relationships: Field relationship one to many post types
-
Hello and thanks for Pods, it is really very potent, but complicated to me to learn it ??
I am learning Advanced Relationships and it took to me a morning to learn it, so I explain here, just in case someone needs it and searches.
I am building a courses site with custom post types courses and resources. When you see a course or a resource, I have to list related courses or resources in a single field. So, I need to build a field relationship one to many. I have searched a lot and my English is not that good. I found this issue asking for it and your solution here where you explain to Link Tables for multi-field relationships, but it is not my use case.
Then in Components I found Advanced Relationships and enabled it, but I don’t find any step by step documentation explaining it. You have this:
When you enable Advanced Relationships, a table is created in your database: yourprefix_podsrel that will keep the relations.
Then in your pod you add a field Relationship with this parameters:
- Tab Field Details:
- Related Type: Database Tables
- Related table: yourprefix_posts.
- Tab Relationship Options:
- Table ID Column: ID
- Table Index Column: post_title
- Display Field in Selection List: (this didn’t work to me)
- Customized WHERE: t.post_type=’product’ OR t.post_type=’recurs’
- Customized ORDER BY: t.post_date ASC
Thanks a lot for Pods and I hope this helps someone and don’t ask to you.
I leave the issue open, just in case you want to add something.
- Tab Field Details:
- You must be logged in to reply to this topic.