uliverse Posted June 12, 2018 Share Posted June 12, 2018 Hi, this seems to be an obvious question asked a million times, but somehow I can't find what I am looking for. I have a site set up with two languages. Now I simply want to link the logo to the home page. The problem is that I only manage to link to the root page (with $config->root->url), which means visitors are always sent to the default language home page, not to their native language home page. How can I change that? Any clues?? Link to comment Share on other sites More sharing options...
tpr Posted June 12, 2018 Share Posted June 12, 2018 You need to target a specific page, in this case the Home: $pages->get(1)->httpUrl This will get the page on the language the user is browsing the site, which is what you need I guess. 2 Link to comment Share on other sites More sharing options...
dragan Posted June 12, 2018 Share Posted June 12, 2018 Did you use the multilanguage site profile when you installed PW? There's a piece of example code you could perhaps adjust and use. https://github.com/processwire/processwire/blob/master/site-languages/templates/_main.php#L65 or... what tpr said, that's probably more what you need Link to comment Share on other sites More sharing options...
uliverse Posted June 12, 2018 Author Share Posted June 12, 2018 53 minutes ago, tpr said: You need to target a specific page, in this case the Home: $pages->get(1)->httpUrl This will get the page on the language the user is browsing the site, which is what you need I guess. Yes!!! That's exactly what I needed. Thank you! I am surprised that this has not been asked before... or I just didn't find it. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now