Tell us what you are trying to do? one to many view matching on specific field in each type
Is there any documentation that you are following? probably but can't adapt it
Is there a similar example that we can see?
What is the link to your site? n/a
Hello,
Please elaborate the questions with more details:
one to many view matching on specific field in each type
How do you setup the post type relationships?
Are we talking about one-to-many relationship?
How do you want to match on specific field in each type?
Here is a document about "How to display related posts with Toolset":
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/
For your reference.
thank you for the quick response. I know I've done this a million times but for some reason I can't get things to work. I have a one to many relationship set up but i haven't specifically connected each record in the many with a record in the 'one'. so i want to match based on the text in the field.
One:
ID Organization
123 My Company
Many:
Name Company
Mary My Company
John My Company
View:
Organization (from the one.)
Name (from the many. matching on the text Organization LIKE Company)
Name (from the many. matching on the text Organization LIKE Company)
Name (from the many. matching on the text Organization LIKE Company)
Thanks for the details, I assume we are talking about this case:
Two post types
- One
- Many
One-to-many relationship between post type "One" and "Many"
In post type "One", there is a custom single line field "Organization"(Created with Types plugin).
In post type "Many", there is a custom single line field "Company"(Created with Types plugin).
You are going to do this:
In a single "One" post, display all "Many" posts which custom field "Company" values are same as field "Organization" of current "One" post.
If it is, it is possible within Views plugin, for example, you can try this:
1) Create a post view:
- Query "Many" posts
- Filter by:
Select items with field:
Company is a string equal to VIEW_PARAM(company)
- Display "Many" post's information
2) In single "One" post, you can get custom field "Organization" field value within Types shortcode:
[types field='organization'][/types]
Use above field value as view's shortcode attribute value, for example:
[wpv-view name="my-view-slug" company="[types field='organization'][/types]"]
More help:
https://toolset.com/documentation/user-guides/passing-arguments-to-views/#controlling-the-filter-with-shortcode-attributes
thanks. i got it up to this point:
2) In single "One" post, you can get custom field "Organization" field value within Types shortcode:
[types field='organization'][/types]
Use above field value as view's shortcode attribute value, for example:
[wpv-view name="my-view-slug" company="[types field='organization'][/types]"]
'my-view-slug' is the slug of the current view?
ok - I did try it but it caused the page to hang. i'll try again.
It works fine in my localhost, if you need more assistance for it, please provide a test site with the same problem, I can setup a demo for you.
not working. can i give you credentials to take a look?
I have enabled the private message box, please provide your website credentials and also point out the problem page URL and view URL, thanks
please delete - doesn't look like it came through private.
I have changed your post to private message:
https://toolset.com/forums/topic/one-to-many-view-matching-on-specific-field-in-each-type/#post-1382991
It seems that you have changed the your website credentials, I get these error when log into your website again:
ERROR: Incorrect username or password.
Please check it, make sure it is valid admin account.
I will check it in tomorrow morning.
i changed just to make sure. new one: @F29PAoaSVqN((2A5Jpk2Wex
if there is any way to take a look, or pass to someone else, it would be appreciated. i have a deadline in a few hours.
As I mentioned above it needs to be display in a single "One" post(Easy Pass Employer or HOA)
I have done below modifications in your website:
1) Edit the post view "Luo 1", in section "Loop item in Luo 1", remove the view's shortcode:
[wpv-view name="luo-1" eph-community="[types field='epe-community-name'][/types]"]
2) Edit one single "Easy Pass Employer or HOA" post, in post content, display above shortcode:
[wpv-view name="luo-1" eph-community="[types field='epe-community-name'][/types]"]
Test it in front-end, I can see it works fine:
hidden link
thank you - something seems to work - i'll try to modify to make it work as needed. please leave ticket open for now. thank you!!