I'm trying to create an array from a list of objects using Liquid syntax:
{% for operation in menuItems %}
{% assign words1 = operation.Title | split: '_' %}
{% assign controllerName = words1 | first %}
{% assign controllersTmp = controllersTmp | append: '_' | append: controllerName %}
{% endfor %}
I want to split the controllersTmp
to get my array, but at this point my controllersTmp
is empty.
Any help ?
You can directly create a new empty array
controllers
andconcat
to it yourcontrollerName
converted into an array using the workaroundsplit:''
. The result is directly an array, without the extra string manipulations.