Creator,
By 'It has currently 6 reusable content type configured' do you mean that you have a Pages and Reusable Content
field type that can select from 6 reusable content types? If so, it should already handle ordering, as long as when you retrieve your primary content item you include the levels enough to grab the remaining items.
The model will return an IEnumerable<IContentItemFieldSource> but as long as you use the GetMappedResults, it will map it to the proper Content Type Classes for you to do type checking on. It will be in order.
var testPage = new ContentItemQueryBuilder().ForContentType(Testing.WebPage.CONTENT_TYPE_NAME, query =>
query.WithLinkedItems(100, o=> o.IncludeWebPageData())
.ForWebsite(_websiteChannelContext.WebsiteChannelName, includeUrlPath: true)
.Where(where => where.WhereEquals(nameof(WebPageFields.WebPageItemID), 7))
.TopN(1)
)
.InLanguage("en");
var mappedToPage = await _contentQueryExecutor.GetMappedWebPageResult<Testing.WebPage>(testPage);
if (mappedToPage.Any()) {
var firstItem = mappedToPage.First();
foreach(var section in firstItem.SectionsSystemSections) {
if(section is Section.TestA testA) {
var testing = testA.SectionTestAName;
} else if(section is Section.TestB testB) {
var testing = testB.SectionTestBName;
} else if(section is Section.Widget widget) {
// If you don't see the WebPageItem values, make sure your .WithLinkedItems has the optional ConfigureOptionsAction (query.WithLinkedItems(100, o=> o.IncludeWebPageData()))
// Partial Widget Page <inlinewidgetpage web-page-id="@webPageID" initialize-document-prior="true"></inlinewidgetpage>
// requires the WebPageItemID
var testing = widget.SystemFields.WebPageItemID;
}
}
}