Giter Site home page Giter Site logo

json's Introduction

JSON

Output ExpressionEngine data in JSON format.

Requirements

  • ExpressionEngine 2.6+

For older versions of EE use JSON version 1.0.3.

Installation

  • Copy the /system/expressionengine/third_party/json/ folder to your /system/expressionengine/third_party/ folder

Global Parameters

xhr="yes"

Set xhr to yes to only output data when an XMLHttpRequest is detected. Do not set this to yes if you are using JSONP, as JSONP requests are not true XHMLHttpRequests.

terminate="yes"

Set terminate to yes to terminate the template and output your json immediately, with Content-Type headers.

fields="title|url_title"

Specify which fields you wish to have in the array. Separate multiple fields by a pipe character. If you do not specify fields, you will get all of the default fields' data. The primary key (entry_id for entries, member_id for members) will always be present and cannot be suppressed by this parameter.

content_type="text/javascript"

Set a custom Content-Type header. The default is "application/json", or "application/javascript" if using JSONP. Headers are only sent when terminate is set to "yes".

jsonp="yes"

Set jsonp to yes to enable a JSONP response. You must also specify a valid callback. You are encouraged to set terminate to yes when using JSONP.

callback="yourCallbackFunction"

Set a callback function for your JSONP request. Since query strings do not work out-of-the-box in EE, you may want to consider using a URL segment to specify your callback, ie. callback="{segment_3}", rather than the standard ?callback=foo method.

date_format="U"

Use a different date format. Note: always returns dates as string.

root_node="items"

By default, JSON will output a simple array of items. Use this parameter to make the response into a JSON object whose specified property is the array of items.

Using this parameter will turn this:

[
  {
    "title": "Foo",
    "entry_id": 1
  },
  {
    "title": "Bar",
    "entry_id": 2
  }
]

Into this:

{
  "items": [
    {
      "title": "Foo",
      "entry_id": 1
    },
    {
      "title": "Bar",
      "entry_id": 2
    }
  ]
}

item_root_node="item"

By default, each item in the response array is a simple object. Using this parameter turns each item into a JSON object whose specified property is the item object.

Using this parameter will turn this:

[
  {
    "title": "Foo",
    "entry_id": 1
  },
  {
    "title": "Bar",
    "entry_id": 2
  },
]

Into this:

[
  {
    "item": {
      "title": "Foo",
      "entry_id": 1
    }
  },
  {
    "item": {
        "title": "Bar",
        "entry_id": 2
    }
  }
]

Dates

By default, the date fields are in unix timestamp format, accurate to milliseconds. Use the Javascript Date object in combination with date field data:

for (i in data) {
  var entryDate = new Date(data[i].entry_date);
}

If you require a different output format for the date fields, set the date_format= parameter. This uses the php date() function. common formats include "U" (unix timestamp in seconds), "c" (ISO 8601) or "Y-m-d H:i" (2011-12-24 19:06).

json:entries

{exp:json:entries channel="news"}

json:entries is a single tag, not a tag pair. Use channel:entries parameters to filter your entries.

json:entries Default Fields

title
url_title
entry_id
channel_id
author_id
status
entry_date
edit_date
expiration_date
Plus all of the custom fields associated with that channel

json:entries Parameters

See channel:entries parameters.

show_categories="yes"

This will add categories to the entries response

show_category_group="1|2"

When paired with show_categories="yes", this will display only categories from the specified groups.

json:entries Custom Fields

Most custom fields will just return the raw column data from the exp_channel_data database table. The following fieldtypes will provide custom data. You must specify the channel parameter to get custom fields.

Matrix

The data will include an array of Matrix rows, including the row_id and the column names:

your_matrix_field: [
  {
    row_id: 1,
    my_col_name: "foo",
    other_col_name: "bar"
  },
  {
    row_id: 2,
    my_col_name: "baz",
    other_col_name: "qux"
  }
]
Grid

The data will include an array of Grid rows, including the row_id and the column names:

