Adding upcoming events to your website

Let Muzodo keep your website up-to-date.

The Website Widget

If your website is using PHP, the easiest way to display your upcoming events is with the PHP Website Widget. If you have questions or need help setting it up, contact us.

We suggest you proceed in the following way:

  1. Make a copy of the calendar/events page from your website.
  2. Make the PHP code changes below and run it to see it work.
  3. Change the embedded HTML in the code below to use the same classes and styles as used on your website.

Quick setup

To get you going quickly, here are the basics:

  1. Download the PHP Web Widget code here.

  2. Unzip it and include it at the top of your PHP web page:
  3. Instantiate the widget, passing your Group's API key (found on your Group details page):
    	$apikey = "your group API key";
    	$muzodoWebWidget = new MuzodoWebWidget($apikey);
  4. Set any filters (see below for available filters):
    	# Note: Private events have their address withheld by the API, 
    	#       so you can show those events on your website too.
  5. Loop through each event and add formatting:
    <!-------------------------NEW CODE START------------------------------------------->
    <h2><a name="performances">Upcoming Performances</a></h2>
    <table class="performance">
    			<th class="performance-date">Date</th>
    			<th class="performance-location"><u>Performance</u></th>
    <? foreach ($muzodoWebWidget->getUpcomingEvents() as $key => $event) {
    			<td class="performance-date">
    				<? echo $event->FormattedDate . ", " . 
    					$event->FormattedPlayTime . "-" . 
    					$event->FormattedEndTime ?>
    			<td class="performance-location">
    				<?= $event->Name ?><br />
    				<?= $event->Address ?>
    <? } ?>
    echo $muzodoWebWidget->getSchemas();
    # See for details. 
    # A schema is a machine readable format that
    # allows search engines to find details on your events.
    <!-------------------------NEW CODE END------------------------------------------->

    Widget filters

    Below are the filters available in the widget.

    FunctionDefault Value

    API Fields

    See here for details on the fields that are available.