[英]TYPO3: Pass current menu page uid as parameter to userFunc
如何将菜单页面ID传递给自定义用户功能? 我需要它,以便我可以更改一些在TYPO3中无效的页面链接。 它们将在另一个应用程序中解析。
lib.test = HMENU
lib.test {
...
1 = TMENU
1 {
NO = 1
NO {
# do not create a link here else there are double <a> tags
doNotLinkIt = 1
stdWrap.cObject = CASE
stdWrap.cObject {
key.field = doktype
default = TEXT
default {
field = nav_title // title
typolink.parameter.field = uid
typolink.wrap = |<span><strong></strong></span>
typolink.ATagBeforeWrap = 1
stdWrap.htmlSpecialChars = 1
postUserFunc = user_productsOnCurrentPage->main
postUserFunc {
// not working
pageId.data = {page:uid}
pageId.insertData = 1
// also not working
pageId.field = uid
}
}
}
}
...
}
我可以直接在用户功能中访问页面ID:
Typo脚本:
typolink.userFunc = user_mcfazabosOnCurrentPage->main
PHP:
$pageId = $this->cObj->getFieldVal( 'uid' );
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.