These are chat archives for locomotivecms/v3

1st
Mar 2016
milanvanzanten
@milanvanzanten
Mar 01 2016 15:45

I don't find any documentation on this: Is it possible in liquid to create arrays to iterate over? (like so: {%for link in ["first", "second", "third"] %} stuff {% endfor %})

If yes, is it possible to do the same with dicts? Does liquid even know dicts?

Didier Lafforgue
@did
Mar 01 2016 15:47
@milanvanzanten I would say yes, if not, let know
however, I’ve got doubts for dicts
milanvanzanten
@milanvanzanten
Mar 01 2016 15:47
so that syntax should work?
Didier Lafforgue
@did
Mar 01 2016 15:48
yes
if not, this one will work
{% assign my_array = [“first”, “second”, “third”] %}
{% for link in my_array %}{{ link }}{% endfor %}
(be careful to quotes)
milanvanzanten
@milanvanzanten
Mar 01 2016 15:53
it seems to completely ignore the whole loop...
even plaintext inside it
Didier Lafforgue
@did
Mar 01 2016 15:56
indeed
hmmm
{% assign my_array = "first,second,third" | split: ',' %}
            {{ my_array | size }}
            -{% for link in my_array %}!{{ link }}!{% endfor %}-
milanvanzanten
@milanvanzanten
Mar 01 2016 16:00
thanks, this seems to do the job
so there is no easier array creation in liquid...?
Didier Lafforgue
@did
Mar 01 2016 16:01
looks like there isn’t but I’m surprised
milanvanzanten
@milanvanzanten
Mar 01 2016 16:02
the shopify reference just lists filters to do things with already existing arrays.
Didier Lafforgue
@did
Mar 01 2016 16:03
exactly
but I’ve seen somewhere a plain array in liquid...
milanvanzanten
@milanvanzanten
Mar 01 2016 16:15
well, the split will do now, thanks for your help!
Didier Lafforgue
@did
Mar 01 2016 16:15
you’re welcome!
milanvanzanten
@milanvanzanten
Mar 01 2016 16:59

sorry for the debugging here, but i just got a very cryptic (to me, anyway) error:

Resource invalid: entries_custom_fields.base: is invalid, entries_custom_fields.2: Type is not included in the list

in wagon 2.0.1 while deploying

Didier Lafforgue
@did
Mar 01 2016 17:15
which one of your content types?
milanvanzanten
@milanvanzanten
Mar 01 2016 17:15
i just solved it
Didier Lafforgue
@did
Mar 01 2016 17:15
okay
milanvanzanten
@milanvanzanten
Mar 01 2016 17:16
somehow generating a content type with a field image:file gave that field a type: url which wagon didn't like
Didier Lafforgue
@did
Mar 01 2016 17:17
type: url
hmmm
I’ll take a look at it
milanvanzanten
@milanvanzanten
Mar 01 2016 17:17
changed it to type: file – worked
(manually)
Didier Lafforgue
@did
Mar 01 2016 17:17
yeah but looks like a bug
milanvanzanten
@milanvanzanten
Mar 01 2016 17:18
yes