JSON Encode

Developer

Noble Studios

3rd Party (Free)

734 downloads (last 90 days)

GNU General Public License v3 Download v1.0

EE Version Support

  • ExpressionEngine 2

Compatibility

If an item is crossed out, it might be untested, not applicable or incompatible. Contact the developer to be sure.

Requirements

  • jQuery for the Control Panel

Add-On Type(s)

Plugin

Tags

Provides proper JSON encoding using a template tag.

This plugin encapsulates PHP’s json_encode function.  This is very useful when making JSON feed templates.  Instead of escaping quotes using a text replacement plugin, we can now use the proper json_encode function to get the JSON encoded value of any string.

Let’s say we are making a feed that contains the 10 most recent blog posts.  Our template would look like:


{
	"posts": [
	{exp:channel:entries channel="blog" status="open" dynamic="no" limit="10" orderby="date" sort="desc" show_future_entries="no" }
		{ "title": {exp:json_encode}{title}{/exp:json_encode}, "summary": {exp:json_encode}{summary}{/exp:json_encode}, "page_url": "{page_url}" }{if count<absolute_results}, {/if}
	{/exp:channel:entries}
	]
}

Optionally, one may set the options parameter of json_encode as follows:


{exp:json_encode options="JSON_UNESCAPED_UNICODE"}{title}{/exp:json_encode}

Download JSON Encode

EE Support Downloads Add-On Version Release Date
Not Specified Download 1.0 Feb 6, 2013

JSON Encode Links

This entry was created February 7, 2013, 10:15 am.
This entry was last updated February 7, 2013, 10:17 am.

Disclaimer: Information about ExpressionEngine add-ons is provided as a service to you, the user, and every member of the ExpressionEngine community. devot:ee is not responsible if you hose, mangle, wreck, or otherwise destroy your EE website by installing an add-on that you found out about at this site, regardless of its rating, Favorites status, commercial or free status, or general popularity. Caveat EEmptor!

Returns: devot:ee has a 30-day return policy on all commercial add-ons sold through devot-ee.com. If you need to return an add-on, do not go to the developer or the developer's site, but rather visit our returns page at https://devot-ee.com/returns to initiate your return. If you have questions, email support@devot-ee.com.

7 Reviews:

CarlosRomero 12.11.18

CarlosRomero
Rating - {addon_rating_average}

No longer available

Debasish 04.30.17

Debasish
Rating - {addon_rating_average}

Its a very easy to use and useful add-on, I am using that for years. Can you update this plugin to use in EE3 version too? I can’t find any such plugin in EE3.

leadsuccess 04.27.15

leadsuccess
Rating - {addon_rating_average}

Perfecto! This plugin does exactly what it was designed to do, many thanks!

Sneed's Feed & Seed 03.24.15

Sneed's Feed & Seed
Rating - {addon_rating_average}

Works great. This + HTTP Header makes ajax requests a breeze.

Steven Grant 07.22.14

Steven Grant
Rating - {addon_rating_average}

Did just the job. Wanted to give Solr search a JSON feed of our EE articles. Nailed it!!!

Savannah Christian Church 07.31.13

Savannah Christian Church
Rating - {addon_rating_average}

Works Fantastic, I spent too much time trying to figure out how to get Low_Rplace to remove extra white space - this is so much cleaner for my code.  THANK YOU!

ometiclan 02.10.13

ometiclan
Rating - {addon_rating_average}

Works great. Using it to exchange data cross-domain with other sites wrapping the output as JSONP. :)