Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello.
I have an api controller and need to know is field like this
<umbraco:Item field="innerfielddetail" recursive="true" runat="server" />
is recursive or no.
Now I'm trying to parse template using regex.
Is it possible to know it without regex? Is there any methods in Umbraco?
In an API controller you should be using UmbracoHelper and the GetPropertyValue(propertyAlias, true) the second parameter "true" makes it recursive.
Perhaps you could post some of your code?
Hello, Jeavon.
I don't know is field recirsive or not. I need to know it. How can I define? My regex isn't good, it doesn't work in all cases
template = (new Regex("<umbraco:Item field=\"(?<ID>\\S+)\".*?(recursive=\"(?<recursive>\\S+)\")??.*?/>", RegexOptions.IgnoreCase|RegexOptions.Singleline)) .Replace(template,m =>PageFlowManager.ReplaceItemFieldWithPropertyValue(m,publishedContent));
template - is thу whole page template.
Can you explain why you are parsing the template at all?
We use Umbraco as external service for site. And I need to return code from like this
but the whole template is
<%@ Master Language="C#" MasterPageFile="~/masterpages/MasterPage.master" AutoEventWireup="true" %> <asp:content ContentPlaceHolderId="head" runat="server"> <umbraco:Item field="HeadScriptTitle" recursive="true" runat="server" /> </asp:content> <asp:content ContentPlaceHolderId="PageHeader" runat="server"> <umbraco:Item field="HeadOfPage" recursive="true" runat="server" /> </asp:content> <asp:content ContentPlaceHolderId="phCenter" runat="server"> <umbraco:Item field="PageCenterField" runat="server" /> <umbraco:Item field="innerfielddetail" recursive="true" runat="server" /> </asp:content> <asp:content ContentPlaceHolderId="PageLeft" runat="server"> <umbraco:Item field="PageLeft" recursive="true" runat="server" /> <umbraco:Macro menuIdArray="menuIDs" Alias="MenuRender" runat="server"></umbraco:Macro> </asp:content> <asp:content ContentPlaceHolderId="PageFooter" runat="server"> <umbraco:Item field="PageFooter" recursive="true" runat="server" /> </asp:content> <asp:content ContentPlaceHolderId="phRight" runat="server"> <umbraco:Item field="PageRight" recursive="true" runat="server" /> </asp:content>
I need to replace umbraco:Item with macro (I use the same path in the site) and html-tags. Without umbraco:Item. But I can't write correct regex for "recursive"
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Is field recursive?
Hello.
I have an api controller and need to know is field like this
is recursive or no.
Now I'm trying to parse template using regex.
Is it possible to know it without regex? Is there any methods in Umbraco?
In an API controller you should be using UmbracoHelper and the GetPropertyValue(propertyAlias, true) the second parameter "true" makes it recursive.
Perhaps you could post some of your code?
Hello, Jeavon.
I don't know is field recirsive or not. I need to know it. How can I define? My regex isn't good, it doesn't work in all cases
template - is thу whole page template.
Can you explain why you are parsing the template at all?
We use Umbraco as external service for site. And I need to return code from like this
but the whole template is
I need to replace umbraco:Item with macro (I use the same path in the site) and html-tags. Without umbraco:Item. But I can't write correct regex for "recursive"
is working on a reply...