Forum

Thread tagged as: Question, Runway, Forms

Hmm.. Maybe I'm making this more complex than it needs to be.

I have a Collection setup, pulling data to the landing page which is working fine, printing the names off in a list.

For search I want to get all of those full names into a JSON file formatted like: ["Rachel Andrew","Drew McLellan"]

So to review, I'm going to need to setup a new Perch Template that outputs as JSON and passes back into the perch_collection template... Is that right?

I suppose my problem right now is that when creating that new template, I'm not sure how to tell it to grab those same names from my Collections Template. Right now it's setup like this:

<perch:content id="artist_first_name" type="text" label="First Name" /> <perch:content id="artist_last_name" type="title" label="Last Name" />

Thanks so much for all of your support. Really appreciate it and my apologies for being a rookie on this.

Drew McLellan

Drew McLellan 2638 points
Perch Support

So something like:

<perch:before> [ </perch:before>

['<perch:content id="artist_first_name" type="text" label="First Name" /> <perch:content id="artist_last_name" type="title" label="Last Name" />'],

<perch:after> ] </perch:after>

Got it working with a new template! Thanks for the help all. Learned a thing or two about Perch & JSON this week.