英文:
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
- Meta Navigation (Folder)
Else the routing to your pages won't work.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论