BFD Calendar Posted October 20, 2015 Posted October 20, 2015 I have a submenu to show only students from specific programmes on a general list of students. The submenu works and shows up in English and translates into Dutch when I switch languages. But when I choose a subcategory it only shows the list in English, not when I switch to Dutch. This is the submenu code: $programpage = $pages->get("/students/programmes/"); $children = $programpage->children; foreach($children as $child) { $class = $page === $child || $child->children->has($page) ? " class='on'" : ''; echo "<li><a$class href='{$child->url}'>{$child->title}</a></li>"; }; Here I make the list for the programmes: $features = $pages->find("template=students, stu_programme=$page->title, sort=title"); 'stu_programme' is a page field and the pages all have titles in English and Dutch. URL 'mekano/en/students/programmes/bachelor-of-architecture/' finds the list of Bachelor students, while URL 'mekano/nl/studenten/programmas/bachelor-architectuur/' finds nothing... Where am I going wrong?
tpr Posted October 20, 2015 Posted October 20, 2015 $pages->get in first line: Have you tried with ID instead of page name?
BFD Calendar Posted October 21, 2015 Author Posted October 21, 2015 The menu part works fine, it shows the titles of the programmes in English and Dutch when switching languages. For some reason the "$features = $pages->find("template=students, stu_programme=$page->title, sort=title");" doesn't match the Dutch page title in the URL to the Dutch title of the 'programmes' pages, like it does for English.
tpr Posted October 21, 2015 Posted October 21, 2015 No idea then, but I think it would be better to match pages using their ID, or by name. Are those Dutch pages active, just to make sure?
BFD Calendar Posted October 22, 2015 Author Posted October 22, 2015 I tried to match them by ID but couldn't get that to work at all — probably my inexperience. And yes, all pages are active in both languages.
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