1

I know I've done this before but I just don't remember the proper syntax. I have a page where the model is EventItem, and EventItem has a list of EventSpeakers and each speaker has an image field. I want to make the images editable in Experience Editor.

@foreach (var person in Model.EventSpeakers){
    <div class="speaker">
        @Editable(??? => x.Speaker_Image)
    </div>
}

If I do @Editable(x => x.Speaker_Image) that doesn't work, because x is an EventItem and not an EventSpeaker. How do I specify that x is person and not the page Model?

1 Answer 1

3

From what I understand, you want to do something like:

@foreach (var person in Model.EventSpeakers)
{
    <div class="speaker">
        @Editable(person, p => p.Speaker_Image)
    </div>
}

You just pass the item as the first parameter to the @Editable

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.