Page 2 of 3
Re: Changing languages
Posted: Sun Jul 30, 2017 7:53 am
by filthlab
This one
/<?=$url_lng_prefix?>/category/<!--CATEGORY_NAME-->/
is in content_list. I do not have problem with it, it is working fine.
This one
<li id="lan-cs"><a href="/cs<?=$_SERVER['REQUEST_URI']?>">Čeština</a></li>
is in the header template. With these links I'm changing the language. Try to change the language several times and finally you will have some link like this:
.../sv/pt/no/it/es/cs/...
Re: Changing languages
Posted: Sun Jul 30, 2017 4:05 pm
by admin
You need to get rid of <?=$_SERVER['REQUEST_URI']?> and use the way I described earlier like
/es/<!--CATEGORY_NAME--> and so on
Re: Changing languages
Posted: Mon Jul 31, 2017 12:14 pm
by filthlab
You advise me to do like this. We had a private conversation about this.
My task:
II. Language Pages
1. When you are in a category page or use a search and change the language you should stay in the same category page or search result in selected language. Generally, when you changing the language you should stay where you are, just the language should be changed. Now when you change the language, no matter where you are it redirects to the Homepage.
Your answer:
I guess now you have links like
htt://domain.com/de/
all you have to do is to change in template to
htt://domain.com/de/<?=$SERVER['REQUEST_URL']?>
And it is working fine, except for the problem I described above.
Re: Changing languages
Posted: Fri Aug 04, 2017 3:16 pm
by admin
Yes, I did not foreseen this issue , that's why I recommend to change the way you form urls
Re: Changing languages
Posted: Sat Aug 05, 2017 6:54 am
by filthlab
So, for this:
II. Language Pages
1. When you are in a category page or use a search and change the language you should stay in the same category page or search result in selected language. Generally, when you changing the language you should stay where you are, just the language should be changed. Now when you change the language, no matter where you are it redirects to the Homepage.
We are at starting position.
How do you suggest to form urls that the above condition is met?
Re: Changing languages
Posted: Thu Aug 10, 2017 4:42 pm
by admin
Template of a category page is in the "content_list" and search results are in "content_search", so we can use different urls in different templates, right ?
Re: Changing languages
Posted: Mon Aug 14, 2017 7:24 am
by filthlab
Right, but I'm changing languages in the header template.
Re: Changing languages
Posted: Mon Aug 14, 2017 4:42 pm
by admin
You can use <!--TEMPLATE_NAME-->
if ('<!--TEMPLATE_NAME-->' == 'index') {
....
} elseif ('<!--TEMPLATE_NAME-->' == 'content_list') {
...
}
and so on
Re: Changing languages
Posted: Tue Aug 15, 2017 6:58 am
by filthlab
I'm not sure what do you mean. Can you be more specific.
Re: Changing languages
Posted: Tue Aug 15, 2017 4:50 pm
by admin
You create links in template 'header', right ?