Skip to content

Surface timely events in the banner #172

Open
@shazron

Description

@shazron

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:

<!-- {% include banner.html %} -->

To edit contents of the banner:

https://github.com/phonegap/phonegap.github.io/blob/7474ad3cb69013e9db7253f1afcf67c2ac816fae/_includes/banner.html

Proposed solution:

Requires JavaScript to make it dynamic. A .json file still needs to be uploaded to add events to.

  1. Always include banner.html contents (which will be empty), but add a CSS class to not display it.
  2. On page load, a script on the home page reads an events.json file on phonegap.com
  3. 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.
  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions