-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
I know this feature has been requested before in this thread: #236
And based on 85 liking the idea, versus 2 not liking the idea says something.
But that issue was closed back in 2016, and as the docs says:
Things we will merge
- Features that are likely to be useful to the majority of Liquid usersI personally still see a great advantage in having the opportunity to use ternary operators, the code is way more slick and friendly to look at.
I saw the default filter was suggested, but doesn't always come in handy, when using logic.
Without ternary
{%- liquid
assign has_selected_variant = false
if product.selected_variant != nil
assign has_selected_variant = true
endif
-%}With ternary
{%- assign has_selected_variant = product.selected_variant != nil ? true : false -%}Curzey, VinyLimaZ, theetrain, bakura10, julioalucero and 51 morepaulshryock and 19h47paulshryock and 19h47Rio517, koiralakiran1, douglaslise, emilybennet, paulshryock and 1 moreCurzey, julioalucero, swistaczek, koiralakiran1, emilybennet and 4 moreCurzey, julioalucero, swistaczek, koiralakiran1, paulshryock and 1 more
Metadata
Metadata
Assignees
Labels
No labels