Jump to content

Detect site language used by a guest


-FP

Recommended Posts

Posted

I'm displaying content in a template depending on the member language.

{{$member = \IPS\Member::loggedIn();}}
{{if $member->language == 2}}
Message A
{{else}}
Message B
{{endif}}

This works for logged in members, but is there a way to determine the language for guests?

Posted

It feels so stupid when I find the solution to my own problem so short after asking... this works for members and guests:

{{if member.language == 2}}
Message A
{{else}}
Message B
{{endif}}

 

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...