{{ range $i, $r := getCSV .Site.Params.sep .Site.Params.userreviews }}
{{ if eq (index $r 3) $.Params.company }}<li>{{ index $r 9 }}</li>
{{end}}{{end}}
The code above looks up a Google Sheet, and checks to see whether column 3 matches the company name. If it does, it displays the contents of column 9.
{{ range $i, $r := getCSV .Site.Params.sep .Site.Params.userreviews | first 10 }}
{{ if eq (index $r 3) $.Params.company }}<li>{{ index $r 9 }}</li>
{{end}}{{end}}
This will do the same except display the first 10 entries.
Quite clearly, this is filtering the first 10 before I check if column 3 equals the company name, so is not what I want. I want the first 10 entries where the company equals column 3.
Can anyone point me in the right direction on this please? I’m stumped.