Harmony

I’ve built several band websites on Harmony and one of my favorite features of the platform is how slick it is to display upcoming calendar events. I’ve never been into the embeddable widgets like those from reverbnation. You lose branding and they’ve always seemed tacky. Harmony Data Feeds allow you to do it your own way.

Data Feeds give you access to any external json or xml feed and its data so you can easily include it in your template. The guys at Ordered List were smart enough to include some preset services, including Google Calendar. Give it a calendar ID and it finds the feed for you. Easy.

What’s not quite as easy is navigating the Google Calendar data tree. There’s a ton of nested information there and it took me a while to figure out what bits I actually wanted to show.

The Code

This is what I ended up with using my data feed titled ‘shows’:

<ul>
  {% feed 'shows' %}
    {% if feed.data.feed.entry == null %}
      <em>No shows are currently scheduled</em>
    {% else %}      
      {{ feed.data.feed.entry | reverse | assign_to:'sorted_shows' }}
      {% for entry in sorted_shows %}
        <li>      
          <a href="http://maps.google.com/maps?q={{ entry.["gd$where"][0]["valueString"] }}&hl=en">
            <h4 class='venue'>
              {{ entry.title.["$t"] }}
            </h4>
            <time class='date'>
              {{ entry.["gd$when"][0]["startTime"] | date: '%-m/%-d'  }}
            </time>
            <span class="other-acts">{{ entry.content.["$t"] }}</span>
            <span class="misc">
              starts at {{ entry.["gd$when"][0]["startTime"] | date: '%-I%p'  }}
            </span>
          </a>
        </li>        
      {% endfor %}
    {% endif %}
  {% endfeed %}
</ul>

Throw that in an include and place it wherever you want.

Breaking it down

{% if feed.data.feed.entry == null %}
  <em>No shows are currently scheduled</em>
{% else %}

If there aren’t any entries, display a message saying there aren’t any shows. Remember this feed is for upcoming events only, so you don’t have to worry about past events showing up.

{{ feed.data.feed.entry | reverse | 
  assign_to:'sorted_shows' }}

This bit takes the array of entries which is sorted by date, reverses the order so you get descending date order, and assigns it to the “sorted_shows” variable.

{% for entry in sorted_shows %}

Fairly self explanatory. Do what’s nested for each event in our sorted array.

<a href="http://maps.google.com/maps?q=
  {{ entry.["gd$where"][0]["valueString"] }}&hl=en">

This part grabs the first “Where” information from an event and gets the value of the string. I’m not really sure why there would be multiple “Where” data strings1, but the first one is what we need right now. I’m then putting that in a Google Maps search query link.

{{ entry.title.["$t"] }}

The title of the event. I’m using this field for the name of the venue. “$t” seems to be the string. Don’t ask me why.

{{ entry.["gd$when"][0]["startTime"] |
  date: '%-m/%-d'  }}

Again grabbing the first start time data and using Harmony’s date filter to show only the month and date.

{{ entry.content.["$t"] }}

The description/details of the event. I’m using it to show cover charge and other acts.

starts at {{ entry.["gd$when"][0]["startTime"] | 
  date: '%-I%p'  }}

Here we have the start time again, but only showing the hour and am/pm.

What you end up with is a nice list of your events on your website while you create them by the more familiar way of using a calendar.


1 This might have to do with repeating events. As you can see by looking at the data structure, their API is pretty complex.

I’ve redesigned my website several times and have spent the past few years running Chyrp, a lightweight PHP blogging/tumblogging engine. After I learned the lead developer would no longer actively develop Chyrp1, I stopped watching the community and kind of let my site rot. I was busy doing Relatively Early work where I was exposed to Harmony and I instantly fell in love with it. Building and maintaining client sites on it is a breeze, and it’s fun to do. After learning what I could do with it I decided to port my site over, wanting to simplify things anyway.

Although I will miss being involved in the development community of an open-source blogging engine, moving to Harmony provides me with lots of data flexibility and options without the hassle of maintaining my own software installation. The guys at Ordered List keep rolling out awesome new features. No, it’s not free, but the monthly cost of hosting + a killer CMS is very fair.

As for the site structure, I wanted a simple blog where I could highlight some projects I’ve worked on without feeling like I was juggling a bunch of pages or splitting things up into categories. The home page is just a blog where you can access tags and archives at the bottom or from article headers.

To highlight projects I thought were significant I threw together the campily-named “Lifetime Achievements” section. Clicking on the tagline in the page header reveals an icon grid of blog posts about big projects. I had a little too much fun with CSS3 animations and transitions. The name/date sorting functionality is made possible with Quicksand. I think it will be a fun and fairly painless way to document things I’ve worked on.

The overall design and colors are based on my favorite shirt:

The shirt of Inspiration!

I’ve moved most of my old posts over, but this is more of a fresh start. A webby do-over!


1 Although it seems that semi-recently Chyrp was kicked into active development again and released a 2.1.

About

Ad9aa05f652ec70c232ba38866e57df4?s=60

I like making things on the internet with CremaLab and music with Fullbloods, The Empty Spaces, and Golden Sound Records. I live in Kansas City and enjoy food and drink.