Let Muzodo keep your website up-to-date.
This is the easiest way to add events to your website. Note, however, your group identifier will be transmitted to the browser.
<div id="upcomingEventsDiv"></div>
Note: You can find your Group Api Key in your Group properties on the Groups tab
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://muzodo.com/api/muzodoApi-v2.js"></script>
<script type="text/javascript">
getMuzodoEvents("your group API key", "upcomingEventsDiv");
</script>
<ol class="myEventList">
<li class="myEventListItem">
<div class="myEventTitle">Event name</div>
<div class="myEventDetail">Event date and time</div>
<div class="myEventDetail">Address</div>
</li>
<li class="myEventListItem">..</li>
</ol>
Define these classes in your CSS to style the events.
<html>
<head>
<style>
.myEventList {
list-style-type: none;
}
.myEventListItem {
}
.myEventTitle {
color: red;
font-weight: bold;
}
.myEventDetail {
font-size: smaller;
}
.myEventDetail:nth-child(3) {
margin-bottom: 10px;
}
</style>
</head>
<body>
<div style="text-align:center; vertical-align: middle">
<h2>Upcoming Gigs</h2>
<div id="upcomingEventsDiv"></div>
</div>
</body>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<script src="https://muzodo.com/api/muzodoApi.js"></script>
<script type="text/javascript">
var options = {
classMap: {
eventList: "myEventList",
eventListItem: "myEventListItem",
eventTitle: "myEventTitle",
eventDetail: "myEventDetail",
}
};
getMuzodoEvents("your group API key", "upcomingEventsDiv", options);
</script>
</html>
<div style="text-align:center; vertical-align: middle; display:none"
class="muzodo-show-if-events">
<h2>Upcoming Gigs</h2>
<div id="upcomingEventsDiv"></div>
</div>
<script type="text/javascript">
var options = {
classMap: {
eventList: "myEventList",
eventListItem: "myEventListItem",
eventTitle: "myEventTitle",
eventDetail: "myEventDetail",
noEvents: "myNoEvents"
},
noEventsText: "No events are currently planned."
};
getMuzodoEvents("your group API key", "upcomingEventsDiv", options);
</script>
<script type="text/javascript">
var options = {
classMap: {
eventList: "myEventList",
eventListItem: "myEventListItem",
eventTitle: "myEventTitle",
eventDetail: "myEventDetail",
noEvents: "myNoEvents"
},
noEventsDisplayFrom: "YEAR"
};
getMuzodoEvents("your group API key", "upcomingEventsDiv", options);
</script>
<script type="text/javascript">
var options = {
classMap: {
eventList: "myEventList",
eventListItem: "myEventListItem",
eventTitle: "myEventTitle",
eventDetail: "myEventDetail"
},
eventType: "PRIVATE,REHEARSAL"
};
getMuzodoEvents("your group API key", "upcomingEventsDiv", options);
</script>
<script type="text/javascript">
var options = {
classMap: {
eventList: "myEventList",
eventListItem: "myEventListItem",
eventTitle: "myEventTitle",
eventDetail: "myEventDetail"
},
exclude: "UNCONFIRMED"
};
getMuzodoEvents("your group API key", "upcomingEventsDiv", options);
</script>
<script type="text/javascript">
var options = {
classMap: {
eventList: "myEventList",
eventListItem: "myEventListItem",
eventTitle: "myEventTitle",
eventDetail: "myEventDetail"
},
maxEvents: 3
};
getMuzodoEvents("your group API key", "upcomingEventsDiv", options);
</script>
<script type="text/javascript">
var options = {
classMap: {
eventList: "myEventList",
eventListItem: "myEventListItem",
eventTitle: "myEventTitle",
eventDetail: "myEventDetail"
},
displayFrom: "YEAR"
};
getMuzodoEvents("your group API key", "upcomingEventsDiv", options);
</script>
<script type="text/javascript">
var options = {
classMap: {
eventList: "myEventList",
eventListItem: "myEventListItem",
eventTitle: "myEventTitle",
eventDetail: "myEventDetail",
eventCancelled: "myEventCancelled"
},
reverseOrder: true
};
getMuzodoEvents("your group API key", "upcomingEventsDiv", options);
</script>
<script type="text/javascript">
var options = {
classMap: {
eventList: "myEventList",
eventListItem: "myEventListItem",
eventTitle: "myEventTitle",
eventDetail: "myEventDetail"
},
dateFormat: "mmm d, yyyy" // e.g. Sep 5, 2022
};
getMuzodoEvents("your group API key", "upcomingEventsDiv", options);
</script>
Value | Meaning |
---|---|
d | Day of the month as digits; no leading zero for single-digit days. |
dd | Day of the month as digits; leading zero for single-digit days. |
ddd | Day of the week as a three-letter abbreviation. |
dddd | Day of the week as its full name. |
m | Month as digits; no leading zero for single-digit months. |
mm | Month as digits; leading zero for single-digit months. |
mmm | Month as a three-letter abbreviation. |
mmmm | Month as its full name. |
yy | Year as last two digits; leading zero for years less than 10. |
yyyy | Year represented by four digits. |
<script type="text/javascript">
var options = {
classMap: {
eventList: "myEventList",
eventListItem: "myEventListItem",
eventTitle: "myEventTitle",
eventDetail: "myEventDetail",
eventCancelled: "myEventCancelled"
},
includeCancelled: true
};
getMuzodoEvents("your group API key", "upcomingEventsDiv", options);
</script>
var options = {
classMap: {
eventList: "myEventList",
eventListItem: "myEventListItem",
eventTitle: "myEventTitle",
eventDetail: "myEventDetail",
},
noEventsText: "No events are currently planned.",
customFields: [
{ field: "Ticket Price",
title: "Tix",
prefix: "£",
separator: ": ",
class: "myTicketPriceClass"
}
]
};
customFields: [
{ field: "Ticket Price",
prefix: "£",
separator: ": ",
class: "myTicketPriceClass"
},
{ field: "Another custom field",
class: "myAnotherClass"
},
{ field: "And another",
class: "myAndAnotherClass"
}
]
Muzodo generates HTML for the 'Ticket Price' field as follows:
<li class="myEventListItem">
<div class="myEventTitle">Test draft</div>
<div class="eventDate myEventDetail">Fri 31 Mar 2018</div>
<div class="eventAddress myEventDetail"></div>
<div class="customFields">
<span class="myTicketPriceClass eventCustomFieldName myEventDetail">Ticket Price</span>
<span class="myTicketPriceClass eventCustomFieldSeparator myEventDetail">: </span>
<span class="myTicketPriceClass eventCustomFieldValue myEventDetail">£ 11.99</span>
</div>
<div class="eventSpacer"></div>
</li>
Note the class definitions which gives you fine-grained control over styling.
<script type="text/template" data-template="eventitem">
<tr>
<td>${Name}</td>
<td>${FormattedDate}</td>
<td>${TimeRange}</td>
<td>
<a href="${CustomField_DetailsURL_Value}">More info..</a>
</td>
</tr>
</script>
<body>
<h2>Upcoming Events</h2>
<div id="upcomingEventsDiv">
<table id="upcomingEventsTable" class="table">
<tr>
<th>Name</th>
<th>Date</th>
<th>Time</th>
<th>Link</th>
</tr>
</table>
</div>
</body>
<script type="text/javascript">
var options = {
template: "eventitem",
customFields: [
{
field: "Details URL"
}
]
};
getMuzodoEvents("your group API key", "upcomingEventsTable", options);
</script>
See here for details on the fields that are available.