Read Positions in Umbraco Template Programmatically

I am trying to read the value programmatically in an umbraco template

So instead

<umbraco:Item runat="server" Field="url"></umbraco:Item>

I like to write

<%=umbraco.item.Field %>

Or similarly :)

I searched most of the Internet now, but found nothing. Any help is much appreciated!

+3
source share
1 answer

The current page object is not transferred to the main page or .NET macros (before Umbraco 4.6.0, 4.6.0 supports this support).

The only way you can do this is:

<%= umbraco.presentation.nodeFactory.Node.GetCurrent().GetProperty("Field").Value %>
+8
source

Source: https://habr.com/ru/post/1791338/


All Articles