0

I am trying to add a link in views header. I enabled multilingual module. Added a Global Textarea in the header. Then added

<a href="/my-tickets">Click</a> 

I want to set the url as

<a href="SELECTED_LANGUAGE_CODE/my-tickets">Click</a>

So the link may be

<a href="en/my-tickets">Click</a>

or

<a href="fr/my-tickets">Click</a>

SELECTED_LANGUAGE_CODE is the language selected in the url.

English version of my site is http://example.com/en French version http://example.com/en

2

You can use the token [site:url] which includes the languages prefix:

<a href="[site:url]/my-tickets">Click</a> 
| improve this answer | |
  • this creates a problem when the url is multiple locations. if they're on a default version of the site, the result would be website.com//my-tickets - the double hashmarks creating a broken link – turpentyne Oct 2 '19 at 0:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.