Developer forum

Forum » Templates » RenderParagraphContent with DW9 ViewModels

RenderParagraphContent with DW9 ViewModels

Heine Virenfeldt Kristensen
Heine Virenfeldt Kristensen
Reply

Starting to use the new ViewModels, and have some Page Templates where @RenderParagraphContent() is use. Is there something simular in the new PageViewModel in DW9?


Replies

 
Nicolai Pedersen
Reply

Hi Heine

No, not yet.

The base class for razor templates follow this structure

  • TemplateBase
    • RazorTemplateBase (Regular templates)
    • ViewModelTemplate (Viewmodels of ViewModelBase type)

There is a lot of the features on the TemplateBase class - but RenderParagraphContent is on RazorTemplateBase and therefore only available for regular razor templates. I will just investigate if that is a mistake or there is a reason that it resides on that type and should be moved.

Until then, you can try to add <!--@Global:Paragraph.Content(123)--> or <!--$$Global:Paragraph.Content()--> directly in the template.

BR Nicolai

 
Nicolai Pedersen
Reply

Hi Heine

Seems like a mistake and now fixed. TFS#31345, available in the next 9.2 hotfix.

BR Nicolai

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Speaking of the View Models: is there any guidance / documentation available? Or maybe a list of model that we can use? Would love to try this out.....

 
Nicolai Pedersen
Reply

Hi Imar

Of course - find the introduction here:
https://doc.dynamicweb.com/template-tags/introduction/concept/viewmodels

You can see the available viewmodels here:
http://doc.dynamicweb.com/api/html/c0c19636-f848-e866-6208-ade44285310b.htm

BR Nicolai

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Thanks Nicolai, completely overlooked those previously.... ;-)

 

You must be logged in to post in the forum