1

If I'm logged in as a user in user Group A, how can I tell which site I am currently viewing?

I want to be able to create a multilingual site switcher. But my setup is complex.

I have Company A, User A is in Group A

Company A Russian, User A is in Group A

Company A Hindi, User A is in Group A

I want to be able to let the user choose the Russian version of the current content. Same for Company B User B in Group B, etc. etc.

1

I built my site switcher like this:

https://www.thebasement.be/language-switcher-for-craft-3/

You will have to define an array for your site variables in the general.php for each environment:

'siteUrl' => array(
  'default' => 'http://yoururl/',
  'english' => 'http://yoururl/en/',
 ),

You can also extend the user with a language field and let him save his preferred language with a simple form like the user profile form from the Craft 3 docs.

|improve this answer|||||

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.