your_grid_field: [
  {
    row_id: 1,
    my_col_name: "foo",
    other_col_name: "bar"
  },
  {
    row_id: 2,
    my_col_name: "baz",
    other_col_name: "qux"
  }
]
Relationships

The data will include an array of related entry IDs:

your_relationships_field: [1, 2]
Playa

The data will include an array of related entry IDs:

your_playa_field: [1, 2]
Assets
your_assets_field: [
  {
    "file_id": 1,
    "url": "http://yoursite.com/uploads/flower.jpg",
    "subfolder": "",
    "filename": "flower",
    "extension": "jpg",
    "date_modified": 1389459034000,
    "kind": "image",
    "width": "300",
    "height": "300",
    "size": "65 KB",
    "title": null,
    "date": 1389459034000,
    "alt_text": null,
    "caption": null,
    "author": null,
    "desc": null,
    "location": null,
    "manipulations": {
      "medium": "http://yoursite.com/uploads/_medium/flower.jpg",
      "large": "http://yoursite.com/uploads/_large/flower.jpg"
    }
  },
  {
    "file_id": 2,
    "url": "http://yoursite.com/uploads/dog.jpg",
    "subfolder": "",
    "filename": "dog",
    "extension": "jpg",
    "date_modified": 1389466147000,
    "kind": "image",
    "width": "300",
    "height": "300",
    "size": "75 KB",
    "title": null,
    "date": 1389466147000,
    "alt_text": null,
    "caption": null,
    "author": null,
    "desc": null,
    "location": null,
    "manipulations": {
      "medium": "http://yoursite.com/uploads/_medium/dog.jpg",
      "large": "http://yoursite.com/uploads/_large/dog.jpg"
    }
  }
]

NOTE: image manipulation urls are only available to Assets files store locally, not on Amazon S3 or Google Storage.

Channel Files
your_channel_files_field: [
  {
    "file_id": 1,
    "url": "http://yoursite.com/uploads/flower.jpg",
    "filename": "flower.jpg",
    "extension": "jpg",
    "kind": "image\/jpeg",
    "size": "65 KB",
    "title": "flower",
    "date": 1389459034000,
    "author": 1,
    "desc": "Lorem ipsum",
    "primary": true,
    "downloads": 10,
    "custom1": null,
    "custom2": null,
    "custom3": null,
    "custom4": null,
    "custom5": null
  },
  {
    "file_id": 2,
    "url": "http://yoursite.com/uploads/dog.jpg",
    "filename": "dog.jpg",
    "extension": "jpg",
    "kind": "image\/jpeg",
    "size": "75 KB",
    "title": "dog",
    "date": 1389466147000,
    "author": 1,
    "desc": "Lorem ipsum",
    "primary": false,
    "downloads": 0,
    "custom1": null,
    "custom2": null,
    "custom3": null,
    "custom4": null,
    "custom5": null
  }
]
Date

The data will be the Unix timestamp, accurate to milliseconds. This is because the native JavaScript Date object accepts a millisecond-based timestamp in its constructor.

your_date_field: 1385661660000

json:search

{exp:json:search search_id="{segment_3}"}

json:search must be paired with {exp:search:simple_form} or {exp:search:advanced_form}.

json:search Parameters

See channel:entries parameters.

search_id="{segment_3}"

The native search forms will append a search_id automatically to the result_page when you submit a form.

json:search Example

{exp:search:simple_form channel="site" form_id="search" return_page="site/json"}
    <input type="text" name="keywords">
    <input type="submit" value="Submit">
{/exp:search:simple_form}

<script type="text/javascript">
jQuery(document).ready(function($){
  $("#search").submit(function(){
    $.post(
      $(this).attr("action"),
      $(this).serialize(),
      function(data) {
        console.log(data);
      },
      "json"
    );
    return false;
  });
});
</script>

json:members

{exp:json:members member_id="1|2"}

json:members is a single tag, not a tag pair.

json:members Parameters

member_id="1"

Specify which members, by member_id, to output. Separate multiple member_id's with a pipe character. Use member_id="CURRENT_USER" to get member data for just the current user.

username="admin"

Specify which members, by username, to output. Separate multiple usernames with a pipe character.

