Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Tom Engan 430 posts 1173 karma points
    Sep 26, 2017 @ 08:59
    Tom Engan
    0

    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?

  • Craig Mayers 164 posts 508 karma points
    Sep 27, 2017 @ 09:28
    Craig Mayers
    0

    Hi Tom,

    You can probably use Services here...

    https://our.umbraco.org/documentation/reference/management/services/contentservice

    Thanks

    Craig

  • Tom Engan 430 posts 1173 karma points
    Sep 27, 2017 @ 10:25
    Tom Engan
    0

    Ok, so how is Umbraco.AssignedContentItem.GetPropertyValue("hikingDestinationPoints") equivalent to e.g. to property hikingDestinationPoints in my document type (named HikingDestination) ?

Please Sign in or register to post replies

Write your reply to:

Draft