Skip to content

Instantly share code, notes, and snippets.

@simt2
Created February 21, 2017 08:16
Show Gist options
  • Save simt2/eef0eb5aa5e90e70a654499b5d5d4a30 to your computer and use it in GitHub Desktop.
Save simt2/eef0eb5aa5e90e70a654499b5d5d4a30 to your computer and use it in GitHub Desktop.
mesh-go-example productList.html
{{define "content"}}
<div>
<h1>{{ .Category.Get "fields.name" }}</h1>
<div class="row products">
{{range $product := .Products}}
<div class="col-xs-12 col-sm-6 col-md-4">
<div class="panel panel-default">
<div class="panel-body">
<h3>
<a href="{{ $product.Get "path" }}">{{ $product.Get "fields.name" }}</a>
<small>{{ $product.Get "fields.SKU" }}</small>
</h3>
<a href="{{ $product.Get "path" }}">
<img style="height: 200px; width: 100%;" src="{{ $product.Get "fields.vehicleImage.path" }}" class="img-thumbnail">
</a>
<p>{{ $product.Get "fields.description" }}</p>
<hr>
<div class="row">
<div class="col-xs-6">
<!--| number: 2 -->
<h3 style="margin: 5px 0;"><span class="label label-primary">€{{ $product.Get "fields.price" }}</span></h3>
</div>
<div class="col-xs-6 text-right">
<span class="label label-default">Weight: {{ $product.Get "fields.weight" }}</span><br>
<span class="label label-default">Stock: {{ $product.Get "fields.stocklevel" }}</span>
</div>
</div>
</div>
</div>
</div>
{{end}}
</div>
</div>
{{end}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment