rsanchez / json

Output ExpressionEngine data in JSON format.
http://devot-ee.com/add-ons/json/
101 stars 234 forks source link

Can't output non-standard EE fields when using entry_id="" paramater #36

Closed wjthomas9 closed 10 years ago

wjthomas9 commented 10 years ago

Example:

{exp:json:entries entry_id="64|63|62"} only seems to output standard EE fields. Specifying custom fields doesn't seem to work. Also, entry_id is output no matter what.

Expanded example:

{exp:json:entries entry_id="64|63|62" fields="title|announcement_body"}

outputs only the title and the entry_id as shown in the following output:

[{"title":"An announcement for Retail Customers in Illinois","entry_id":64},{"title":"An announcement for Retail and Institutional Customers","entry_id":63},{"title":"An announcement for all customers","entry_id":62}]

Is there a way to use the json plugin to grab entries by piped entry_ids and output all fields for the entry?

wjthomas9 commented 10 years ago

Just tried it with also specifying a channel. Is it required to specify a channel in addition to entry_ids?

rsanchez commented 10 years ago

You're right about everything here: 1) you need to specify the channel parameter to get custom fields and 2) the entry_id is the one attribute that is required and cannot be suppressed via the fields parameter.

I'll add this to the documentation, thanks!

wjthomas9 commented 10 years ago

Ok. Ended up figuring that out by trial and error. Makes perfect sense now. Thanks for confirming!

--  Jon Thomas AnalyticL Inc. http://www.analyticl.com

On May 18, 2014 at 1:22:05 PM, Rob Sanchez (notifications@github.com) wrote:

You're right about everything here: 1) you need to specify channel a parameter to get custom fields and 2) the entry_id is the one attribute that is required and cannot be suppressed via the fields parameter.

I'll add this to the documentation, thanks!

— Reply to this email directly or view it on GitHub.