Data of One Master "Events/Course" Calendar shared on Multiple Sites

Hi all

We had yesterday a live chat about a way to share data of one "Events/Course" Calendar on multiple subsites. Unfortunately it seems that Events + is not capable in doing that (please support the feature request written already) Nor does Course-press support such a setting.
https://premium.wpmudev.org/project/events-plus/

Unfortunately with Course Press it is not even possible to create an eventbrite course network where different institutions could setup, manage and market their courses and display their courses on their own site, while all courses all together from all subsites would get displayed also in a global course directory which again than could get displayed in a similar way my calendar is doing it by inserting a shortcode with the site/blogID on subsites and owners of the subsites could perhaps even filter out courses "categories" i.e. their own ones - which they don't want to get displayed by similar offers from their competitors, but all other courses (non competiting) could help those course providers to earn not only an additional revenue % but also to promote their own courses much better by attracting more people.
https://premium.wpmudev.org/project/coursepress-pro/

Possible seems to be to create a global calendar with data from many subsites - like it is done in https://www.eventbrite.com

One Wordpress plugin we tested already says it can do it but here it isn't actually possible to create that global calendar with entries from all other sub calendars ;-(
https://wordpress.org/plugins/my-calendar/

Fetch events from a remote database. (Sharing events in a network of sites.)

it says but actually in a Network of Multisites you would not need a remote database as all data would already be available in the same database but it would be assigned to another site/blogID.

The option to get data from a remote database allows you to share data between multiple sites if they all need matching calendars. It requires you to enable remote database access on the source site (this is a hosting configuration; you can usually find it in your hosting control panel or talk to your host!) Once you enable the option, you'll have to add code to your theme's functions.php file in order to make the remote connection:

from the My Calendar PDF Page

https://www.joedolson.com/pdf/My-Calendar-v2.3-sample.pdf

The solution they promote here at myCalendar is to have a shortcode available in which you could define the site/blogID with the calendar you want to show on another site/blog with another ID.

https://wordpress.org/support/topic/multisite-show-events-from-other-site-calendars/

Like you can see here on that thread there is actually the need for something events+ can already do, but as said it is still missing the other part which is already possible with My Calendar, like it is described here.

My Calendar has an option in multisite so that all calendars save data into the database for the primary site. You can then display the calendar from the primary site on any other site by passing the Site ID into the shortcode, e.g.

[my_calendar site='1']

The default shortcode would display events for the current site; but passing the site attribute will fetch events from that site instead.

https://wordpress.org/support/topic/multisite-once-calendar/

Concerning the Users being able to edit the calendars in a multisite My Calendar has that option:

If multi-site options are enabled, (see below) then this section will also include a means to switch which calendar you are currently editing. Multi-site networks can be configured to allow site administrators to choose which calendar (their own or the global calendar) they are currently contributing to or editing.

If anybody has an idea how both features ... -
1. One Global Calendar shown on many sub-sites with filter options
2. Many Local Sub calendars get summarized in a Global Calendar with filter options

- ... Could be done either with My Calendar or Events+ would be great

(or if you know a plugin which i already doing in it 4.8+)

