Jump to content

Recommended Posts

Posted

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?

Posted

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.

Posted

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?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...