Skip Navigation

[Resolved] follow up on closed topic

This support ticket is created 4 years, 3 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 -

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

This topic contains 12 replies, has 2 voices.

Last updated by perryv-2 4 years, 3 months ago.

Assisted by: Raja Mohammed.

Author
Posts
#1835901

In the past I got help (a reply) with instructions:

------------------------------------------------

If you'd like to split a single post's data across multiple pages/posts with unique URLs, you can follow these steps:

1. Suppose there are two custom post types on the website:

a). Sources
The actual source post type, which will have all the 15 custom fields.

b). Display Items
The shadow post type, which will be used to show field data from "Sources" posts, using multiple URLs.

2. You'll create a one-to-many relationship between the "Sources" and "Display Items" so that one post in "Sources" can be linked to multiple posts in "Display Items".
( ref: https://toolset.com/course-lesson/how-to-set-up-post-relationships-in-wordpress/ )

This will allow, you to show the data from related "Sources" post into the multiple "Display Items" linked to it.
( ref: https://toolset.com/course-lesson/displaying-related-posts/ )

3. To distinguish between which set of fields should be shown on single "Display Items" post pages (i.e. fields 1-5, 6-10, or 11-15), you can register a custom taxonomy, for example, "Display Item Type" and attach it to the "Display Items" post type.

As a result, while creating any "Display Items" post, you'll be able to specify its type and then show only the relevant set of fields, using the conditional blocks.
( ref: https://toolset.com/course-lesson/using-toolset-conditional-block/ )

------------------------------------------------

I'm stuck at 3. I've created the one to many relationships, but stuck at how to approach the custom taxonomies. I'm also using Elementor to create the template and display the toolset fields.

#1836607

Raja Mohammed
Supporter

Languages: English (English )

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

Hello there,

I have gone through your previous forum ticket, I got some understanding which i think the setup can be handled without post relations

Here is what i understood -> You want a single post type with 15 fields and want to display or hide the fields based on the Page/post that you create inside the post type, Correct me if i am wrong,

Here are some steps that you can consider.

1) You need to Split or create the fields in Separate Field Groups, For example
[x] Field Group 1 (salary group) Should have Fields 1- 5 (Fields related salary),
[x] Field Group 2 (vacature group) Should have Fields 6-10 ( Fields related vacature)

2) In each Field Group Setting You will have the Option to Display the Group on Specific post type refer (Screenshot 1), Select the Appropriate post type

3) Click on the Edit button on the Field Group setting there you will see the Option to display the Field Group By Taxonomy, Templates etc.

4) Since you have mentioned that these pages has specific Templates, Click on the Templates section you can choose the appropriate templates for each field group in which the field group should be display .

and Make sure to Select the option "When All of the conditions are met" in the settings

Once the fields group are set with conditions, Create the page and select the template, Save and refresh to see the associated Custom fields.

Here is a quick video, In case if something is unclear :
hidden link

Alternatively, You can also create a Taxonomy for the post type , And use the Taxonomy condition to display the custom field groups basked on the Terms, For Eg:, You can create a Taxonomy term for each page for eg: Salaries, Vacations etc, and Select them while creating the pages, So Based on the conditions the Appropriate fields group will automatically appear for the page.

Regarding displaying the pages as directory, Based on my understand You can also create directory url as => domain.com/post-type/page-name

Assuming post type as = windmolen-monteur and page as vacature, The url structure can be hidden link

Let me know if you need further assistance.

kind regards
Raja

#1840823
Toolset.jpg

I tink I understand now and need to try this out. I've also enclosed an image of what I'm trying to achieve. Basically, custom fields should be usable on different other custom post types. By the way, 15 custom fields were just an example. In fact I will have probably dozens of fields.

Question:
My thought is to have them all in one "source" custom post type, so we have all the data from a particular job position all in one place. Seems easier to maintain/update. And then to distribute the contents to different other content pages (custom post types). OR would you say it's just as good to keep it separated? But can I still achieve what I'm trying do accomplish?

Thanks so much!

#1841039

By the way: I've recreated everything you said (not the alternative way you mentioned), but I'm stuck at selecting a template. I can select a template created via Toolset, but I can't seem to select my template created in Elementor.

#1841223

Raja Mohammed
Supporter

Languages: English (English )

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

Glad you manged to get the setup as described in your previous ticket. However i am not sure from where you are selecting the templates. If you are choosing the templates using toolset you may not be able to choose a elementor template from toolset ,

However you can choose the toolset view from Elementor using the View widget
https://toolset.com/2018/07/toolset-elementor-integration/

#1841773

Then what I am trying to achieve with your solution is not possible with Elementor.

What about the first solution, your colleague suggested?
To share the custom fields from a "base" custom post type with other custom post types.

#1842029

Raja Mohammed
Supporter

Languages: English (English )

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

I think i overlooked your request, Understanding from the image that you have shared it seems you want different custom post types to share from a single post type, I misunderstood it as there is only two post type and one has source custom fields.

I am checking this with Waqar for more clarity, let me get back to you with more details.
Also may i know what is the use case of having all the custom fields attached to a single post type and sharing them with other Custom post types ?

The simplest solution that i would think of is to Split the Fields in Field group and assign the Field groups to the post types in which they need to be displayed both to the source and the desired CPT. in this way all the Fields groups are assigned to the source post type and only selective field groups are available to specific post type.

#1845843

Question 1:"I am checking this with Waqar for more clarity, let me get back to you with more details.
Also may i know what is the use case of having all the custom fields attached to a single post type and sharing them with other Custom post types ?"

Answer: Because we need different pages (URL's) to display the data. And we want to use the custom fields data on various pages.

#1845859

Raja Mohammed
Supporter

Languages: English (English )

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

If i am not wrong you want the value entered for the custom field (Filed 1) of Post Type A to be displayed in Post type B even the post type doesn't have the custom field (Field 1) did i get you correct?

#1845881

Indeed, just like in the image I uploaded earlier.

#1846065

Raja Mohammed
Supporter

Languages: English (English )

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

Okay in that case this would be quite complex post relation with source post type and other post types. Can you please provide us with some more examples like how you want the fields in the back end and how this needs to be displayed in the front end so that we can have some clear understanding and provide with any feasible solution.

As far as i hear from waqar the suggestion was to deal with two post types since you have more post type to share the fields in common we need a clear picture on how you would to handle it on the whole. If you can share a quick video that would be more helpful as well.

#1846979

Hi Raja,

Well it just seems impossible to re-use or use custom fields from other custom post types, so I'm going to give up on this and stick to my previous route. Cheers!

Perry

#1846981

Thank you!