如何从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?&amp; 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
}
}
我的网址需要相同的方式....
答案 0 :(得分:2)
如果我理解正确,您需要以下列方式更正您的代码:
2 = TMENU
2 {
wrap = <ul class="naviMainLevel2"> | </ul>
NO {
wrapItemAndSub = <li> | </li>
}
ACT = 1
ACT {
wrapItemAndSub = <li class="active"> | </li>
#parameter.override.field = tt_news_id ||uid
# ^ you don't need this line, becasue you still need
# the current page id in url and it shouldn't be overriden
# by some other param
# next you need to get current tt_news uid from GET
# as you mentioned in your comment
additionalParams.data = GP:tx_ttnews|tt_news
additionalParams.intval = 1
additionalParams.wrap = &tx_events_pi1[newsUid]=|
}
CUR = 1
CUR < .ACT
}