Drupal 8 Headless - 视野中的小组视野

时间:2016-09-10 15:14:16

标签: json rest drupal drupal-views drupal-8

我正在尝试从节点在Drupal 8中创建REST导出。此时JSON响应如下:

[{
"title": "test 2",
"body": "<p>tets<\/p>",
"created": "10-09-2016 15:57",
"field_first_name": "John",
"field_last_name": "Doe"
}, {
"title": "test",
"body": "<p>test<\/p>"
"created": "10-09-2016 15:56",
"field_first_name": "John",
"field_last_name": "Doe"
}]

有两个字段field_first_namefield_last_name,它们是创建节点的用户的字段。我想知道是否可以对这些领域进行分组。所以响应看起来像这样:

[{
"title": "test 2",
"body": "<p>tets<\/p>",
"created": "10-09-2016 15:57",
"user": {
   "field_first_name": "John",
   "field_last_name": "Doe"
}
}]

那么有没有办法按照来自的实体对字段进行分组?

0 个答案:

没有答案