Open bruecksen opened 6 years ago
Hi @bruecksen , This could indeed be nice to have. In theory querying pages from one specific language can be done exactly as you describe it, you could even make it more concise by filtering like this:
pages = TranslatablePage.objects.live().filter(language__code=language).specific().child_of(root_page)
or you could even query on the path.
pages = TranslatablePage.objects.live().filter(language__code=language, path__startswith=root_page.path).specific()
We could make a tips & examples page in the documentation where these kind of little helpers can be defined.
Would you like to make a start with this page?
@Henk-JanVanHasselaar yes lets do it. Will try to do something the next days!
it's not working
Also looking for a simple example on how to do this.
It would be nice to have an example in the documentation on how to query pages for specific languages or the current language. This is something you need to do for example to render the site menu. I did it like this in a function where you have the request context. Maybe there is a better way?