Tell me more ×
Drupal Answers is a question and answer site for Drupal developers and administrators. It's 100% free, no registration required.

I'm trying to use the the views_datasource module and I like it. I'm having one issue though and wondering if you can help. My Article nodes have a field_video which is optional. In the generated JSON, the nodes which do not have a Video should have either an empty field in the JSON or just not have that key-value pair at all. This is the json I'm seeing get generated:

"node" : {
    "title" : "<a href=\"/blog/new-post\">New Post</a>",
    "body" : "<p>Lorem ipsum...</p>\n",
    "field_image" : "http://mysubdomain.rackcdn.com/field/image/C04DD9F4CC2E691B2DFEA107CEDD8F13.jpg",
    "path" : "/blog/new-post",
    "created" : "Sunday, November, 2012",
    "field_video" : "http://drupal.mydomain.com/"
}

The field_video has the value "http://drupal.mydomain.com/" but I would expect it to either be empty "" or null or have the key-value pair not exist at all.

I've configured the Video field in the View so that the "No Results Behavior" is that it should be hidden... but it's not being hidden:

enter image description here

How can I make this field really empty?

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.