TYPO3 12:链接到文件夹内的页面无法正常工作。

huangapple go评论46阅读模式
英文:

TYPO3 12: Link to page inside folder doesn't work

问题

我正在开发一个元导航,应该链接到文件夹内的多个页面。目前,我的页面树看起来像这样:

  • 首页

  • 元导航(文件夹)

    • 搜索

    • 登录

然而,当尝试使用以下代码链接到文件夹内的一个页面时:

<f:link.page pageUid="{item.data.uid}">{item.data.title}</f:link.page>

链接未生成。

我尝试将{"item.data.uid}"替换为页面ID,但在前端没有生成任何链接。然而,当我将变量替换为“首页”的页面ID时,该链接在前端中生成。

我猜想我可能缺少一些typoscript配置,允许我链接到文件夹内的页面,但我似乎找不到任何相关信息。

英文:

I'm working on a metanavigation that should link to a number of pages inside a folder. Currently my page tree looks something like this:

  • Home

  • Meta Navigation (Folder)

    • Search

    • Login

However, when trying to link to one of the pages inside the folder using following code;

<f:link.page pageUid="{item.data.uid}">{item.data.title}</f:link.page>

the link isn't generated.

I've tried replacing {"item.data.uid}" with the page id, which also didn't render any link in the frontend. However, when I replaced the variable with the page id of "Home", which isn't inside a folder, the link got rendered in the frontend.

I'm guessing that I'm missing some typoscript config, that allows me to link to pages inside of folders, but I can't seem to find anything.

答案1

得分: 2

如Jan在评论中已经正确提到的,您需要将包含元导航页面的文件夹放在您的根页面内。

  • 主页
    • 元导航(文件夹)
      • 搜索
      • 登录

否则,您的页面路由将无法正常工作。

英文:

As Jan already correctly mentioned in the comments you need to place the folder with your meta navigation pages inside your root-page.

  • Home
    • Meta Navigation (Folder)
      • Search
      • Login

Else the routing to your pages won't work.

huangapple
  • 本文由 发表于 2023年7月17日 17:57:20
  • 转载请务必保留本文链接:https://go.coder-hub.com/76703317.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定