group_id="1"

Specify which members, by group_id, to output. Separate multiple group_id's

limit="1"

Set a limit for records to retrieve.

Advanced Examples

JSONP

If you're doing cross-domain AJAX, you will probably want to use JSONP.

This is the JSON template:

{exp:json:entries channel="site" jsonp="yes" callback="{segment_3}"}

And the request itself:

$.ajax({
  url: "http://yoursite.com/group/template/yourCallbackFunction",
  dataType: "jsonp",
  jsonp: false
});
function yourCallbackFunction(data) {
  console.log(data);
}

You'll see here that we appended the callback function to the url as a segment, rather than use the traditional ?callback=function syntax. This is because query strings do not work out of the box with EE. If you have gotten query strings to work with EE you can use the traditional approach:

{exp:json:entries channel="site" jsonp="yes" callback="<?php echo $_GET['callback']; ?>"}

The request:

$.ajax({
  url: "http://yoursite.com/group/template",
  dataType: "jsonp",
  jsonpCallback: "yourCallbackFunction"
});
function yourCallbackFunction(data) {
  console.log(data);
}

Changelog

v1.1.8

  • Added json_plugin_entries_end and json_plugin_members_end hooks
  • Improved Wygwam support
  • Fixed intermittent disappearing ee()->TMPL object

v1.1.7

  • Added offset support for members

v1.1.6

  • Add Channel Files support.

v1.1.5

  • Add root_node and item_root_node parameters.

v1.1.4

  • Add manipulations to Assets fields

v1.1.3

  • Fix bug where show_categories parameter did not work

v1.1.2

  • Fix bug where fields parameter was not being honored
  • Fix bug causing fatal MySQL error when using the fixed_order parameter

v1.1.1

  • Fix WSOD on Plugins page
  • Fix PHP errors when an Assests field has no selection(s)

v1.1.0

  • Added support for the following fieldtypes: Assets, Grid, Playa, Relationships
  • Change IDs (entry_id, author_id, etc.) and Dates to integers
  • Added show_categories and show_category_group parameters to {exp:json:entries}
  • Added {exp:json:search}
  • Added JSONP support
  • Added date_format parameter
  • Added content_type parameter

Upgrading from 1.0.x

  • IDs (entry_id, author_id, etc.) and Dates are returned as integers
  • The following fieldtypes have different output: Playa, Assets. Please see docs above for an example of their output.

json's People

Contributors

convexstyle avatar dok avatar domstubbs avatar gdmac avatar gstjohn avatar patrick64 avatar rsanchez avatar sjelfull avatar stewartmckee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

json's Issues

Grids/Relationships support

Hiya Rob.

Any plans for Grid and/or Relationship support?

Love this add-on BTW. IMO JSON should be a native template data type in EE by now.

Support for EE4

Would love some discussion on making this work in EE4.

I've made the modifications in Support for EE3. That resolves installing the plugin as before, but there is a new error being thrown as a result of the database structure changes.

error-message

Pull entries without entry_id

When you try to pull a custom field but don't request the entry_id, the entries_[field_type] handler still requires an entry_id. This breaks the functionality of the JSON plugin.

I don't see a way to attach a patch to this issue, so this is my recommended modification:

if (!in_array('t.entry_id', $select)) {
$select[] = 't.entry_id';
}

Right before "$this->EE->db->select(implode(', ', $select), FALSE)..." (should be around line 102).

Apart from this, great plugin and a headache-saver when dealing with EE tags. Thanks!

Returning channel_short_name

Great little plugin! Is there any way to return the entries channel_short_name variable?

I'm sure it isn't as simple as editing the $default_fields variable on line 124 in pi.json.php.

Orderby and Sort have no effect on results

Orderby and Sort are having no effect on the results shown. All results are returning by entry_id, ascending.

template code:

{exp:json:entries
channel="articles"
orderby="date"
sort="asc"
search:article_type="=The Post Family"}
{/if}

It looks like $this->channel_sql() is returning the correct query for pulling the entries in the correct order, but that query is not used further down in the code. $this->entries, which gets passed into the json parser, only contains all of the entries from the given set of entry_ids it is passed, which are in no specific order.

