Forum

Thread tagged as: Question

Getting raw input data from map field

Hi,

Is it possible to retrieve the raw data from a map field? I'm looking for the address used in the search, the lat/lng etc. Basically, everything included in the itemJSON attribute (when showing all ids with <perch:showall />. I want the data inside this: {"_id":"10","map":{"adr":"96 Euston Rd, Kings Cross, London NW1 2DB" ...}

Thanks!

Oliver Lowe

Oliver Lowe 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you using the skip-template option?

Not currently, but I could. I'm using a perch_content() function at the moment. Would you suggest I use perch_content_create in conjunction with perch_content_custom and skip-template option?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I think skip-template is the only way to get to the internals of the map field type. I don't believe it exposes other components to the template (although it probably should).

Ok, I'll do a perch_create_content and perch_content_custom!

Thanks Drew