Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nadine Fisch 22 posts 112 karma points
    5 days ago
    Nadine Fisch
    0

    Need access to properties of a dynamicPublishedContent-Item in my helpermethod

    Hi,

    I loop over a "list" of node-objects in UmbracoTemplatePage. I thought the items are type of "Umbraco.Web.Models.DynamicPublishedContent", because it is the result of the output-variable:

    @item
    

    I need a helper-Method for the object "item" to create a read more-link. I pass the param DynamicPublishedContent.

    @helper GetReadMoreLink(DynamicPublishedContent node) {}
    

    and added the namespace

    @using Umbraco.Web;
    

    But if I call the method I am not able to get the property of the object

    @Helpers.GetReadMoreLink(item);
    

    I got this error

    The type or namespace name 'DynamicPublishedContent' could not be found (are you missing a using directive or an assembly reference?)
    

    My aim is to get the properties of the page-item via the helpermethod. Can you please help me?

  • Alex Skrypnyk 4114 posts 14673 karma points mvp
    5 days ago
    Alex Skrypnyk
    101

    Hi Nadine

    Try to use:

    @helper GetReadMoreLink(dynamic node) {}
    
  • Nadine Fisch 22 posts 112 karma points
    5 days ago
    Nadine Fisch
    0

    Thank you!

  • Alex Skrypnyk 4114 posts 14673 karma points mvp
    5 days ago
    Alex Skrypnyk
    0

    You are welcome, Nadine, have a great weekend!

Please Sign in or register to post replies

Write your reply to:

Draft