Include categories in the JSON object

Hi Rob-

Would it be possible to have the tag return a list of categories for each entry as well This would super useful for the site I'm building. Thanks!

-Sandy

change node name

Hello,
I download data from the channel through the code:
{exp: json: entries channel = "about-us" fields = "field89832 | field87842"}
The code is downloaded correctly.
However, I would like to change the names of columns that are generated in the json file.
Or:
[{"entry_id": 1, "field89832": "lorem ipsum", "field87842": "lorem ipsum"}]
On:
[{"entry_id": 1, "title": "lorem ipsum", "content": "lorem ipsum"}]
Change:
field89832 -> title
field87842 -> content
If it is possible?

Categories

Noticed that when you pull the categories it doesn't show them if no entires are tied to them. Is there a way around this? I need it to show all categories even if it is empty.

Emplode

Hi, I created a custom field type uses the text field and explodes the text on new lines, trims, then json_encodes the result so the output looks like:

["test","testing","tester","testy","testtesttest"]

But when I added it into your json plugin it's outputting as:

json_array: "["test","testing","tester","testy","testtesttest"]",

Is there an easy way to have the output not enclosed in quotes?

Here's the custom function I added:

  protected function entries_j_array($entry_id, $field, $field_data)
  {
    $data =  ee()->functions->encode_ee_tags($field_data);
    $my_array = explode("\n", trim($data));

    foreach ($my_array as $k => $v)
    {
        $my_array[$k] = trim($v);
    }
  return json_encode($my_array);
  }

Support for EE3

@rsanchez
Can we get support for this with ExpressionEngine 3 with the new directory/core changes?

Thanks!

Getting data from Playa fields

Is there some way of getting data from Playa fields instead of the entry_id for the related entry?

Thanks in advance.

fields parameter not working

Hi,

When I specify any field e.g:
fields="title|url_title"

...I get no data:
[{"entry_id":1127},{"entry_id":1126},{"entry_id":1125},{"entry_id":1124}...

If I don't specify fields, I get all data as expected. Have I missed something?

I'm using JSON 1.1.1 and EE v2.7.2.

PHP error with matrix field

I'm using jSON 1.0.3 for categories support per this thread: #7.

I'm using a channel with a matrix field. The jSON feed validates, and the errors disappear when you log out of EE, or use a channel without a matrix field.

Template code:

{exp:json:entries channel="songs" show_categories="yes"}

Errors:

A PHP Error was encountered
Severity: Notice
Message: Trying to get property of non-object
Filename: json/pi.json.php
Line Number: 282

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at ....system/codeigniter/system/core/Exceptions.php:170)
Filename: core/Common.php
Line Number: 405

Getting the <p> tags from a Textarea EE field

Hi Everyone,
I'm using this marvelous plug-in to expose something like rest API to be consumed from a Web App.
One thing I've noticed though (and have to say - makes things much complicated). When I have an output from a text area of type rich text from a channel - the plug-in strips out the p tags and leaves only the texts, but adds any other HTML tags like h2, h3, etc.
My question is: how to get the same output from this field as you see it in EE CP when editing an entry and click "view code"
Screenshot 2021-04-14 at 10 55 05

entry_date timestamps are returned as string

Rob,
It took me some time to figure out why dates weren't being parsed by a javascript calendar.
I followed the example from your readme new Date(data[i].entry_date), but, seems that (at least in Google-Chrome) doesn't work somehow if the timestamp in the json object is a string;

// timestamp as string
var data = { entry_date : "1325602858000" }

// returns NaN
var entryDate = new Date( data.entry_date );
entryDate.getTime() 

The long route is to return date type fields as integer
(should an empty expiration_date be 0 ?)
The quick solution is to typecast it in javascript

// works by typecasting to number
var entryDate = new Date( Number(data.entry_date) );
entryDate.getTime() 

What are your thoughts on this?

category=""

Any chance of adding ability to do category="1|2", etc..?

function entries_rel() should be entries_relationship()

