String to Array
I wanted to allow user in the page to enter a list of names separated by , in a Short Text field and in the template parse this field into an Array so i can loop through the content. How do you do that? I can't seem to find a function for to array...
Regards,
Motoki
Comments are currently closed for this discussion. You can start a new one.
2 Posted by Motoki on 19 Jan, 2012 12:39 AM
No worries guys, i have solved it!
{{ item.data.array_field | split:',' | assign_to:'arraylist' }} then
{% for item in arraylist %} ... {% endfor %}
Cheers,
Motoki
Support Staff 3 Posted by Jonathan Hoyt on 19 Jan, 2012 10:31 AM
Sorry I didn't get back to you sooner, we've all been semi-away from our laptops... Great work figuring it out! Did the documentation help at all?
Also, we've been using a really cool new tool inside of Harmony for support lately and we're going to phase out this support option (runs on Tender), so definitely check out the Feedback link at the top of Harmony. It makes it super easy to start a discussion with us (you don't even have to leave the page!).
Have a great week.
Jonathan Hoyt closed this discussion on 03 Feb, 2012 07:27 PM.