我通过在我的视图显示中添加自定义php代码字段来使用视图php,因此我可以使用$data
变量。在自定义PHP代码中,我正在渲染已添加了字段集合关系的字段:
<?php
global $user;
$html = array();
if (count($data->field_field_poi_link) > 0) $html[] = 'foobar';
if ($user->uid != 0 && arg(0) == 'node' && node_access('update', 'foobar', $user)) {
$nid = arg(1);
// $html[] = '<a class="inl_edit" href="'.$data->_entity_properties['url'].'/edit?destination=node/'.$nid.'">edit</a>';
// $html[] = '<a class="inl_del" href="'.$data->_entity_properties['url'].'/delete?destination=node/'.$nid.'">delete</a>';
}
print join("\n",$html);
?>
在1月10日实体api更新之前,$data->_entity_properties
数组包含此内容:
'_entity_properties' =>
array (
'url' => 'http://localhost:8888/project/field-collection/field-poi-link/39',
),
但现在,它没有包含这样的内容。我无法编辑那个特定条目。
如何在视图php字段中为每个字段集合输入的字段数据http://localhost:8888/project/field-collection/field-pois/74/edit
创建一个特定值的链接?