wishbone Posted March 15, 2013 Share Posted March 15, 2013 I managed to get the LLU to work, to change the linktext - but I'm lost how to assign the current language the class "current"... <li class="current"><a$class href='$page->url'>$gateway->LangLinkName</a></li> of course, outputs all links with class="current"... Link to comment Share on other sites More sharing options...
Soma Posted March 15, 2013 Share Posted March 15, 2013 I just recently did create a code example to generate a language switch with LanguageLocalizedURL that might be of interest. https://gist.github.com/somatonic/5130992 And linked from in the readme of the module https://github.com/mcmorry/PW-language-localized-URL/blob/master/README.md#language-switch-example 2 Link to comment Share on other sites More sharing options...
wishbone Posted March 16, 2013 Author Share Posted March 16, 2013 ah thx you updated it ? Got it! I actually did use it sry I was not clear. Only I didn't understand the part with the current class - now works! Great thnks, as always! Link to comment Share on other sites More sharing options...
wishbone Posted March 16, 2013 Author Share Posted March 16, 2013 now, I want the headline to be the same on every page (Name of company). No problem using $page->set("field", $value) But how to put the other languages? Link to comment Share on other sites More sharing options...
Soma Posted March 16, 2013 Share Posted March 16, 2013 ah thx you updated it ? Got it! I actually did use it sry I was not clear. Only I didn't understand the part with the current class - now works! Great thnks, as always! Yeah a couple days ago. Glad you got it working. 1 Link to comment Share on other sites More sharing options...
Soma Posted March 16, 2013 Share Posted March 16, 2013 now, I want the headline to be the same on every page (Name of company). No problem using $page->set("field", $value) But how to put the other languages? I'm not sure I understand completely. How is the headline (field?) the company name? This is usuall the alternative title on a page. The languages are set/taken automaticly depending what url you you access the user langauge will be set and if entered it will take that language if it is a language field. If language value is empty it will get default language. Link to comment Share on other sites More sharing options...
wishbone Posted March 16, 2013 Author Share Posted March 16, 2013 I'm not sure I understand completely. How is the headline (field?) the company name? This is usuall the alternative title on a page. sry I wasn't clear. i created a new field, "company", which appears on every page and should have always the same value. Without language fields this would be no problem by setting the company's name as the value $page->set("company", $value). But how to set the value for the other languages? New language problem. I want to link certain global menu items to specific pages like so: <li><a href="<?php echo $pages->get(1051) ?>">Kontakt</a></li> gives me 404 error... url shown is http://localhost/company/tr/1051 Link to comment Share on other sites More sharing options...
Soma Posted March 16, 2013 Share Posted March 16, 2013 Then why do you make it a language field at all? Btw why not just add the field to home and alway get it from there? $pages->get("/")->company 1 Link to comment Share on other sites More sharing options...
wishbone Posted March 16, 2013 Author Share Posted March 16, 2013 It's got different name in different languages... last suggestion works!! now only need a solution for the direct link to a language page as described above... Link to comment Share on other sites More sharing options...
Soma Posted March 16, 2013 Share Posted March 16, 2013 This has nothing to do with languages anyway.. Your code is missing the ..->url at the end. 1 Link to comment Share on other sites More sharing options...
Soma Posted March 16, 2013 Share Posted March 16, 2013 It's got different name in different languages... last suggestion works!! Now Im still confused even more. You say it should always have the same value but still different for each language. My last suggestion works with what? 1 Link to comment Share on other sites More sharing options...
wishbone Posted March 16, 2013 Author Share Posted March 16, 2013 Now Im still confused even more. You say it should always have the same value but still different for each language. My last suggestion works with what? one same value across pages for each language. As "company" is a textLanguage field, I filled in the values on the home page, and your suggestion works... sry ;-))))))) This has nothing to do with languages anyway.. Your code is missing the ..->url at the end. omg ... still a lot to learn... thx for private lessons!!! But after one month, I have now almost everything together for a small site with nice gimmicks. When finished I'll write a short report, maybe encourages other users with little coding expirience to use this smart CMS!!! 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