Copied to clipboard

Flag this post as spam?

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


  • Michael Nielsen 82 posts 362 karma points
    Oct 05, 2020 @ 14:03
    Michael Nielsen
    0

    Fallback PublishedValueFallback does not support fallback code '3' at element level

    Hi

    I have a site, where all pages should have an image in the top, and to want to use a fallback value, so the user does not have to set an image on every page.

    I do what is listed in the docs under Fallback https://our.umbraco.com/documentation/getting-started/design/Rendering-Content/#using-fall-back-methods

    var image = Model.Value<IPublishedContent>("image", fallback: Fallback.ToAncestors); 
    

    But I just get this error on all pages that does not have a value set in the property

    Fallback PublishedValueFallback does not support fallback code '3' at element level.
    

    Can anyone else get this to work, or is there a bug with this?

  • Michael Nielsen 82 posts 362 karma points
    Oct 06, 2020 @ 07:53
    Michael Nielsen
    100

    I found the issue

    To be able to use TypedContent in my Partial View, I've set this in the top of the file

    @inherits UmbracoViewPage<IHero>
    

    Where Hero is the alias of the doctype I use as a composition on several other doctypes.

    If I change it to

    @inherits UmbracoViewPage
    

    It works fine

    I don't know if this is a bug, but in any case, I hope the above will help anyone else that might run in to the same issue.

Please Sign in or register to post replies

Write your reply to:

Draft