These are chat archives for luyadev/luya

26th
Sep 2016
MarcosGit
@MarcosGit
Sep 26 2016 12:47
Hi Nadar, I created two language in my web page and my question is can I create one menu item to change language. how i can do that.
Basil
@nadar
Sep 26 2016 12:51
so you can see the pages with both languages in the page content admin? Why not just copy the blocks the other language?
Maybe you can show me a screenshot, so i can understand what you exactly would like to do
MarcosGit
@MarcosGit
Sep 26 2016 13:11
Screenshot from 2016-09-26 12-09-04.png
In my backend i have the two language
and I need in my frontend page one menu item when user can change between this two language
Basil
@nadar
Sep 26 2016 14:17
So you want to change the language in the frontend

You could use the LanguageSwitcherWidget which comes shipped with luya cms module:

https://luya.io/api/cms-widgets-languageswitcher.html

MarcosGit
@MarcosGit
Sep 26 2016 15:47
Ok. so to get the variable "$items" I have to do one query on admin_lang table?
Basil
@nadar
Sep 26 2016 20:46
Well, no you just have to implement the LanguageSwitcher::widget(); in your code, the widget will look for a view files where you can put the content from the docs. I am going to add an extra section in the docs for the language changer if you look.