Skip Navigation

[Resolved] Linkining custom fields and post types created with 3rd party plugin

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to link any CPT to an Events content type so that - I can have a Course (CPT) or Task / Project CPT with dates fields created with Types to link to Events CPT created by another plugin which would make it appear in their calendar.

Solution:
You can create relationship between Events CPT and any other Types CPT. There is a way to control existing post types with Toolset Types, please follow this doc:
https://toolset.com/faq/how-do-i-convert-existing-custom-types-and-fields-to-types-control/

Basically you need to:
- Enable 3rd party custom post type first (enable plugin) so that it can be managed by Types.
- Then please deactivate your theme or plugin that generated that CPT.
- Create a new CPT in Types with same slug as your original post type has (e.g. events or event) -- this is important.
- And then reactivate your theme or plugin (after CPT has been created in Types).

Now you will be able to see CPT of that 3rd party theme or plugin into Types and it will be editable. And all your posts or data will still be there. You can then also create relationship between Events and Course CPT.

Same way you can also control existing Custom Fields with Types (explained in same above doc).

Documentation:
https://toolset.com/faq/how-do-i-convert-existing-custom-types-and-fields-to-types-control/

This support ticket is created 7 years, 1 month 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
- 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 12:00 – 17:00 -
- 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 18:00 – 21:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by robertM-17 7 years, 1 month ago.

Assisted by: Noman.

Author
Posts
#576452

hi
Sorry to bother you.
Tell us what you are trying to do?
I would like to link any CPT to an Events content type so that - I can have a Course (CPT) or Task / Project CPT with dates fields created with Types to link to Events CPT created by another plugin which would make it appear in their calendar.

How it would work:

1)Edit Project/Task/Course CPT with custom date fields created with Types
2) Add a tick or something to say this is an Event, which has start and end dates and times and other Event info like Venue-
3) Automatically populate an Event CPT with the dates and time information, and ideally that other event information like Venue. All this info would then create / edit an Event so it can appear on the calendar, via the 3rd party calendar/events plugin.

BACK-END
I would really like the Event information to be editable in the back end.

FRONT-END
I think I can work out (conceptually) how it might be done in the front end - I guess it can be done by linking forms in CRED, something like...

EDIT Project or whatever -> Tick to define as event -> if tick bring up Event editing form in CRED -> use [wpv-post-title] as event title -> add event details.
But I don't know if/how Editing the project or other CPT data later on would keep it tied to the same event entry - rather than create a new one.

Is there any documentation that you are following?
I have tried searching forum but not sure what I am asking. Also I would like to do it with none or minimum code/php
I've also been looking at relationship info but not sure if that will quite do it. (by the way I presume there is no relationship wizard anymore as I can't see it where it appears as in your help videos, seems relationship info only in the CPT metaboxes while setup/editing.

The idea of intermediary post type might work for .... 'Course' or 'Lesson' , with an intermediary of "Session" to link it to the calendar 'Event' but then I would want the Session date, location etc. info to pass directly to Event and still not sure about how that would work that. I guess it's the same principle about how to pass values automatically between CPTs

The intermediary concept however, does not seem as logical or simple when considering Project or Task. I guess Task could be an intermediary between Project and Event but I would also want to pass the Project Date info directly to the Event calendar. In fact that would define the Calendar (with the calendar being named after the project). I would also want the Task information also to appear on the same project calendar - so not sure of what would be the intermediary there.

Is there a similar example that we can see?
I've been trying to work with this
hidden link
but it's sooooo slooow. So I am looking to see if I can do it with Toolset, which I am getting more appreciative of by the day as I learn its ways 🙂

Calendarize it! does it with metaboxes and taxonomies - for each Calendar-enabled CPT. - Calendar/Venue/Organiser etc are taxonomies, which can be ticked and the CPT title becomes the Event title. The Event editing details appear in metaboxes on the back-end edit screen of the relevant CPT and the Event goes directly into the calendar. I could not find a way to make Event a Child of Project using Toolset (and am not sure if this is the right thing here as I don't know what limits that puts on Events in other places through the site. ) Calendarize it! is a good solution in principle but really slow, especially in the back end. If I can get this working in Toolset, it will give me more freedom of choice for events Calendar. I think another plugin, Events Manager with WP Full Calendar also do it to some extent but not sure you can choose start/end dates in that plugin, that just links the event to publish date of the CPT.

Thank you very much in advance
Rob

#576458

p.s. If it did require any php snippets etc. I would need to know exactly where to put it.

I have not got into child themes yet but accept the principle and might be prepared to 'pop my cherry' there since I would like to use this functionality in a few different contexts on the site.

Thanks again

#576794

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi Robert,

Thank you for contacting Toolset support. It sounds like you are using Events Calendar plugin if I am not mistaken. You can create relationship between Events CPT and any other Types CPT. There is a way to control existing post types with Toolset Types, please follow this doc:
https://toolset.com/faq/how-do-i-convert-existing-custom-types-and-fields-to-types-control/

Basically you need to:
- Enable 3rd party custom post type first (enable plugin) so that it can be managed by Types.
- Then please deactivate your theme or plugin that generated that CPT.
- Create a new CPT in Types with same slug as your original post type has (e.g. events or event) -- this is important.
- And then reactivate your theme or plugin (after CPT has been created in Types).

Now you will be able to see CPT of that 3rd party theme or plugin into Types and it will be editable. And all your posts or data will still be there. You can then also create relationship between Events and Course CPT.

Same way you can also control existing Custom Fields with Types (explained in same above doc).

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

For adding Start and End date fields, you can add them with Types to either Events or Course CPT. Use them in a View etc… but those fields can’t be inserted into the Events Calendar. The calendar page has its own very special php template that handles all the functionality and we can’t modify that easily with Toolset. Some of the details on this topic are explained at the links below that why we don’t have any integration yet with Calendar plugins and such:
- https://toolset.com/forums/topic/toolset-layouts-and-modern-tribe-the-events-calendar-integration/#post-571279

- https://toolset.com/forums/topic/toolset-calendar/#post-517250

Thank you

#579658

Hi Norman,
Thanks for your reply. Sorry about my delay, I've been battling with other parts of this project.

I've followed this and it seems I'm in. Thanks. Well I can at least add relationships to the events post. Whether it's the right method remains to be seen.

Thanks for your further guidance on how to display and manage. I will have a play and see what emerges.

Thank you (I'll consider my resolved - *for now* 🙂