Forum

Thread tagged as: Question, Problem, Runway

Help with JSON

I am using Perch Runway for a site and I need a little help. I have created a page which loads a map and markers on it. I have tested with dummy JSON and it is working fine but now I am trying to create a JSON file which pulls content from into JSON format.

I am using a collection to manage the data which is to be loaded into this page. The template I have created is:

<perch:before>{"venues":[</perch:before>{"lat":<perch:content type="text" id="lat" label="Latitude" required="true" order="6" divider-before="Location Details" />,"lng":<perch:content type="text" id="long" label="Longitude" required="true" order="7" />,"id":"location<perch:content id="perch_item_index" type="hidden"/>","name":<perch:content type="text" id="name" label="Name" title="true" required="true" order="1" jsonencode="true" />,"content":"<perch:content type="textarea" id="summary" label="Summary" html="true" editor="redactor" striptags="true" order="2" words="30" append="..." />","city":<perch:content type="text" id="town" label="Location Town / City" order="3" jsonencode="true" />,"country":"<perch:content type="text" id="country" label="Country" order="4" />","image":"<perch:content type="image" id="image" bucket="Highlights" label="Image" crop="true" width="100" height="100" order="5" />"<perch:if exists="perch_item_last">}]<perch:else />},</perch:if><perch:after>}</perch:after>

All that I need to do now is load the collection data into a new file. I created one called 'markers.json' and thought I could just put...


perch_collection('Markers', [ 'template'=>'gig.markers.html', ]);

...in the page and it would load the collection. This is evidently not the case as the page is blank.

I'm evidently doing something wrong! I was hoping for some pointers and clarification about creating a JSON file from content / collections.

Any help much appreciated.

Ben Stillwell

Ben Stillwell 1 points

  • 5 years ago
Rachel Andrew

Rachel Andrew 394 points
Perch Support

Is there anything in your error log? Usually a blank page means a PHP error.

If you just mean the content is not loading then turn on debug in Perch to see what is happening.