Closed DynamiteGoesBoom closed 1 year ago
@engram-design Do you have any ideas on how this could be accomplished?
Many thanks!
So first thing, what sort of fields are Progress field and Application Status field? I assume these are on your List Type layout, not your entries layout (the thing that you add to your Wishlist). There's sometimes a little confusion on that front, so thought to check.
And just to also confirm, the following doesn't grab all the wishlist items, it grabs a single wishlist list.
{% set allGrants = craft.wishlist.lists().one() %}
To get all the items in that you do:
{# FYI, you probably need to get the current users' list, not just the first list #}
{% set list = craft.wishlist.lists().one() %}
{# Find all items where `applicationStatus` custom field == `inProgress` #}
{% set inProgressGrants = list.items.applicationStatus('inProgress').all() %}
The above should return all the items in that list where the custom field applicationStatus
equals inProgress
. Again, I don't know the type of field this is, but you should only require relatedTo
if that field is an element field.
Hope that helps?
Hey@engram-design thanks for chiming in. Those two fields are just dropdown select fields. Yes I am only trying to get the active users wish list. We're attempting to use WishList as a way to organize the status of a Saved Grant. Each Grant can have an Application Status of: In progress, lost, won, or archived. So I was hoping to use that dropdown to help organize those.
If I do {% set allGrants = craft.wishlist.lists(true).one() %} {% set inProgressGrants = allGrants.items.applicationStatus('inProgress').all() %}
then I don't get any items to appear with the inProgressGrants
query although there is one with that option in the Dashbboard:
is there anything else I can try?
@engram-design never mind it looks like I got it sorted out after all!
Thanks again!
Question
Love the plugin gang! But I'm having trouble doing something that seems sort of easy to do, at least in theory.
I have a Wishlist with Items. Each item is being used as an Application. Each application has a Progress field and a Application Status field.
I know that I can grab all of the Items in the Wishlist by doing this:
But what I can't figure out is how I can query against the values of my
applicationStatus
field. I tried usingrelatedTo
in my query:When doing that I get:
I'm probably over thinking this and would appreciate your insight :)
I don't think this is a bug per say so filing it under
Question
and hoping that's correct :)Thanks gang!
Additional context
No response