Search code examples
typo3-6.2.xtx-news

How to create link with article Id in news(tx_news) in typo3?


I have article with uid xyz and pid foobar . How to create a link for the detail page using f:uri.action or f:link.page (or any other uri) outside news extension?


Solution

  • To answer the question to 100%, the links can be built by using

    <f:link.page />

    <f:link.page 
      pageUid="13" 
      additionalParams="{tx_news_pi1: {controller: 'News',action: 'detail', news:newsItem.uid}}">
        {newsItem.title}
    </f:link.page>
    

    <f:uri.page />

    <a 
        href="{f:uri.page(
            pageUid:13,
            additionalParams:'{tx_news_pi1:{controller:\'News\',action:\'detail\',news:newsItem.uid}}')}">
        {newsItem.title}
    </a>