New: Learn Statamic on Laracasts!

We've retired the forum in favor of GitHub Discussions.

New conversations can be started on GitHub. Existing conversations will remain for a while longer.

Head over to GitHub →

Only output each unique value instance once.

Compass Creative April 11, 2019 by Compass Creative

Hi folks, I’m struggling with a scenario, help is most appreciated.

I have a collection, with entries that have a custom field. In my template, I’d like to list the value entered into this field, but only once per each unique instance of that value.

For example:

entry:
    field: value1
–––
entry:
    field: value2
–––
entry:
    field: value1
–––
entry:
    field: value3
–––
entry:
    field: value1
–––

Would output in the template:

Value1
Value2
value3

Is this possible in the antlers syntax?

Answered by Erin Dalzell!
>>>>>>> Answered <<<<<<<
6 Replies
3 Followers