WordPress.org

Ready to get started?Download WordPress

Forums

Custom Content Type Manager
Calendar Integration (28 posts)

  1. Mike
    Member
    Posted 2 years ago #

    Have you (has anybody) tried to integrate a Custom Content Type with a calendar?

    To ask this question another way, my Custom Content Type is an event. Date and time are custom fields within this CCTM event.

    I'm trying to figure out a good way to incorporate the scheduled events into a calendar display that links to the CCTM events.

    Not surprisingly, I haven't found an existing calendar plugin that incorporates CCTM post types (or any post types other than calendar-specific post types).

    Can you think of an approach that might make more sense than trying to shoehorn CCTM into an existing calendar?

    http://wordpress.org/extend/plugins/custom-content-type-manager/

  2. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    That's tough man. I've written several calendar apps/databases and the number of caveats and edge cases starts to boggle the mind, so it's a tall order with or without the CCTM.

    A couple questions:

    1. Do your events all take place in the same timezone?
    2. Do your events repeat (e.g. one per week, every Sunday, etc)
    3. How do you need to search on your events?

  3. Mike
    Member
    Posted 2 years ago #

    No doubt. Fortunately, this is a relatively limited number of events, perhaps 50 per year (it's for a symphony orchestra).

    To answer your questions:

    1) Yes.
    2) Not usually. Each concert is its own event. When they do have a repeating program, it's probably OK if we have to enter the event a couple of times for each instance. That's how we're doing it now.
    3) Search would be nice, but not a deal breaker. It would be nice if we could search for the program details, like composer, or the event name ("Pictures at an Exhibition" for example).

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

  4. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    Mussorgsky is worth it.

    Would you ever need to do a search like: which events are showing from from 1/2/2012 thru 3/4/2012 etc? E.g. "Concerts this week"?

    You can enter the event dates in the CCTM... the searches are where the hangup is... that and the view. If you want to literally see a calendar layout, then that's some coding and formatting, but essentially, that part isn't too bad...

    I'm working on date range filters (e.g. for displaying values that fall between 2 extremes) for Summarize Posts and the built-in GetPostsQuery, but you could come up with a database query that would handle that.

  5. Mike
    Member
    Posted 2 years ago #

    >>Mussorgsky is worth it.

    Agree.

    >>Would you ever need to do a search like: which events are showing from from 1/2/2012 thru 3/4/2012 etc? E.g. "Concerts this week"?

    Yes. I'll need to show the "next 3" or "next 5" events in a widget.

    ---------

    This is a blue-sky, thinking-out-loud idea: What about doing a mash-up between CCTM and an existing calendar application?

    I can do obviously make a simple mashup by creating the event in the calendar plugin, and redirect the calendar's event link(s) to the CCTM event(s). I've tested the concept. It's a little kludgy but functional.

    This has the advantage of using a relatively sophisticated calendar application and still allowing me to use my own custom post type for these events.

    It would be better to have a more integrated solution. For example, I may be able to manually add custom fields to the calendar's custom post type. (I'm talking with the calendar developers and asking about the potential harm of adding custom fields to their post type.)

    But what about using CCTM to extend the calendar's custom post type? CCTM sees the calendar post type, but doesn't permit editing or adding custom fields to the other plugin's post type.

    For example, the custom post type used by The Events Calendar is called tribe_events. CCTM sees the post type, but does not allow me to make changes because it's assigned to another plugin.

    Here's the pie-in-the-sky part: It would be very handy if I could use CCTM to make these modifications. I realize there's a huge potential to make a mess, but with great power comes great responsibility. ;-) I understand this may be too much to ask, but I thought I'd float the idea to hear your thoughts.

  6. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    Interesting ideas... I programmed the CCTM to display the "Foreign post types"... some of those settings can't be tinkered with (at least not easily), but I think it would be possible to standardize the custom fields of other post types. Let the calendar app do its thing and let the CCTM standardize the custom fields. That'd make a good feature request, actually... would take some time to implement, but I think it would be possible.

    As for how tight the other potential integrations would be, that's hard to say without looking at the data models in question.

  7. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

  8. Mike
    Member
    Posted 2 years ago #

    Thanks!

  9. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    I added this feature on the dev branch -- please try it out if you can: http://downloads.wordpress.org/plugin/custom-content-type-manager.zip

    It'll go out with the next version (0.9.5.11).

  10. Mike
    Member
    Posted 2 years ago #

    Sure. Anything special I need to do with that zip file? Can I just extract & save it over top of the existing plugin folder?

  11. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    Any time you manually download a plugin (ie. you download its .zip file), you unzip it and place it into wp-content/plugins -- you can overwrite the other custom-content-type-manager folder there.

    Make sure you download the latest .zip -- I committed some changes to it earlier today.

  12. Mike
    Member
    Posted 2 years ago #

    This is slick.

    I am able to add CCTM Custom Fields to a Foreign Post Type. And I can enter data to simple CCTM Custom Fields from the Foreign Post Type edit screen.

    The one thing that doesn't work is populating CCTM Repeatable Fields from the Foreign Post Type edit screen (that's not surprising, just reporting what I've found).

    I've asked the other developer (it's The Events Calendar at http://www.tri.be) if any hooks are available to easily modify their data entry screen to incorporate calls to CCTM data-entry functions.

    Another possible solution might be to enter the data using Gravity Forms. Integration between Gravity Forms and The Events Calendar has already been implemented.

    Do you know if Gravity Forms can handle CCTM Repeatable Fields? If not, I'll look into it.

    Any other approaches you can think of that I might want to explore?

    Thanks for your help! You're awesome!

  13. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    Hmmmm.... don't know why repeatable fields wouldn't work, unless there are difficulties reading the data out of the database, which gets back to how the data is stored. Hooks between plugins is tricky -- it's one of the weakpoints of WP in my opinion because the hooks can get called when not expected.

    Gravity Forms... I doubt there'd be a good integration point there, but what I'm working on here: http://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=132

    that's essentially the same thing: it would allow you to put the post creation form where you wanted it (even on the front end).

    This brings up a lot of significant architectural considerations, some of them pretty severe... see the discussion here: http://code.google.com/p/wordpress-custom-content-type-manager/wiki/CustomFieldsDataStructure

    Pretty much anything is on the table prior to version 1.0 of the CCTM, and really the only way to see the "correct" path is to bump through the dark a bit here.

  14. Mike
    Member
    Posted 2 years ago #

    >>don't know why repeatable fields wouldn't work

    It's certainly possible I'm misunderstanding how this should work. How are you thinking I would populate repeatable fields in the Foreign Post Type?

    FYI, the Events Calendar edit interface looks like the WordPress Add Custom Fields interface.

    Mike

  15. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    I imagine there are lots of places where this could go wrong... oops, I just realized I tried the wrong calendar plugin...

  16. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    Ok, so I tried the dev version with Modern Tribe's Event Calendar, and I was able to add repeatable custom fields to the Event posts.... the way the CCTM works is it overrides WP's simplistic custom fields meta box and it replaces it with its own. That much appears to be working as expected. I was even able to define a relation field that linked to other events. What exactly are you trying to do here?

  17. Mike
    Member
    Posted 2 years ago #

    The short answer: I'd like a way to populate repeatable fields that's easy enough for a non-programmer (my client) to understand.

    Ultimately, I'd like to turn the site over to the client and have it so they don't have to call me every time they need to add a new event or edit an existing event. It's a non-profit, and they can't afford much.

    So ... if I could create an "event" using either The Event Calendar's built-in tools, or something else, and then have a way to add the repeatable data to the event, that would be great.

    I can handle the templating so the data is displayed as a single event, I just need a way for the client to be able to manage everything as a single event. (Does that make any sense?)

    Mike

  18. Mike
    Member
    Posted 2 years ago #

    One more thing ... There is no requirement that this be based on Modern Tribe's The Events Calendar. It's just one that has most of the functionality we need.

  19. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    When you say "populate", I guess I don't know what you mean. The fields show up when you add or edit an event and the user can manipulate them. Were you hoping for some automation here? E.g. are you pulling in data via scripts or something?

    Being the perpetual Luddite, I can say that by far the cheapest option here is going to be to have the users edit their own data by hand. Automating it will take time, money, and it will undoubtedly require the slaying of many bugs en route. It blows my mind as a developer how much people pay me because they refuse to think... ultimately, there's no code in the world that can substitute for educating your users in operating the tools you give them. I'm harsh that way I guess.

    Re Tribe's The Event Plugin: cool. The other plugins I tried coughed up bloody PHP errors all over the place, but the Tribe was clean, so that's a good sign... seems like it's a good option.

  20. Mike
    Member
    Posted 2 years ago #

    Manual entry is what I had in mind. And I agree re The Tribe's plugin. It seems to work well.

    Let me test some more.

  21. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    Ok. I'm tweaking stuff on the dev branch... various improvements which may affect what you're doing (so you may want to download the latest dev version again). I will test this out a bit more before 0.9.5.11 goes public...

  22. Mike
    Member
    Posted 2 years ago #

    Looks like I skipped a step. I had neglected to "standardize custom fields." When I standardized, the CCTM user interface shows in The Events Calendar edit page.

    So far, so good. This looks VERY nice!

  23. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    Ah, yeah. I updated the labeling there to reflect the behavior: as soon as you standardize the fields, the custom field metabox is controlled by CCTM instead of loosey-goosey. If you think there should be clearer labeling or some notice given somewhere, please feel free to make recommendations. I released 0.9.5.11...

  24. Mike
    Member
    Posted 2 years ago #

    Thanks. I saw the release just now.

    And yes, I think you might want to make it a little clearer what happens when you "standardize." In my case, it's exactly what I want, but I hadn't realized it at the time.

    There is one other thing that seems upside down. On The Events Calendar edit page, the CCTM custom fields show before The Events Calendar native fields. It's a small issue, but if it could be done the other way (without a lot of programming effort on your part), I think that would make more sense.

    Otherwise, it looks like you've nailed this. It is just outstanding work. Thank you so very much!

    Mike

  25. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    What label would be clearer to you? "Standardize Fields" describes to me the behavior that gets implemented. How would you label it?

    And have you looked at the FAQ? http://code.google.com/p/wordpress-custom-content-type-manager/wiki/FAQ -- it's described there.

    I do try to make this stuff as transparent as possible.

    Re the positioning of the metabox, I don't think I have any control over that: the CCTM just intercepts the WP custom fields meta box. Those parameters (e.g. the ordering) should be available in 0.9.7 (see http://code.google.com/p/wordpress-custom-content-type-manager/issues/detail?id=34), but for now, it's just following the 'normal' behavior and it thus subject to getting bumped.

  26. Mike
    Member
    Posted 2 years ago #

    I don't have a problem with the way you labeled it. I had seen the FAQ, but it had been a while, and I had forgotten what it did.

    When I said you might be able to make it clearer, I was thinking of putting a link next to the label showing a popup of the FAQ entry; perhaps you could use an icon of a little circle with a question mark in it. That's an easy solution that would have cleared up my confusion.

    Regarding the positioning, I believe the 'standard' custom fields from The Event Calendar (not the CCTM custom fields) were below the main editing boxes. That's what made me think you had handled it differently somehow. The way it is now is functional, so that's really good enough.

    Thanks again for all you do. This is awesome!

  27. fireproofsocks
    Member
    Plugin Author

    Posted 2 years ago #

    Ok -- the info icon is a good idea. Re the positioning, we'll tackle that in issue 34.

    Glad it's helpful! Donations are always appreciated :)

  28. Mike
    Member
    Posted 2 years ago #

    >>Donations are always appreciated :)

    Coming soon. ;-)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic