-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Page::translatedLanguages(): contains slugs or routes #2163
Comments
Simple fix. |
I'm afraid this isn't working... As far as I can tell, Hence Page::translatedLanguages() returns null for each language, unless a route:default is set in frontmatter. |
@rhukster I'm not sure whether this issue should be closed, but maybe the below behaviour is by design... When looking at the code for
... does not have a parent, and when there is no parent, Considering:
I would therefor, prefer the old behaviour of returning the slug or the default route set in frontmatter. Then the return value will be populated with routes/slugs in the proper language. I then need to do some handling of the return value, but at least in contains the translated values instead of null. |
The documentation for Page::translatedLanguages() states:
However, the function returns an array with a route when the page has a default route defined, else it returns the slug. Which are quite different imho...
For example, let's assume we have the following folder structure:
With the following definition in frontmatter...
Consequence:
When looping through the results of $page->translatedPages() the different "route" types lead to unexpected results.
The text was updated successfully, but these errors were encountered: