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'm currently running into the following error when trying to access the rich text property of blog posts containing a macro.
Cannot render a macro when there is no current PublishedContentRequest.
After a quick search on the forums I found a post in which a user is having a similar issue-
accessing RTE with Macro Error
After reading the post it seems the best way to fix this is to use the EnsurePublishedContentRequestAttribute - the only problem is I'm not completely sure how to use it and I couldn't find a sample anywhere. If anyone could point me in the right direction that would be great!
Here's a cut down version of my umbraco api controller - I'm running Umbraco 7.3.0
public async Task<IHttpActionResult>GetBlogs()
var response = UmbracoContext.ContentCache.GetById(258).Children
var blogs = response.Select(item => new Blog()
PostBody = item.GetPropertyValue<string>("bodyContent") //throws Cannot render a macro when there is no current PublishedContentRequest.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted