Skip Navigation

[Resolved] How to use Relationship fields

This support ticket is created 5 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 11 replies, has 2 voices.

Last updated by Minesh 5 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#1195193

I have some post relationship with additional relationship fields. I have a few issues with this feature:

1. How could I use these relationship fields in conditional output?
2. How could I edit these relationship fields value for exact relationship?

#1195239

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

1. How could I use these relationship fields in conditional output?
- Well - can you tell me what field you want to check and exactly where? (parent or child post)?

2. How could I edit these relationship fields value for exact relationship?
Well - as I understand you have many to many relationship, if yes, you must have intermediary post type created you should see that intetmediary post type at Toolset => Post types section and you should set this post type to "Published" within the "Save" section on top right side of the page.

#1195302

Hi!

1. Not parent or child, but relationship itself field.

Child-to-parent relationship has field Field1. I want to check it state in conditional output.

2. Yes, it is Published, but it is not shown anywhere in the dashboard to access to it's entries (posts)

#1195304

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

1. Not parent or child, but relationship itself field.
Child-to-parent relationship has field Field1. I want to check it state in conditional output.
==> Do you have many to many relationship - correct?

2. Yes, it is Published, but it is not shown anywhere in the dashboard to access to it's entries (posts)
=> That is strange - can I check on your install?

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I would additionally need your permission to de- and re-activate Plugins and the Theme, and to change configurations on the site. This is also a reason the backup is really important. If you agree to this, please use the form fields I have enabled below to provide temporary access details (wp-admin and FTP).

I have set the next reply to private which means only you and I have access to it.

#1195346

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

I see you have number of post relationship created before which are migrated to new relationship now. Can you tell me which many to many post relationship you want to display in admin?

#1195390

HSSK Intermediary Posts, slug highschool_studienko

#1195398

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - I see the 'HSSK Intermediary Post" is available in admin. Please check the following link:
=> hidden link

Now, I wanted to know which field you want to display conditionally, exactly where, can you share problem URL where you want to display the field conditionally.

#1195401

Hm... now I see it in admin too... strange.

Regarding conditional output. This is not like an error. I just don't find the way to address relationship post.

Lts say, I have a view, wich is filtered by parent ID. And I want to show some code, based on relationship field (e.g. "SKHS Application Start Summer") value. And there is no relationship fields options in conditional output shortcode wizard.
So, I just need an information how to address many-to-many relationship fields from child post, both with parent and without parent id.

#1195406

And regarding "HSSK Intermediary Post" - have you fix anything with it or it just become visible for you? If you done anywthing to fix it, please let me know how you fixed it.

#1195408

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - you can use the "Fields and Views" button available with Loop Editor and try to search for your field click on it and it will give you another popup from where you should chose the option "Запись, связанная с текущей записью, заданной отношением Types" from which relationship you want to display the field and it will give you shortcode.

For example - if you want to display field from intermediary post type:

[types field='skhs-application-start-summer' item='@highschool-post.intermediary'][/types]

Later, use this shortcode with conditional statement - for example:

[wpv-conditional if="( '[types field='skhs-application-start-summer' item='@highschool-post.intermediary'][/types]' eq '' )"]
this Field  "skhs-application-start-summer" value is empty
'[/wpv-conditional]

More info:
=> https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-one-related-item-parent
=> https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-related-child-posts/

#1195415

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

And regarding "HSSK Intermediary Post" - have you fix anything with it or it just become visible for you? If you done anywthing to fix it, please let me know how you fixed it.
=> No, I did not fix anything - it was there.

#1195875

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

It looks like all your issues resolved here. Please open a new ticket with your every new question you may have.

Please feel free to close this ticket 🙂