Developer forum

Forum » CMS - Standard features » Getting paragraph items under a given page in DW9

Getting paragraph items under a given page in DW9

Marie Louise Veigert
Reply

Hi DW,

DW version: 9.2.16

I have a page with multiple paragraph items.

I want to acces those items in a navigation provider.

In DW8 I could get them by first getting all paragraphs on the given page with "Paragraph.GetParagraphsByPageID(pageId)" - then looping through those to get the items but this method doesn't exist in DW9.

How do I accomblish the same in DW9 when I only have the parameters 'PageId' and 'ItemType'?

BR

Marie Louise


Replies

 
Martin Vang
Martin Vang
Reply
This post has been marked as an answer

Hi Marie Louise,

We're using services instead in DW9. For Paragraphs, we're using ParagraphService. Your concrete need would be:

IParagraphService paragraphService = ServiceLocator.Current.GetParagraphService();

IEnumerable<Paragraph> paragraphs = paragraphService.GetParagraphsByPageID(pageId);

 

BR

Martin

Votes for this answer: 1

 

You must be logged in to post in the forum