Thanks for this add-on.
I'm new to expression engine and am not sure how this used to work, but the is_callable() / call_user_func function for relationships never gets called, because the field type changed from 'rel' to 'relationship'. The relationship id wasn't useful to me in the JSON either, so I have it return the related child ids instead. I rewrote the function:

    protected function entries_relationship($entry_id, $field, $field_data)
    {
        $data = array();

        $query = $this->EE->db->select('child_id')->where('parent_id', $entry_id)->get('relationships');

        foreach($query->result() as $row)
        {
            $data[] = $row;
        }

        return $data;

    }

jsonp callback URL

Hi Rob,
within the json module is there a callback to append to the url call so I can set up a jsonp call in order to make cross domain requests?

Offset doesn't work for members

I have this:

{exp:json:members date_format="Y-m-d H:i" limit="{get:limit}" offset="{get:offset}"}

When I access myUrl?limit=100&offset=500, I get the same as when I do myUrl?limit=100.

Output for Relationship fields

I'm having a hard time understanding what the value of a related field contains. Based on my former EE experience, I would expect a Related field to return the entry_id of the related field. Instead, I'm getting a number that has no relation to the data currently in the database. The number increments with each entry, even though referring to the same item in the entry form.

Could this be a bug? How can I translate the number returned (321, 322 and so on) to something useful?

(PS: Thanks for making this great Plugin!!!)

Returning Custom Fields

I am not understanding how I can pull in custom fields data. As an example I have a ChannelImages field and it simple pulls in ChannelImages for the data. The document says to specify a channel and I believe I am doing that, but if you could point me in the right direction it would be most appreciated.

my code
{exp:json:entries channel="{segment_4}" fields="title|url_title|page_images" limit="10" jsonp="yes" callback="callback"}

Fully resolve file URLs

Thanks so much for this plugin!

I'm trying to work out how to add domains to the (native) file field outputs, but am failing. I can't find where file names are spit out — any advice?

PHP Error using json:members

Hey Rob - I just noticed that the json:members is returning a PHP error.

using a simple tag: {exp:json:members username="grantmx"}

EE version 2.7.1 - Build Date: 20130924


Error Number: 1054

Unknown column 'm.daylight_savings' in 'field list'

SELECT m.member_id, m.group_id, m.username, m.screen_name, m.email, m.signature, m.avatar_filename, m.avatar_width, m.avatar_height, m.photo_filename, m.photo_width, m.photo_height, m.url, m.location, m.occupation, m.interests, m.bio, m.join_date, m.last_visit, m.last_activity, m.last_entry_date, m.last_comment_date, m.last_forum_post_date, m.total_entries, m.total_comments, m.total_forum_topics, m.total_forum_posts, m.language, m.timezone, m.daylight_savings, m.bday_d, m.bday_m, m.bday_y, d.m_field_id_1 AS chatroll, d.m_field_id_2 AS free_chat, d.m_field_id_3 AS campus_type FROM (exp_members m) JOIN exp_member_data d ON m.member_id = d.member_id WHERE m.member_id IN ('1')

Filename: third_party/json/pi.json.php

Line Number: 419


Categories

I'm trying to pull categories via this JSON extension. I found out how to do so with this: #7. When I pull the source to my page I can see that it is fetching the categories, but my code isn't pulling them to my external source. For instance, the code below will fetch everything but category_group, and I assue you that isn't empty. Take a look below:

Template Code:
{exp:json:entries channel="gathering" show_categories="yes" fields="title|url_title" }

Template Output:
http://www.lcbcchurch.com/mobileJSON/gatherings

External Code trying to pull the JSON:

    $('.loading-wrapper').append('<div class="loading">Your page is loading…</div>');

    $.ajax({        
            url: "http://www.lcbcchurch.com/mobileJSON/gatherings",
            dataType: "json",
            success:function(data){
                eventResults(data);
            }
            });

        function eventResults(data) {
            for(var i = 0; i<data.length;i++){
                    $(".gathering").append("<a href='#"+data[i]["url_title"]+"' class='campus' rel='external'><h1>"+data[i]["title"]+"</h1>"+data[i]["category_group"]+"");

            }
            $('.loading-wrapper').empty();
            // Call the pics ready function

            }

