I have a partial view that works just fine via macro, and shows the values when I pick them up as macro outside of RTE. The macro also works just fine on the inside of RTE, except for the values obtained with Umbraco.AssignedContentItem.GetPropertyValue(string alias).
The problem is exactly the same if I use Umbraco.Field(string fieldAlias) instead - partial view is displayed via macro on the outside of the RTE, but not on the inside.
"Cannot return the IPublishedContent because the UmbracoHelper was constructed with an UmbracoContext and the
current request is not a front-end request"
Anybody who knows what's going on here, and how this can be fixed?
Ok, so how is Umbraco.AssignedContentItem.GetPropertyValue("hikingDestinationPoints") equivalent to e.g. to property hikingDestinationPoints in my document type (named HikingDestination) ?
Umbraco.AssignedContentItem.GetPropertyValue(string alias) not working inside RTE
https://our.umbraco.org/documentation/reference/querying/umbracohelper/
I have a partial view that works just fine via macro, and shows the values when I pick them up as macro outside of RTE. The macro also works just fine on the inside of RTE, except for the values obtained with
Umbraco.AssignedContentItem.GetPropertyValue(string alias)
.The problem is exactly the same if I use
Umbraco.Field(string fieldAlias)
instead - partial view is displayed via macro on the outside of the RTE, but not on the inside."Cannot return the IPublishedContent because the UmbracoHelper was constructed with an UmbracoContext and the current request is not a front-end request"
Anybody who knows what's going on here, and how this can be fixed?
Hi Tom,
You can probably use Services here...
https://our.umbraco.org/documentation/reference/management/services/contentservice
Thanks
Craig
Ok, so how is
Umbraco.AssignedContentItem.GetPropertyValue("hikingDestinationPoints")
equivalent to e.g. to property hikingDestinationPoints in my document type (named HikingDestination) ?is working on a reply...