Marty Walker Posted June 12, 2012 Posted June 12, 2012 Hi, Small multilingual site for Free To Be Kids in the Democratic Republic of the Congo. http://www.freetobekids-drc.org/ Regards Marty 2
MarcC Posted June 12, 2012 Posted June 12, 2012 Nice job, Marty. Was the multilingual aspect pretty straightforward?
Marty Walker Posted June 12, 2012 Author Posted June 12, 2012 Hi Marc, Thanks. Yes it was. I just took a split tree approach. This thread helped: http://processwire.c..._yaml#entry6537 ...as did this post by Alistair Monk: http://codeordie.pos...processwire-cms For the navigation it gets gnerated depending on what tree I'm in: <?php $homepage = $pages->get("/$lang/"); $children = $homepage->children; $children->prepend($homepage); echo "<ul class='nav'>"; foreach($children as $child) { $class = $page === $child ? " class='current'" : ''; echo "<li$class><a href='{$child->url}'>{$child->title}</a></li>"; } echo "</ul>"; But because the French navigation is longer than the English version I need to style it differently by using: <body id='<?=$lang;?>'> ... then #fr ul.nav { ... } Regards Marty
MarcC Posted June 12, 2012 Posted June 12, 2012 Great techniques! Thanks for explaining. I love the CSS-by-language.
Soma Posted June 12, 2012 Posted June 12, 2012 Marty, great work as always. I noticed that the french pages use english titles in the url. Not sure if it's intended or not, but would be easy and make sense to have speaking urls.
Marty Walker Posted June 12, 2012 Author Posted June 12, 2012 Thanks Philipp. You're right of course. I'll fix that up. Regards Marty
SiNNuT Posted June 12, 2012 Posted June 12, 2012 Nice site. Maybe you could store the visitors language preference in a cookie? Upon revisiting the site it still gives the choice a language page. Maybe a default lang and if and when a visitor choices otherwise store it for next visits.
diogo Posted June 12, 2012 Posted June 12, 2012 Nice! I also like it. Maybe you could store the visitors language preference in a cookie? This is one case where I think it makes sense the way it is now. With this theme, visitors shouldn't be in a hurry, there's no harm in making them click one more time, and have less automation. Also, it's one more opportunity for them to see one of the random images This site illustrates well what I meant here http://processwire.c...__40#entry12539 (Marty, sorry for this deviation)
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