Thanks
Andi

  • Panos

    Hi Andi ,

    I haven't came across this feature, not saying that there might not be one, I'm just not familiar with any and didn't find one in a quick search I did.

    However this can be achieved with our Post Indexer plugin along with some function shortcode that would display the results. Of course it would require the Events + plugin.

    Post Indexer is useful in such cases, as it creates a network posts table where it stores posts (and events post type) from network, so you do not need to do queries across subsite post tables in your database.

    Then you need a custom script that provides a shortcode you can use to query the network posts table. I have prepared a mu-plugin ( can be used as plugin too ), that can list the events of subsites (no calendar though), which you can use as a base and can download from here:
    https://gist.github.com/wpmudev-sls/c1aed5c8f7bcdf0f9c756c9b9756d09a

    You can upload that file to your wp-content/mu-plugins folder (if it doesn't exist you can simply create it). Then you should be able to use the following shortcode in any page:
    [global_recent_events posttype="incsub_event"]

    This should be working however we do not provide support for this as it is a custom requirement. We like to help out so we provided this snippet which you can modify as you wish to fit your needs :slight_smile:

    I hope this helps you in your project!

    Cheers!

  • Andi

    Hi Panos

    Thanks for your reply. I inserted the code into the muplugin folder but still the Local calendar gets displayed.

    Global Calendar
    [global_recent_events posttype="incsub_event"]

    Local Calendar
    [eab_calendar navigation="yes" network="yes" ]

    [eab_archive network="yes"]

    [weekly_event_calendar id="calendar1" class="weekly-calendar"]

    https://dev.phuket.click/sub1/events/
    https://dev.phuket.click/sub2/events/
    https://dev.phuket.click/sub3/events/

    You need to login to the backend as the front page displays a message about coming soon :wink:
    Access is granted!

    In the post indexer, I have inserted the incsub_event post type if it is the one used.
    Thanks
    Kind regards
    Andi

  • Panos

    Hi Andi ,

    You wont be needing the script I shared in my previous post, nor that shortcode. There is one part in Post Indexer that I don't fully understand why it gets the sub-site's option for allowed post types.

    You can add this in a mu-plugin :

    add_filter( 'postindexer_is_post_indexable', function( $indexing, $post, $blog_id ){
    
    	if( $post->post_type == 'incsub_event' ){
    		$indexing = 'yes';
    	}
    
    	return true;
    
    }, 10, 3 );

    This should allow to insert/update incsub_events in the global posts table. So after inserting the above snippet try saving an event form a subsite again and check the event's calendar shortcode where you have the attribute network set to true.

    I just tested in my site and seems to be fixing it. Could you let us know if this works for you too?

    Thanks!

  • Andi

    Hi

    Panos - sorry for the longer response time as I had a sleep first!

    Yes it is working on the network calendar
    https://dev.phuket.click/sub1/
    https://dev.phuket.click/sub2/
    https://dev.phuket.click/sub3/

    But those events don't display here, which is perhaps another problem with the shortcode rpovided by the plugin itself
    https://dev.phuket.click/sub1/events/2017/
    https://dev.phuket.click/sub2/events/2017/
    https://dev.phuket.click/sub3/events/2017/

    Unfortunately for the widgets, there is no way to categorize them so that each of this global calendar widget displays only one or more chosen categories, and/or locations, and/or tags of events here.

    This seems to be possible (as I read it) with the shortcodes inserted into the pages but as mentioned above the global calendar does not get displayed.

    Hi Panos and please tell WPMUDEV that they should give users their UserID for the Trustpilot etc ratings otherwise that is not possible to rate there. Just tried! Thanks

    Kind regards
    Andi

  • Andi

    Hi Panos
    I have posted a question concerning this problem also on the members' forum, probably somebody there could help out too or at least people could show interest on that features too.
    https://premium.wpmudev.org/forums/topic/events-widgets-dont-offer-to-choose-view-categories-locations-etc

    It looks like everything is actually available but the documentation is not very good and it is hard to find out what is actually the correct settings for the shortcodes and in the widgets the network enable is missing in most of the widgets and also the category drop-down and other fields are only available in one.

    I think it would be much better to have fewer widgets but therefore some which you can configure to achieve actually all that is mentioned in those many widgets (but all are incomplete).

    By the way, you have nice scripts in your gist
    https://gist.github.com/wpmudev-sls
    Sad those lists are unknown to most of us I think!

    Kind regards
    Andi

  • Panos

    Hi Andi!

    The events link you mention here:

    https://dev.phuket.click/sub1/events/2017/
    https://dev.phuket.click/sub2/events/2017/
    https://dev.phuket.click/sub3/events/2017/

    are supposed to show events on each sub-site, not designed to show network events on a sub-site.

    Shortcodes available with the network option will work only on main site of the mutlisite installation.

    By the way, you have nice scripts in your gist
    https://gist.github.com/wpmudev-sls
    Sad those lists are unknown to most of us I think!

    Thanks! It's not supposed to be public as it is not officially supported.

    Cheers!

  • Andi

    Hi Panos

    are supposed to show events on each sub-site, not designed to show network events on a sub-site.

    They actually work on all subsites if you have a look at the calendars in the side columns and when you insert those calendars as widgets inside the normal page of all those subpages. The only problem is that it is not possible even on the main site to display depending on a search what categories, locations, tags, authors etc should get displayed.

    Shortcodes available with the network option will work only on the main site of the multisite installation.

    This is too bad as it makes Events+ more or less no more usable as a great calendar to collect data from all kind of resources in a multisite and to display them all together on a global calendar. As all data is actually available inside that multisite it should also be possible to display that data on all sites like i.e. My Calendar is doing it already with lots of options to customize what actually gets shown. They have even a shortcode Creator integrated to make it easier for users.
    It is strange as if it is working with widgets to display all global events on subpages, why not have those filtered dynamically with a good search etc. in each subfield.

    The biggest benefit of Events+ if it would provide that feature would be that events plus indeed only display always a centralized global calendar when it gets linked from a global calendar on any subsite.

    But Events+ always links to the event and site where it has been created which is much better as here the authors are still the master of their own events and by creating great events which then get displayed in a global calendar for all events with good filter options, they could drive a lot of people to their sites. this would be especially useful also for plugins like course press and appointments besides being a must-have feature for Events +

    Kind regards
    Andi

  • Panos

    Hi Andi ,

    Shortcodes available with the network option will work only on the main site of the multisite installation.

    After Kasia Swiderska checking, the shortcodes should be also working in subsites with the network attribute.

    If this is still not working on your site could you please send in admin and ftp info so I could possibly check if there is something else going on?

    You can send that privately through our contact form: https://premium.wpmudev.org/contact/#i-have-a-different-question

    Send in:Subject: "Attn: Panos Lyrakis"

    - Admin login:
    Admin username
    Admin password
    Login url

    - FTP credentials
    host
    username
    password
    (and port if required)

    - link back to this thread for reference

    Thanks!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.