Developer forum

Forum » CMS - Standard features » Unable to retrieve ParagraphHeader from item on a paragraph with razor?

Unable to retrieve ParagraphHeader from item on a paragraph with razor?

Mikkel Toustrup Olsen
Reply

Hello,

I stumbled upon a quite annoying issue. When creating x-amount of items on seperate paragraphs under a given placeholder I'm unable to get it by @GetValue("ParagraphHeader") which in my case would be the translation when comparing it to the "regular" DW Templatetags..

I have tried both on a single item and of course in a loop with the multiple values beeing outputted. in that case it would be something like..

@i.GetValue("ParagraphHeader") -> considering "i" to be my object .. A bit unfortunate in my opinion to make an item field for title, when the paragraph name is right there..

Any suggesitons on the matter? 

 


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Yes.

8.4.0.1 will hold a Name parameter in the item publisher list/detail containing the page name or paragraph name.

BR Nicolai

Votes for this answer: 1
 
Peter Leleulya
Reply

I'm using 8.4.0.17 and still can't get the Paragraph Header from an item publisher (list) template.
You mentioned a "Page name" parameter ..
What is the correct way to get it?

I tried:

GetString("ParagraphHeader")
GetString("Name")
GetString("PageName")
GetString("ItemPublisher:Name")
GetString("ItemPublisher:PageName")

 
Mikkel Ricky
Reply

Please see Add "Use field as name" to item type settings for a better way to do this in Dynamicweb 8.4.1.

We have also added the two new tags @ItemPublisher:Item.ParagraphName and @ItemPublisher:Item.PageName in 8.4.1, but the way to do it is to use the new "Use field as name" setting.

Best regards,
Mikkel

 

You must be logged in to post in the forum