Just a simple question over here for anyone who uses Business Catalyst, is there away to split array data from a web app (with liquid)? A perfect example would be when you create a check box field. When the data outputs, it is just a single string that looks like this "Ryan, Ashley, Melissa". Would I would like to do is split the data, and then wrap with a li.
I have created JQuery version of this which works, but I would love to see if there is away to perform this with liquid, as I am new to the platform.
$('.padt20').find('ul').each(function() {
var $this = $(this);
var words = $this.text().split(",");
var text = words.join("</li><li>");
$this.html("<li>" + text + "</li>");
});
HTML:
<ul>{{ArrayTag}}</ul>
I have found a solution to the problem! You need to assign an array then split it. You need to create a variable first as it won't work if you try to split it within the for loop.
{% assign array = ArrayTag | split: "," %}
{% for i in array -%}
<li> {{ i }} </li>
{% endfor %}