简体   繁体   English

口述URL(realurl)链接未在extbase扩展中呈现

[英]Speaking url (realurl) links not rendering in extbase extension

I am developing an extbase extension to expose the site menu structure in json format. 我正在开发extbase扩展,以json格式公开站点菜单结构。 PageRepository gives me the relevant page uids and titles so the only remaining challenge is building correct URLs. PageRepository为我提供了相关的页面uid和标题,因此剩下的唯一挑战就是构建正确的URL。 I am using typoLink to do this but instead of getting speaking urls (which are rendered correctly if I browse the site) the output is in the form of index.php?id=[uid]. 我正在使用typoLink来执行此操作,但输出的不是index。url(如果我浏览该网站会正确呈现),而是采用index.php?id = [uid]的形式。 Here is my code: 这是我的代码:

$data = $this->pageRepository->getMenu(1);
$this->cObj = $GLOBALS['TSFE']->cObj;
$retval = array();

foreach ($data as $key => $row)
{
    $pageUid = $row['uid'];
    $conf = array('parameter'=>$pageUid, 'returnLast'=>'url');
    $uri = $this->cObj->typoLink('', $conf);
    array_push($retval, array('title' => $row['title'], 'url' => $uri));
}

Realurl 2.3.2 Realurl 2.3.2

Typo3 8.7.11 错别字8.7.11

Any ideas? 有任何想法吗?

如果使用pageType呈现Extbase JSON响应,是否检查了是否为此页面类型设置了config.tx_realurl_enable = 1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM