umbraco razor - getting fields from content

前端 未结 5 2056
生来不讨喜
生来不讨喜 2020-12-10 00:30

I have a 6 items of the same content type \"news\", in each item I have a field newsIntro. I want to put the fields in specific pages on another page so I need to target a s

5条回答
  •  旧巷少年郎
    2020-12-10 00:51

    If the content item 1720 is a parent or ancestor of the page where you want to use the value, you can get it recursively like this:

    @Umbraco.Field("newsIntro", recursive: true)
    

提交回复
热议问题