Skip Navigation

[Resolved] DB field of relationship field

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 7 replies, has 2 voices.

Last updated by Minesh 11 months, 1 week ago.

Assisted by: Minesh.

Author
Posts
#2678061

Hello Toolset support team,

I have two CPT (Activities and ratings) and they are connected with a 1 : n relationship, means 1 activity can have many ratings. I want now to know the data base field of the activity title in the rating post. The background is that I am using a code to copy certain data of the rating post to a standard WordPress post. And now I also want to copy the activity title from the rating post but I do not know its field name.

Thank you in advance and best wishes
Andreas

#2678072

As an alternative the following should also work: Copy the URL of the parent post detail page/template page (URL to the activity) into the title of the child post (rating). So when I read the rating I can click on the title of the rating and this routes me to the activity

#2678107

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

As I understand - on a single post of post type rating, you want to display the parent (activity) post type link?

#2678113

Hi Minesh,

yes exactly. The use case is the following: User reads on a page (not the activity page itself) the rating to the activity XY. Then the user should be able to click somewhere on this rating post to get forwarded to the activity XY.

Kind regards
Andreas

#2678122

Minesh
Supporter

Languages: English (English )

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

If can tell me on what page you want to display what then I will be able to guide you in the right direction.

Can you please tell me that and share admin access details.

*** 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 have set the next reply to private which means only you and I have access to it.

#2678422

Minesh
Supporter

Languages: English (English )

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

I've edit the content template where you added the view and added the single field block and set this single field block to display the parent post type "activity" post title with link:

As you can see with the following screenshot: hidden link

Can you please confirm it works as expected now:
- hidden link

#2678537
Screenshot of copied posts.JPG

Hi Minesh,

thanks for checking my issue and half is now solved. To solve it finally, can you please check how the link to the parent post (i.e. to the activity) can be copied from the post-type “bewertung” to the automatically created post-type “post”. In my screenshot you see on the left side the screen of the post-type “bewertung” and on the right side you see the post-types “post” which are the standard WP posts. You also can see that the posts from post-type “bewertung” are copied to post-type “post” when a new “bewertung” is created. This copy happens thanks to the php.codehanks to the first PHP code in my function.php. So to summarize: I also need to have the link to the activity in the wordpress standard posts. This standard posts you find when clicking on the menu item “WordPress Posts”

Best wishes
Andreas

#2678650

Minesh
Supporter

Languages: English (English )

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

As per our support policy, we entertain only one question per ticket. This will help other users searching on the forum as well as help us to write correct problem resolution summery for the original issue reported with this ticket.

May I ask you to open a new ticket with every new question you may have and you can also link the old ticket link with new ticket if its dependent issue when required.