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 →

username unavailable in member:listing when using conditions param.

Curtis Blackwell January 19, 2016 by Curtis Blackwell

Running Statamic 1.11.1.

template:

{{ member:listing
    conditions = "investments:/portfolio/{last_segment}"
    sort_by    = "last_name"
    role       = "investor"
}}
  {{ username }}
{{ /member:listing }}

Sample member file:

---
email: [email protected]
first_name: Bob
last_name: Loblaw
password: ""
roles:
  - investor
_uid: xxx
investments:
  - /portfolio/rutabaga
  - /portfolio/potato
  - /portfolio/mushroom
  - /portfolio/sweet-potato
password_hash: xxx
---

This outputs the indices instead of the usernames. Using Jason's All the Vars plugin, I see that username's value is null.

I saw that removing conditions allows me to get at all the info. As does this not-so-elegant solution:

{{ member:listing
    conditions = "investments:/portfolio/{last_segment}"
    sort_by    = "last_name"
    role       = "investor"
}}
  {{ member:profile uid="{_uid}" }}{{ username }}{{ /member:profile }}
{{ /member:listing }}
>>>>>>> Unanswered <<<<<<<
0 Replies
1 Follower