Posted on 14/07/2017 10:56:46
Hi Adrian,
Alright, then I think we can expand the code a bit.
var pageService = ServiceLocator.Current.GetPageService();
var paragraphService = ServiceLocator.Current.GetParagraphService();
var page = pageService.GetPage(pageId);
var parentPageId = page.ParentId;
var paragraphs = paragraphService.GetParagraphsByPageId(parentPageId);
foreach(Paragraph paragraph om paragraphs) {
if(paragraph != correct) continue; //need to find a way to filter which paragaphs are needed;
var paragraphId = paragraph.Id;
//make html that needs to be rendered; fx. RenderParagraphContent(paragraphId);
}
In 9.2 this will cause a single DB-call to fetch the paragraphs. In 9.3 the paragraphs will be cached.
I'm unsure what exactly you need to do to filter for the correct paragraphs. Do you have an idea and can it be done via the exposed values on Paragraph?
BR
Martin