London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!

How to get all pages of a node irrespective of the languages

Vote:
0

Hello,

I want to get all pages under the Solar page in the same order as it is seen in the treeview, if I use GetChildren then either I can get English pages or Norweign pages that I can merge into one list but then the sorting is not the same as seen in the treeview, is there any possibility where I can get all pages using GetChildren or something else regardless of language, or at least is there a possibility of giving multiple lang culture?
 _contentRepository.Service.GetChildren<PageData>(rootPage.ContentLink, ["en","nb-no"]) something like this

#312527
Nov 14, 2023 11:01
Vote:
1

I believe you can use the overload with parameter new LoaderOptions { LanguageLoaderOption.FallbackWithMaster()  (or similar depends on your need), so it will fall back to master language (or a language of your choice) 

#312528
Nov 14, 2023 11:05
Vote:
0

Hi Quan,

I did like this, and it worked

_contentRepository.Service.GetChildren<PageData>(rootPage.ContentLink, LanguageSelector.MasterLanguage())

by the way, I tried as you suggested but for me it was not working or I did not understand how this works, but can you share some sample code?

I am keen to know more about it.

Thanks

#312645
Nov 16, 2023 16:48
Vote:
0

You were using LoaderOption, you should be using LoaderOptions. Note the final s ;)

#312690
Nov 17, 2023 8:22
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.