Developer forum

Forum » CMS - Standard features » Accessing ParagraphID in Rows

Accessing ParagraphID in Rows

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

I am trying to add an ID to each row and use ParagraphID as value.

However, when I try @Model.Item.ParagraphID I get 0 all over. The same goes for @Model.Item.PageID

Even though they are somewhat different elements, I believe they should expose the ParagraphID.

I have tried creating a link from a link field towards one of the rows (or columns depending on what is listed in the interface) and the link got a value for the link.

I am trying to get that same value as an ID on the Row template in order to create some anchor links on the page

I am using DW 9.8.9 and Rapido 3.4.

Thank you,
Adrian


Replies

 
Nicolai Pedersen
Reply

A row has several paragraphids, one for each column in the row, so that does not make a lot of sense...

But I am not sure I understand what template you are in and what you are trying to achieve...

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

In short, I am trying to create an anchor link to a row using the built-in link control that allows the selection of Page, Paragraph, or File.

If I use the link property (from the HTML editor in this case) I can select something (my guess is a column) a column and the link contains a #{id}. I admit it is a bit confusing since in my case I have one row with one column.

I am now trying to add the ID to the RowBase template. I can also try to add the ID to the Column template as well if the link selection (when using the paragraph option) is selecting a column.

Adrian

 
Nicolai Pedersen
Reply

You can wrap each column in an anchor. And then just link to that. If you have i.e. 3 ancors in the same row, then it will just jump to one of them. And also work on mobile where they might be stacked.

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Nicolai,

Ok. I will try that.

Thank you,

Adrian

 

You must be logged in to post in the forum