String to Array

Motoki's Avatar

Motoki

19 Jan, 2012 12:28 AM via web

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

  1. 2 Posted by Motoki on 19 Jan, 2012 12:39 AM

    Motoki's Avatar

    No worries guys, i have solved it!

    {{ item.data.array_field | split:',' | assign_to:'arraylist' }} then
    {% for item in arraylist %} ... {% endfor %}

    Cheers,
    Motoki

  2. Support Staff 3 Posted by Jonathan Hoyt on 19 Jan, 2012 10:31 AM

    Jonathan Hoyt's Avatar

    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.

  3. Jonathan Hoyt closed this discussion on 03 Feb, 2012 07:27 PM.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

20 Feb, 2012 06:34 PM
20 Feb, 2012 06:31 PM