I have created a new CCK field and am trying to show it in a JSON view. It shows in the preview however when I go to the path I created for it the field won't show. I've turned off caching on views and done everything else I can think of but it won't work. When I run the SQL on the DB it does show the column and the entered data, and it shows in places that I"m using it on my site.

One really weird thing is that it shows here:

http://metrotrains.com.au/lines/network_stations.json

but not here:

http://www.metrotrains.com.au/lines/network_stations.json

The field I'm talking about is called "facilitiesparking" under the first node.

Also, it doesn't show under the page where I use views-view-fields--network-lines-page-stations-view.tpl, but does show on the page using node-network_station.tpl.

Comments

dawehner’s picture

Are you sure your template got picked up for the json display? I'm not familiar with the module,
who creates a json output in views, but it could be also be the case, that there is a bug in that module.

From my perspective here, it is hard to continue to help

ojdavey’s picture

No, I just meant that the data in the view isn't showing in those templates.

The main issue I have is that the custom field isn't showing when I output the view, whether it be in a template or in the JSON object. I'm pretty sure this is a bug as it shows in the preview but not on the actual live site. I appreciate your response however as I've had no one reply in any of the places that I've posted about this.

ojdavey’s picture

No, I just meant that the data in the view isn't showing in those templates.

The main issue I have is that the custom field isn't showing when I output the view, whether it be in a template or in the JSON object. I'm pretty sure this is a bug as it shows in the preview but not on the actual live site. I appreciate your response however as I've had no one reply in any of the places that I've posted about this.

dawehner’s picture

Well sure in theory there could be a bug, so can you please describe with more details
what you actually have?

We have a great handbook page for that: http://drupal.org/node/571990

ojdavey’s picture

Ok, there was a view which outputs a bunch of JSON (using this path http://www.metrotrains.com.au/lines/network_stations.json), including some custom fields. I created two new custom fields, entered data for them and added them to the view. In the preview it showed them, however when I went to the path above they do not show. When I run the SQL on the DB I can see the fields and they are available in the node-network_station.tpl template I'm using. However, along with not being in the JSON they are not available in a views template that I'm using views-view-fields--network-lines-page-stations-view.tpl.

One thing I find really strange is that the custom fields (one of them being "facilitiesparking") show when I go the URL without the www (http://metrotrains.com.au/lines/network_stations.json). This doesn't seem like a bug with CCK because I can use the entered data in my node-network_station.tpl template. I hope I've made sense with what my issue is.

dawehner’s picture

Thank you for reading the linked document. It seems to be that you should better file this issue against the module, which provides the json output.

ojdavey’s picture

I don't think the issue is with the JSON output as the custom field's data doesn't show if you try any type of stying, HTML list, table, etc.

Chris Matthews’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

The Drupal 6 branch is no longer supported, please check with the D6LTS project if you need further support. For more information as to why this issue was closed, please see issue #3030347: Plan to clean process issue queue