我如何从 tt_news 读出当前 id 并将其作为参数添加到 url
对我的 TYPOSCRIPT 的一个小评论
2 = TMENU
2 {
wrap = <ul class="naviMainLevel2"> | </ul>
NO {
wrapItemAndSub = <li> | </li>
}
ACT = 1
ACT {
wrapItemAndSub = <li class="active"> | </li>
#get current tt_news id add it to the menu
additionalParams.data = GP:tx_ttnews|tt_news
additionalParams.intval = 1
additionalParams.wrap = &tx_events_pi1[newsUid]=|
#returns only &tx_events_pi1[newsUid]=0
#maybe is it possible with RECORDS tt_news.mbl_newsevent, to get the id?
}
CUR = 1
CUR < .ACT
}
url 应如下所示:www.example.com/news/news-tech?&tx_events_pi1[newsUid]=55
更新:
我认为这是扩展 mbl_newsevent 的问题,它仅显示带有注册选项的新闻和带有当前 tt_news id 的按钮...使用此 TS 生成:
plugin.tt_news.mbl_newsevent {
registrationLink_typolink {
title.data = LLL:EXT:mbl_newsevent/locallang.xml:registerLinkLabel
parameter = {$powermail.plugin.pid}
parameter.override.field = tx_mblnewsevent_regurl
additionalParams.field = uid
additionalParams.intval = 1
additionalParams.wrap = &tx_powermail_pi1[eventUid]=|
#this returns the correct tt_news id for the button
}
}
我的网址需要同样的方式....