Expression Engine JSON (Webpage Template) Code


/ Published in: Other
Save to your folder(s)

This can load live map JSON data from Expression Engine Database Locations Entry.


Copy this code and paste it in your HTML
  1. [
  2. {
  3. "Company": "",
  4. "Service Group": "",
  5. "Location Type": "",
  6. "Address Line 1": "",
  7. "Address Line 2": "",
  8. "City": "",
  9. "State": "",
  10. "Zip": "",
  11. "Division": "",
  12. "Country": "",
  13. "Latitude": "",
  14. "Longitude": "",
  15. "Phone": "",
  16. "Toll Free": "",
  17. "Fax": "",
  18. "Contact 1 Name": "",
  19. "Contact 1 Title": "",
  20. "Contact 1 Email": "",
  21. "Contact 1 Phone Number": "",
  22. "Contact 2 Name": "",
  23. "Contact 2 Title": "",
  24. "Contact 2 Email": "",
  25. "Contact 2 Phone Number": "",
  26. "Contact 3 Name": "",
  27. "Contact 3 Title": "",
  28. "Contact 3 Email": "",
  29. "Contact 3 Phone Number": ""
  30. }, {exp:channel:entries channel="locations" status="open" dynamic="no" limit="20" orderby="date" sort="asc" show_future_entries="no" }
  31. {
  32. "Company": {exp:json_encode}{company}{/exp:json_encode},
  33. "Service Group": {exp:json_encode}{service_group}{/exp:json_encode},
  34. "Location Type": {exp:json_encode}{location_type}{/exp:json_encode},
  35. "Address Line 1": {exp:json_encode}{address_line_1}{/exp:json_encode},
  36. "Address Line 2": {exp:json_encode}{address_line_2}{/exp:json_encode},
  37. "City": {exp:json_encode}{city}{/exp:json_encode},
  38. "State": {exp:json_encode}{state}{/exp:json_encode},
  39. "Zip": {exp:json_encode}{zip}{/exp:json_encode},
  40. "Division": {exp:json_encode}{division}{/exp:json_encode},
  41. "Country": {exp:json_encode}{country}{/exp:json_encode},
  42. "Latitude": {exp:json_encode}{latitude}{/exp:json_encode},
  43. "Longitude": {exp:json_encode}{longitude}{/exp:json_encode},
  44. "Phone": {exp:json_encode}{phone}{/exp:json_encode},
  45. "Toll Free": {exp:json_encode}{toll_free}{/exp:json_encode},
  46. "Fax": {exp:json_encode}{fax}{/exp:json_encode},
  47. "Contact 1 Name": {exp:json_encode}{contact_1_name}{/exp:json_encode},
  48. "Contact 1 Title": {exp:json_encode}{contact_1_title}{/exp:json_encode},
  49. "Contact 1 Email": {exp:json_encode}{contact_1_email}{/exp:json_encode},
  50. "Contact 1 Phone Number": {exp:json_encode}{contact_1_phone_number}{/exp:json_encode},
  51. "Contact 2 Name": {exp:json_encode}{contact_2_name}{/exp:json_encode},
  52. "Contact 2 Title": {exp:json_encode}{contact_2_title}{/exp:json_encode},
  53. "Contact 2 Email": {exp:json_encode}{contact_2_email}{/exp:json_encode},
  54. "Contact 2 Phone Number": {exp:json_encode}{contact_2_phone_number}{/exp:json_encode},
  55. "Contact 3 Name": {exp:json_encode}{contact_3_name}{/exp:json_encode},
  56. "Contact 3 Title": {exp:json_encode}{contact_3_title}{/exp:json_encode},
  57. "Contact 3 Email": {exp:json_encode}{contact_3_email}{/exp:json_encode},
  58. "Contact 3 Phone Number": {exp:json_encode}{contact_3_phone_number}{/exp:json_encode}
  59. }{if count<absolute_results}, {/if}
  60. {/exp:channel:entries}
  61.  
  62. ]

URL: http://devot-ee.com/add-ons/json-encode

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.