where_exp comparing with assigned variables #790
Replies: 3 comments 1 reply
-
The So I'd say this is a feature request or compatibility bug. |
Beta Was this translation helpful? Give feedback.
-
Seems to be a valid use case, and I'm adding support for context-awareness. As this feature is introduced from jekyll and not related to shopify, we definitely should try to make it compatible with Jekyll. |
Beta Was this translation helpful? Give feedback.
-
Added support by #793 and released as 10.20.2. Please let me know if it still doesn't work. |
Beta Was this translation helpful? Give feedback.
-
I'm using liquidjs in 11ty.js and trying to put a section where I show 3 random card elements of the other posts in the current collection at the bottom. It mostly works except, I need to filter our the current post and the way I'm attempting to do it doesn't seem to work. I've been unable to find any documentation on this.
collection[tags]
is giving me all the posts in the current collections properly and usingsample: 3
is grabbing 3 random ones. However, when trying to filter out the current post It's not working at all. I'm trying to usewhere_exp
but the comparison isn't working, so I think I just have the syntax wrong for accessing a variable in the comparison.If I hardcode it to test
"item.fileSlug != 'current-pages-slug-here'"
it successfully filters it out the matching fileSlug.Is there a way to use an assigned variable in a
where_exp
?Beta Was this translation helpful? Give feedback.
All reactions