Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editable where backing item fieldname is different #460

Open
Joentje71 opened this issue Sep 28, 2023 · 0 comments
Open

Editable where backing item fieldname is different #460

Joentje71 opened this issue Sep 28, 2023 · 0 comments

Comments

@Joentje71
Copy link

Joentje71 commented Sep 28, 2023

Hello,

We have a shared partial view that does @Html.Glass().Editable(x => x.Title).
The Title property on the view's vm gets set from different fields for different Sitecore data templates.
For example, for a news component the Title is set with Title, but for a product component with ProductName.

Because the ID on the partial view's vm points to the correct Sitecore item, Glass can find the item to be edited.
But Glass can -of course- only find the correct field to be edited on the news item, NOT on the product item.

Is there a smart way to make the generic view update data template specific fields?
For example, have a property on the vm with the field name, so that the view can edit x -> x.ReferencedField?
Or is there another way this can / should be accomplished?

Thanks in advance!
Jeroen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant