How to get current page URL in typoscript OR how to display current URL in typoscript


  
From below typoscript you can display current page URL with Page-ID and language parameter

lib.currentURL=TEXT
lib.currentURL.typolink {
  parameter.data=TSFE:id
  returnLast=url
}

typoscript: build URL from Page-ID and GET Parameters

From below typoscript you can display current page URL with Page-ID and GET Parameters

lib.currentURL = COA
lib.currentURL{
  10 = TEXT
  10{
    data = getenv:HTTP_REFERER
    wrap = URL: |
  }
  wrap = <div id="currentURL">|</div>
}

OR you can use below typoscript also.

lib.currentURL= TEXT
lib.currentURL.data = getIndpEnv:TYPO3_REQUEST_URL

OR
Below script is use for get current url without including of baseurl.

lib.currentURL= TEXT
lib.currentURL.data = TSFE:anchorPrefix

If you have any queries, please do not hesitate to contact me at Jainish Senjaliya