Skip Navigation

[Resolved] Show custom fields between related posts

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Last updated by hispavista-s.l.E 1 year, 7 months ago.

Assisted by: Minesh.

Author
Posts
#2597733

Hello,

I have Toolset and Elementor Pro installed. I need to show through a shortcode (without generating a view) the custom fields related between the blog post and the pages.

I have already generated the relationship between both but it doesn't show it.

How can I do it? I have not found it in the documentation.

Best regards and thanks

#2597775

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

I would like to know first what post relationship you have created, Can you please share screenshot of that and on what place you want to display what fields belongs to what post type.

*** 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.

#2598531

Minesh
Supporter

Languages: English (English )

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

Ok I can see that you have created one-to-many post relationship using Toolset between the post type "page" (parent) and "selected projects" (child).

To display the related post fields you will require view plugin and I've activated it.

As I understand you want to display the parent page custom fields on single child post (selected projects). You can add "Text" module to your elementor tempate and add the following shortcode:

[types field='status' item='@pagina-selected-project.parent'][/types]
[types field='start-date' style='text' format='d/m/Y' item='@pagina-selected-project.parent'][/types]

You can add as many fields as you want with the above shortcode where as you can see we are referencing the parent using the "item" attribute.

#2598537
Captura de pantalla 2023-04-24 a las 12.05.17.png

Thanks manish, it works but the fields I can't display are the link type. How can I display it? I
am trying this way but it is not the correct one:
[types field='call-research-projects-pdf'' style='slug' item='@pagina-selected-project.parent'][/types]

#2598549

Minesh
Supporter

Languages: English (English )

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

Do you want to display link or you want to link to some text or image?

The following shortcode will display the link:

[types field='call-research-projects-pdf' item='@pagina-selected-project.parent'][/types]

And the following shortcode will wrap it:

<a href="[types field='call-research-projects-pdf' output='raw' item='@pagina-selected-project.parent'][/types]"> Click here for PDF </a>
#2598563
Captura de pantalla 2023-04-24 a las 12.43.06.png

I want to insert the URL of the field via a shortcode in a section of an Elementor Pro widget, so that element has a link.
The way you told me it doesn't work. Attached is a screenshot.

#2598573

Minesh
Supporter

Languages: English (English )

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

It seems you forget to add the attribute: output='raw'.

I've added the shortcode as given under:

[types field='call-research-projects-pdf' item='@pagina-selected-project.parent' output='raw'][/types]

I can see the link of the PDF.

#2598577

I can't download the PDF and it won't open in a new tab. Why can this happen? It is very strange that I don't see it and you do. I have tried browsing with the cache disabled.

#2598579

My issue is resolved now. Thank you!