Thoughts?

Filtering Channel Field entries before sending them as JSON

Is there some way to filter the entries based on the values in the custom channel fileds before sending them as JSON response?

Here is what I need:

//Include only the Events that have event_start_date >= start && event_end_date <= end
{exp:json:entries channel="events" xhr="yes" terminate="yes" fields="title|url_title|event_start_date|event_end_date|event_introtext|event_image"}

Base64 data

Thanks for the superb add-on. This is not an issue, but a request:

Sometimes I need to store arbitrary Base64 data in a field. Would it be possible to pass an additional unserialize parameter to rebuild arrays from fields of such type?

In a perfect world, something like:

{exp:json:entries channel="registry" unserialize_fields="field1 | field2"}

or even better:

{exp:json:entries channel="registry" unserialize_fields="matrix:field1 | matrix:field2"}

Combining fields

Is it possible to concat fields?
e.g. i need to create a field called full_url and build it from url_title, channel_name and entry_id.

custom entries are cutting out

I have a call
{exp:json:entries fields="title|custom_1|custom_2" channel="prod" dynamic="no"}

And I get as a result
[{"title":"foo","custom_1":"[10] [pr","custom_2":"[6] [spe"}]

It seems that custom fields are being shortened unintentionally. Do you know what the issue may be?

Category Info

Hi Rob,

Could you add category info of an entry in the jSON output.

Installing JSON, plugins CP page returns blank - New

I am getting the same blank "Plugin" screen issue when installing "JSON 1.1.6" to EE 2.7.3. I tried setting $debug 1 in the admin.php and don't get any trace either.

Oddly enough, the JSON plugin installed just fine on my "dev" instance. It's my "production" instance crashing. Best I can tell, the paths and options are exactly the same in both instances.

Any help appreciated. It's important that I get this working soon.

Return all fields from multiple channels?

This plugin is working great for single channels, but I need to return results from multiple channels at once, and if I omit channel="xxx" I get the correct results but with only the standard fields (title, status, etc).
Is it possible to return ALL custom fields when searching multiple channels? As far as I can see there are no parameters for this?
Thanks

display_by="week" Support?

Hey Rob - I'm getting this PHP error when I add the display_by="week" parameter.

Error Number: 1054

Unknown column 'yearweek' in 'order clause'

SELECT t.title, t.url_title, t.entry_id, t.channel_id, t.author_id, t.status, t.entry_date, t.edit_date, t.expiration_date, wd.field_id_1 AS related_ministry, wd.field_id_2 AS event_time, wd.field_id_17 AS links, wd.field_id_13 AS event_desc, wd.field_id_14 AS event_location FROM (exp_channel_titles t) JOIN exp_channel_data wd ON t.entry_id = wd.entry_id WHERE t.entry_id IN ('19') ORDER BY yearweek ASC, t.sticky desc, t.entry_date asc, t.entry_id asc

Filename: third_party/json/pi.json.php

Line Number: 135

Is this supported? Thanks!

JSON Queries

Tried using your method here of pulling JSON data from your plugin on EE. In the console this is what always shows up:

GET http://www.lcbcchurch.com/mobileJSON/homeslideshow/results?_=1329339833378 404 (Not Found) f.ajaxTransport.sendjquery.js:4 f.extend.ajaxjquery.js:4 (anonymous function)

I think i'm following your directions accurately but things don't seem to be working. Any thought? Here is my ee code:

{exp:json:entries channel="slideshow" jsonp="yes" callback="{segment_3}" content_type="application/javascript"}

and my html/js:

<!DOCTYPE html>
<html>
    <head>
        <title>PhoneGap Ajax Sample</title>
        <script type="text/javascript" src="phonegap.js"></script>
        <script type="text/javascript" src="js/jquery.js"></script>
        <script type="text/javascript">
            $.ajax({
                       url: "http://www.lcbcchurch.com/mobileJSON/homeslideshow/results",
                       dataType: "jsonp",
                       jsonp: false
                       });
                function results(data) {
                    console.log(data);
                }

            </script>


    </head>
    <body>
        <div id="main">

        </div>
    </body>
