Webmaster Scr Posted March 29, 2021 Posted March 29, 2021 (edited) Hi all, I would like to add a link to Google translate in page footer. To do so, I have to set IN as the input page language (2 letters country code) OUT as the output page language (2 letters country code) URL as the URL of the page Google will translate in the link bellow: httрs://translate.google.com/translate?sl=IN&tl=OUT&u=URL Using informations from this page, I tried to add this on line 3: {{if( isset( \IPS\Request::i()->url ) )}} <li><a href='https://translate.google.com/translate?sl=en&tl=ru&u={{ print \IPS\Request::i()->url(); }}'>русский</a></li> {{endif}} But it doesn't work. Can someone please help me? Edited March 29, 2021 by Webmaster Scr
Ryan Ashbrook Posted March 29, 2021 Posted March 29, 2021 You don't need the if statement there, as it will almost never be set (it means it's looking for a "url" parameter in the current URL). This should work: <li><a href='https://translate.google.com/translate?sl=en&tl=ru&u={expression="request.url()"}'>русский</a></li> Meddysong and Webmaster Scr 1 1
Webmaster Scr Posted March 29, 2021 Author Posted March 29, 2021 Nice! It works perfectly. Thanks a lot. Meddysong 1
Recommended Posts