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
I have a custom AJAX service that returns a list of items by using TypedContentAtRoot and selecting the custom result objects.
This works fine unless there are macros in any of the text fields, in which case I get Cannot render a macro when there is no current PublishedContentRequest
Cannot render a macro when there is no current PublishedContentRequest
I actually don't need the macros to run here, so I'd be happy with a solution that didn't bother running them and just returned the comment markup OR one that actually ran them.
My code is:
UmbracoHelper uhelper = new UmbracoHelper(UmbracoContext.Current);
var res = uhelper
.Where(x => x.DocumentTypeAlias == "Event")
.OrderBy(x => x.GetPropertyValue<MyApp.EventDates>("eventDates").EventDate)
.Select(x => new MyAppEventDetails(x));
The property values are retrieved using e.g.
Description = content.GetPropertyValue<string>("eventDescription");
I see there are overloads GetPropertyValue for recursing, but not for disabling macro expansion.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted