-1

我的内容树 n sulu 1.0.13 中有两页。在页面“A”上,我使用内容类型“单个内部链接”的字段设置了对页面“B”的引用。

当我在页面“B”上时,我想获得引用页面“A”。我在控制器中尝试了以下代码:

$dm  = $this->get('sulu_document_manager.document_manager');
$doc = $dm->find('992758cf-1da4-4e45-9ee4-ca9c4ec3998e'); // UUID of page "B"
$di  = $this->get('sulu_document_manager.document_inspector');
$node = $di->getNode($doc);

$refs = $di->getReferrers($doc); // $refs is an empty collection
$refs = $node->getReferences(); // $refs is an empty collection
$refs = $node->getWeakReferences(); // $refs is an empty collection

$refs 始终是一个空集合。

获取引荐页面的正确方法是什么?

更新:我现在使用版本 1.1.0 RC2

4

1 回答 1

3

遗憾的是,SingleInternalLink内容类型目前只是将 UUID 保存为字符串,而不是 PHPCR 中的正确引用。此GitHub 问题中也对此进行了描述。我会重新评估这个问题,看看我们是否可以在不久的将来解决这个问题。

作为一种解决方法,您可以使用InternalLinks已将其值保存为引用的内容类型,尽管可以添加多个链接。

于 2015-11-21T08:46:45.937 回答