Getting Items for a MB View via RestAPI (e.g. from Amelia Events)?

Support MB Views Getting Items for a MB View via RestAPI (e.g. from Amelia Events)?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #48538
    Oliver SchützeOliver Schütze
    Participant

    Hi,
    there several examples how to use data from post types in WordPress for creating a MB view. But I want to use the event management plugin from Amelia and it seems that it doesn't store their data as post types but in their own database. The good point is that they offer RestAPI endpoints to access their event data (see https://wpamelia.com/amelia-api-events/) and therefore I could iterate through the available events, similar to your example https://docs.metabox.io/tutorials/show-event-on-calendar-mb-views/ in which you collected events to generate JSON formatted data for the FullCalendar widget.

    But is such "iterating through data loaded via RestAPI endpoint" possible with the language you use to "implement" the view layout?

    Regards,
    Oliver

    #48542
    PeterPeter
    Moderator

    Hello Oliver,

    If Amelia supports getting events via Rest API, you can create a custom PHP function to get the events and return the expected data.
    Then in the View editor, you can call the custom function via mb. proxy to get the data and output in the frontend. Refer to this documentation https://docs.metabox.io/extensions/mb-views/#running-php-functions

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.