Skip to content

Instantly share code, notes, and snippets.

@adamfairholm
Created June 17, 2013 15:19
Show Gist options
  • Save adamfairholm/5797719 to your computer and use it in GitHub Desktop.
Save adamfairholm/5797719 to your computer and use it in GitHub Desktop.
{{ query:run select="DISTINCT nominee_year" from="nominees" }}
<option value="{{ nominee_year }}">
{{ nominee_year }}
</option>
{{ /query:run }}
@rickysullivan
Copy link

Wowsers. Much easier.

I hacked the core and added a group_by param...

< select id="past-winners-select-year" name="past-winners-select-year" >
{{ streams:cycle stream="nominees" group_by="nominee_year" }}
< option value="{{ nominee_year }}" >
{{ nominee_year }}
< /option >
{{ /streams:cycle }}
< /select >

Not sure if has any complications, but it seems to be working for me...

$group_by = 'GROUP BY ' . implode(', ', $sql['group_by']);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment