0

I'm using PyroCMS Pro 2.2.6. I created in a PyorCMS Stream a language field which I would like to use in my template to display the language code (en, de, fr, etc.): PyroCMS Language Field

I tried many different tags like:

{{ web_language }}
{{ web_language:name }}
{{ web_language:value }}
{{ web_language:key }}
{{ web_language:code }}

Only the first one worked and displayed the language value (English, Germany, etc.). Which tag can I use to display the language code?

BTW there seems to be missing the label above the radio buttons when you choose PyroCMS Language as field type.

flip
  • 97
  • 3
  • 14
  • That's not possible with this field type. It only displays the actual name of the language, not the code. The "Yes/No" option means "Should we filter by the current theme and what languages they support?" - straight out of the source code in system/cms/modules/streams_core/field_types/pyro_lang/field.pyro_lang.php. Soooo - depending on what you're trying to do, you'll have to look for another way. – mgrueter Oct 12 '15 at 10:01
  • Thanks! The question is then how I can show the right language code in the html tag? – flip Oct 30 '15 at 20:59
  • You can use the constant CURRENT_LANGUAGE (http://docs.pyrocms.com/2.1/manual/developers/tools/constants-and-globals) or the language plugin `{{ lang:code }}`. The latter gives you the language of the currenty logged in user, or the system default if no user is logged in. – mgrueter Nov 02 '15 at 08:29

0 Answers0