Developer forum

Forum » CMS - Standard features » Get ParagraphID in Item Publisher list

Get ParagraphID in Item Publisher list

Adrian Ursu
Reply

Hi Guys,

I am using ItemPublisher to list some ItemBased Paragraphs.

I have tried various tricks in order to access the ID of each paragraph listed but it looks I can only access the ItemId of each paragraph and not the ParagraphID.
Can anybody suggest a way to access ParagraphID?

Thanks,

Adrian


Replies

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

No, the paragraph ID is not available in the template. Only option is to (in a razor tempalte) create an instance of the item and find the paragraph id from that... But the is performance heavy.

Why would you need the paragraph id?

 
Adrian Ursu
Reply

Hi Nicolai,

I've already tried this, but the item doesn't seem to have a paragraphId property. This is how I got the instance of the item:

var paragraphItem = Dynamicweb.Content.Items.ItemManager.Storage.GetById("StandardParagraph", itemId);

 
Adrian Ursu
Reply

Hi Nicolai,

I need paragraph ID because I have to create some achor links based on ParagraphID.

If that's not possible, I should try and change that to ItemID but this will mean that I have to create another template for a Generic Paragraph and I tried to avoid having too many templates.

Thanks a lot for your reply. At least it's clear I should not look further for a solution.
Adrian

 

You must be logged in to post in the forum