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

Advertisements

3 thoughts on “How to get current page URL in typoscript OR how to display current URL in typoscript

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s