簡體   English   中英

Typo3 tt_news將參數添加到URL

[英]Typo3 tt_news add Parameter to URL

我怎樣才能從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
}

網址應如下所示: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
        }  
}

我的網址需要相同的方式....

如果我理解正確,您需要以下列方式更正您的代碼:

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
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM