Closed nate8684 closed 12 years ago
try console.log(data) where you have eventResults(data), and then paste the result from your console here.
[ Object categories: Array[4] entry_id: 544 title: "More than Ordinary" url_title: "more-than-ordinary" proto: Object defineGetter: function defineGetter() { length: 2 name: "defineGetter" proto: function () { defineSetter: function defineSetter() { length: 2 name: "defineSetter" proto: function () { lookupGetter: function lookupGetter() { length: 1 name: "lookupGetter" proto: function () { lookupSetter: function lookupSetter() { length: 1 name: "lookupSetter" proto: function () { constructor: function Object() { create: function create() { defineProperties: function defineProperties() { defineProperty: function defineProperty() { freeze: function freeze() { getOwnPropertyDescriptor: function getOwnPropertyDescriptor() { getOwnPropertyNames: function getOwnPropertyNames() { getPrototypeOf: function getPrototypeOf() { isExtensible: function isExtensible() { isFrozen: function isFrozen() { isSealed: function isSealed() { keys: function keys() { length: 1 name: "Object" preventExtensions: function preventExtensions() { prototype: Object seal: function seal() { proto: function () { hasOwnProperty: function hasOwnProperty() { length: 1 name: "hasOwnProperty" proto: function () { isPrototypeOf: function isPrototypeOf() { length: 1 name: "isPrototypeOf" proto: function () { propertyIsEnumerable: function propertyIsEnumerable() { length: 1 name: "propertyIsEnumerable" proto: function () { toLocaleString: function toLocaleString() { length: 0 name: "toLocaleString" proto: function () { toString: function toString() { length: 0 name: "toString" proto: function () { valueOf: function valueOf() { length: 0 name: "valueOf" proto: function () {
That's just one of the objects expanded. Does that help? Thanks!
OK. Categories is an array, so you actually want to do this:
+data[i]["categories"][0]["category_group"]+
Thanks, that worked perfectly!
I'm trying to pull categories via this JSON extension. I found out how to do so with this: https://github.com/rsanchez/json/issues/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:
Thoughts?