Ticket #31630 Public

use shortcodes on multisite install with switch_to_blog (or aggregating events)

Hi i need to grab the events from another blog on a multisite setup and show them in the calendar addon. here is the function im trying to build… the calendar comes up, but no events come up…


function module_cal_portail(){

switch_to_blog(6); // formations
echo do_shortcode(“[add_eventon_fc]”);

add_shortcode(“module_cal_portail”, “module_cal_portail”);


I’ve event bought the api addon to try to accomplish this. Ideally id be able to use the switch blog function and pickup events from different blog. Even better would be to aggregate all events more perticular blog ids. that would be a great addon to the api… right now ive paid for it but dont think it fits my need.


thanks for your help

BY: ulumi - Mar 19,2017 AT 4:29PM - 4 years ago
    • By: infotainerdave Mar 19,2017 AT 10:11PM - Posted 4 years ago - #31640

      Thank you for your messages, I am going to assign this ticket to Ashan and he will be able to take it from here and find you a solution. Please allow some time for him to get back to you, we greatly appreciate your patience and thank you for being a eventon customer!

    • By: Ashan Perera Mar 20,2017 AT 12:04PM - Posted 4 years ago - #31720

      I am not sure if the PHP approach you are doing would work I have not tried such thing. But I know the API addon would allow you to show calendar on another site. Following the instructions in API settings page you can copy paste the js code and paste it on whre you want to show that events.

      Have you not tried that? If you have please let us know where you are struggling with that.

    • By: ulumi Mar 20,2017 AT 12:15PM - Posted 4 years ago - #31721

      Hello – thanks for your answer. Id really like not to be limited by the js version.

      the switch_to_blog() function is a quite conventional way for blogs to access other blogs in a multisite install. Most plugin support this as I think its pretty straightforward to implement. It actually often just work without developper effort.

      the function basically re-routes any db call to the correct blog tables until restore_current_blog.

      In your case it seems to work on the php side ( my calendar at http://dev-geo.huguesbp.com/formation/ shows the dates with their “have-events” class  )

      but the problem seems to lie within the ajax function and its return.

      As i’ve bought all your plugin and 3 addons, I,d really be grateful if you could make this work. Im sure other developper and clients would be pleased to see a “multisite compatible” eventon version – you could wrap it in an addond… anyways… id be happy to help with the testing.

      If you need a sftp and admin account on a multisite install, let me know.

      Id really like to get this sorted out, thanks for your support in advance.

    • By: Ashan Perera Mar 21,2017 AT 8:50AM - Posted 4 years ago - #31802

      As you know we have a lot going on and lot of exciting things we are always working on so I am gonna have to move this into feature request and see if there is great demand for it for us to dedicate time to add this to eventon.

    • By: ulumi Mar 29,2017 AT 3:10PM - Posted 4 years ago - #32683

      hello – ive made the api work partially – there is two things:

      http://dev-geo.huguesbp.com/ – check out the Calendar section

      its separated in two columns – left side is the desired component (called in php with my switch_to_blog) – right is the api embed.

      1. BUG: even though the right parameter is inserted in the api js code (new_window: false) the click on events opens a new window. that really needs to be fixed
      2. Can the api javascript be modified so it renders the “fullcal view” like the left part^
      3. If you look at the days highlights on the left side, you ca see that its “almost working” > the events are detected, but the event list does not get properly updated…
      4. what Id really need ia a decent calendar view – if you can supply a way to get this working on a multisite id really be grateful.
    • By: Ashan Perera Mar 30,2017 AT 10:05AM - Posted 4 years ago - #32800

      please replace this file https://www.dropbox.com/s/9397rfdqt4uvo50/eventon.js?dl=0 to mail eventon-api folder. should fix one new window bug.

      as far as getting it to look like fullcal, its tough one because when you click on a date in fullcal it has to connect to main server to pull data. It is something that is still in R&D

You must login to reply to this ticket


Welcome to EventON helpdesk.

EventON is the #1 Best selling event calendar plugin for WordPress websites in envato marketplace.

Checkout EventON