I use code
<select class="order form-control border-0" id="select-1" required>
{{ range (index .Site.Data .Params.supplier .Params.ramtype) }}
<option value="{{ .price }}" selected>{{ .item }}</option>
{{ end }}
</select>
to range items and prices from the list
DDR3:
- item: Select RAM
price:
- item: DDR3 2GB
price: 12.00
- item: DDR3 4GB
price: 19.00
- item: DDR3 8GB
price: 33.00
What should I do if I want one of the items selected? I’d read, but AFAIK this is not documented. I tried
- item{selected}: DDR3 8GB - does not work
- item[selected]: DDR3 8GB - does not work
- item(selected): DDR3 8GB - does not work
Please advise!