Skip to content

Instantly share code, notes, and snippets.

View tsmango's full-sized avatar

Tom Mango tsmango

View GitHub Profile
<select onchange="if(this.options[this.selectedIndex].value !=''){window.top.location.href=this.options[this.selectedIndex].value}">
<option value="">Select a Category...</option>
{% for c in store.categories %}
<option value="{{ c.url }}" {% if category and category.url == c.url %}selected="selected"{% endif %}>{{ c.name }}</option>
{% endfor %}
</select>
{% if config['left_banner_image_url'] or config['right_banner_image_url'] }
<div id="banners">
{% if config['left_banner_image_url'] }
<img id="left-banner" src="{{ config['left_banner_image_url'] }}"/>
{% endif %}
{% if config['right_banner_image_url'] }
<img id="right-banner" src="{{ config['right_banner_image_url'] }}"/>
{% endif %}
</div>
...,
"left_banner_image_url": {
"format": "image",
"label": "Left Banner Image URL",
"help": "Enter an image URL or choose an image file to upload.",
"placeholder": "http://",
"position": 31
},
- #container #main #content #product-grid .product #variations #cart_variation_id {
+ #container #main #content #product-grid .product #variations .cart_variation {
width: 128px;
margin-right: 5px;
}

Anatomy of a Limited Run Theme


Every Theme is made up of many Assets and each Asset is one of many types:

  • layout
  • stylesheet
  • javascript
  • template
  • snippet

Theme API


Every Asset in a Theme supports Limited Run's Theme API and there are two main ways to use the API:

  1. Output - {{ }} for things like {{ store.name }}, which will output something, like Exit Records.
  2. Tags - {% %} for things like if, unless, for, and paginate.

Output

+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 281 | 221 | 7 | 32 | 4 | 4 |
| Helpers | 35 | 30 | 0 | 2 | 0 | 13 |
| Models | 345 | 268 | 8 | 36 | 4 | 5 |
| Libraries | 0 | 0 | 0 | 0 | 0 | 0 |
| Model specs | 445 | 336 | 0 | 0 | 0 | 0 |
| Controller specs | 1100 | 868 | 1 | 36 | 36 | 22 |
| Helper specs | 60 | 16 | 0 | 0 | 0 | 0 |
.circle {
background: whiteSmoke;
border: 1px solid #CCCCCC;
-moz-border-radius: 20px;
-webkit-border-radius: 20px;
display: block;
float: left;
height: 40px;
margin: 5px 0 5px -50px;
position: relative;
- (void)queryDidReceiveNotification:(NSNotification *)notification {
NSArray *results = [self.metadataQuery results];
for(NSMetadataItem *item in results) {
NSString *filename = [item valueForAttribute:NSMetadataItemDisplayNameKey];
NSNumber *filesize = [item valueForAttribute:NSMetadataItemFSSizeKey];
NSDate *updated = [item valueForAttribute:NSMetadataItemFSContentChangeDateKey];
NSLog(@"%@ (%@ bytes, updated %@)", filename, filesize, updated);
}
}
<header id="topper">
<nav id="menu">
<ul>
<li><a href="http://www.angstintheindustryrecords.com/contact">contact</a></li>
<li><a href="http://www.angstintheindustryrecords.com/performances">performances</a></li>
<li><a href="http://www.angstintheindustryrecords.com/about">about</a></li>
<li><a href="http://www.angstintheindustryrecords.com/media">media</a></li>
<li><a href="/">store</a></li>
<li><a href="/bands">bands</a></li>
<li><a href="/discography">discography</a></li>