Skip Navigation

[Gelöst] Using custom fields in multiple Ppst types?

This support ticket is created vor 3 Jahre, 7 Monate. 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.

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 4 Antworten, has 2 Stimmen.

Last updated by christianN-4 vor 3 Jahre, 7 Monate.

Assisted by: Minesh.

Author
Artikel
#1767697

Hello,
I have a question about using the same data for different custom post types. To explain more in detail. I have a custom post type "projects" with different custom fields. Now I want to use some of the projects as "case studies" therefor I need some additional custom fields and some control to make this visible as "case study". So I thought of adding these cutstom fields to the project post type and just add the missing fields to this. So I thought to of adding some kind of radiobox also like "This is a case study "yes / no". And if it is set to yes the project will also be displayed case study but in a different template.

Is this even possible? Or is my approach correct?

#1768249

Minesh
Supporter

Languages: Englisch (English )

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

Hello. Thank you for contacting the Toolset support.

Yes - this is possible.

To display the field conditionally based on your checkbox "This is a case study "yes / no", You can use the Toolset's "Conditional Backend Display for Custom fields":
=> https://toolset.com/course-lesson/custom-fields-conditional-display/

And as you said, you want to display different template if the checkbox "This is a case study "yes / no" is checked, you can use the Toolset View's filter hook: wpv_filter_force_template
=> https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_force_template

#1771583

Thanks for your reply! Thats good to hear. I just got one Problem. The other post type template was initially created with elementor and not with toolset view. As I need the same page layoit O fear that I must stick with elementor template. I it possible to use the view filter from toolset anyway?

#1771585

Minesh
Supporter

Languages: Englisch (English )

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

To trigger the hook "wpv_filter_force_template" you will require to create content template with Toolset.

You did not mention before that you are using the Elementor template.

As you are using Elementor template, I suggest you should check with Elementor support about how you switch elementor template dynamically based on some condition (I mean as per your requirement).

#1782457

Thanks for your reply. I am thinking of an other approach now. Is it possible to create a new custom post type “case studies” and connect an existing project to this? That way i could just add some additional custom fields and create a template for this post type. I am not sure if elementor can read the values from a connected post?

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.