Open
Description
Problem:
Events, which is a link in the footer of the site, is hard to discover unless we have a banner on the top of the site. For major events like PhoneGap Day we do show the banner, but for other events where team speakers are at, we don't. We need a way to show upcoming events on the site, without it being a manual process.
Right now editing the banner is a manual process:
To hide/show, uncomment:
Line 21 in 7474ad3
To edit contents of the banner:
Proposed solution:
Requires JavaScript to make it dynamic. A .json file still needs to be uploaded to add events to.
- Always include
banner.html
contents (which will be empty), but add a CSS class to not display it. - On page load, a script on the home page reads an
events.json
file onphonegap.com
- The script parses the
events.json
, and sorts then chooses an upcoming event (the rule could be if it will be occurring in a month or so), and displays it. If there are multiple events in a month, cycle through them. - Once the event(s) are chosen, write the appropriate HTML to the DOM element that comprises the event in
banner.html
, and display the div.
Template:
<div class="announcement-banner">
<a href="EVENT_LINK">EVENT_TITLE<span style="text-decoration:underline;">Get the details</span></a>
</div>
Based on banner.html
, the events.json
file would be in the format:
[
{
"start_date": "2016-12-02",
"end_date": "2016-12-02",
"event_title": "Decompress AU - a community day for designers and developers.",
"event_link": "http://2016.decompress.com.au/"
},
{
"start_date": "2016-12-02",
"end_date": "2016-12-05",
"event_title": "dotJS - the largest JavaScript conference in Europe",
"event_link": "https://www.dotjs.io/"
}
]
Dates in the .json are ISO-8601.