</html>

Also, if you go directly to "http://www.lcbcchurch.com/mobileJSON/homeslideshow/results" I can see the output.

EE 3

Does this or will this plug-in work with EE 3?

Thank you

Support for EE5

Getting Error

Exception Caught
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'exp_channel_fields.group_id' in 'on clause':
SELECT exp_channel_fields.*, exp_channels.channel_id FROM (exp_channel_fields) JOIN exp_channels ON exp_channel_fields.group_id = exp_channels.field_group WHERE exp_channels.site_id = 1 AND exp_channels.channel_name IN ('missions')
ee/legacy/database/drivers/mysqli/mysqli_connection.php:117

Stack Trace: Please include when reporting this error
#0 admin\ee\legacy\database\drivers\mysqli\mysqli_driver.php(112): CI_DB_mysqli_connection->query('SELECT exp_cha...') #1 admin\ee\legacy\database\DB_driver.php(270): CI_DB_mysqli_driver->_execute('SELECT exp_cha...')
#2 admin\ee\legacy\database\DB_driver.php(180): CI_DB_driver->simple_query('SELECT exp_cha...') #3 admin\ee\legacy\database\DB_active_rec.php(1138): CI_DB_driver->query('SELECT exp_cha...')
#4 admin\user\addons\json\pi.json.php(122): CI_DB_active_record->get()
#5 admin\ee\legacy\libraries\Template.php(1847): Json->entries()
#6 admin\ee\legacy\libraries\Template.php(1482): EE_Template->process_tags()
#7 admin\ee\legacy\libraries\Template.php(578): EE_Template->tags()
#8 admin\ee\legacy\libraries\Template.php(234): EE_Template->parse('{!-- ra:0000000...', false, 1, false)
#9 admin\ee\legacy\libraries\Template.php(165): EE_Template->fetch_and_parse('', Array, false)
#10 admin\ee\legacy\libraries\Core.php(661): EE_Template->run_template_engine('', '')
#11 admin\ee\legacy\controllers\ee.php(63): EE_Core->generate_page()
#12 [internal function]: EE->index()
#13 admin\ee\EllisLab\ExpressionEngine\Core\Core.php(241): call_user_func_array(Array, Array)
#14 admin\ee\EllisLab\ExpressionEngine\Core\Core.php(110): EllisLab\ExpressionEngine\Core\Core->runController(Array)
#15 admin\ee\EllisLab\ExpressionEngine\Boot\boot.php(151): EllisLab\ExpressionEngine\Core\Core->run(Object(EllisLab\ExpressionEngine\Core\Request))
#16 index.php(173): require_once('D:\www\wamp64\w...')
#16 index.php(173): require_once('D:\www\wamp64\w...')

Output limited to 100 channel entries?

Is there a way to overwrite this? I know that you can set limit="5000" or any number other the the 100 default limit in a standard entries query, but it doesn't work with this plugin.

show_categories not working

Adding show_categories="yes" to my exp:json:entries tag didn't work. I dug into the code and found out that this conditional around line 235 never was true:

if (ee()->TMPL->fetch_param('show_categories') === 'yes')

It works in the fist case, around line 190, but after that it's just empty. I solved this by storing the value of the fetch_param in a variable and using that in the conditionals instead.

Using EE 2.7.3 and JSON 1.1.2.

Blank Plugins page

I have been running JSON 1.0.2 on EE 2.6.1 with no issues. In preparing to upgrade EE to 2.9.3, I first installed JSON 1.1.6. After installing this, the control panel Plugins page is now blank. I rolled back to 1.0.2 and the Plugins page loads fine. I also had an older copy of JSON 1.1.2 that I installed, and the Plugins page still loads. I'm having the problem only with 1.1.6.

EE 2.6.1
PHP 5.3.19 (JSON support enabled)
MySQL 5.0.8

Any thoughts?

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

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.