Developer forum

Forum » Development » Get Items by Page ID

Get Items by Page ID

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

Is there an easy way to get all Items of a specific type based on the PageID?

I need to get all items of some paragraphs that are set on a page. Something like GetItemsByPageID(int PageId, string ItemSystemName).

Or some other way to get all ItemTypes of a specific SystemName froma specific AreaID. Something like GetItemsByArea(int AreaID, string ItemSystemName).

Any atlernative way of accomplishing my goal is also welcome.

Thank you,

Adrian 


Replies

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

One more thing.

Is it possible, in a CodeFirst Item, to access the AreaID that an item is created into?

Thank you,
Adrian

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Take a look t at the Item and Page services in the API:
https://doc.dynamicweb.com/api/html/ba49d025-e7d2-82f3-e467-2e784ec77d0b.htm

Votes for this answer: 1
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thank you Nicolai but the link does not go anywhere. And both Item and Page services are pretty complex.

GetItemByPageID gets me the Item of a Page and I could not find a way to get all the Paragraphs of a specific ItemType set on a Page.

Thank you,

Adrian

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Adrian

Maybe you need a combo of page and paragraph service:

https://doc.dynamicweb.com/api/html/b501b3ba-a0e1-7432-689b-9dc910891f0d.htm

Paragraph service can give you all paragraphs on a page or all paragraphs of a specific type. Then use LINQ or something to filter what you need.

NP

Votes for this answer: 1
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

That's exactly what I needed.

Thank you very much.
Adrian

 

You must be logged in to post in the forum