Copied to clipboard

Flag this post as spam?

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


  • David Wouters 6 posts 96 karma points
    Mar 12, 2019 @ 00:33
    David Wouters
    0

    <IEnumerable<Image>> model property not exposed in template

    I have a document type called Project that has various string-valued properties, and a property called ExtraPictures with a Media Picker editor. In templates, the Project model duly exposes all of the string properties, but not ExtraPictures, though it is there in models.generated.cs:

    /// Extra pictures /// [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder", "8.0.1")] [ImplementPropertyType("extraPictures")] public IEnumerable ExtraPictures => this.Value<>>("extraPictures");

    In templates based on Project itself, I can get to the values with .Value("extraPictures"), but when on a parent object with Project children, that fails as well. I am new to Umbraco development, so must be overlooking something very obvious?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies