Developer forum

Forum » CMS - Standard features » On a page template - is it possible to get the type of item for the first paragraph (use only item types ) ?

On a page template - is it possible to get the type of item for the first paragraph (use only item types ) ?

Hans Ravnsfjall
Hans Ravnsfjall
Reply

Hi

Is it possible to get the type of the first of itemparagraph in a pagetemplate? (we use only itembased paragraphs)

If so, how can it be done

/Hans


Replies

 
Nicolai Pedersen
Reply

You can do it like this:

string itemType = Dynamicweb.Services.Paragraphs.GetParagraphsByPageId(123)?.FirstOrDefault()?.ItemType;

 

You must be logged in to post in the forum