-
Notifications
You must be signed in to change notification settings - Fork 12
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
Umbraco 8.2 Grid Embed fixed #33
Conversation
value = GridControlEmbedValue.Parse(control, token); | ||
value = GridControlEmbedValue.Parse(control, token as JObject); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @ArnoldV,
Thanks again for this PR 👍
From our chat the other day, I understood it as this PR would maintain backwards compatible with 8.1. Should that still be the case?
Casting the token and passing it to the constructor as a JObject
breaks in 8.1, since the value
property is a string, and not an object as in 8.2+. So if we should continue to support 8.1, the token should still be passed on to the constructor as JToken
, and then we can do some type checks inside the constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm make sense I'll add a different kind of check
Updated this PR with Umbraco 8.1 compatibility. in Umbraco pre 8.1 the Jtoken is a JValue I now included a check to see if the type of token is JValue or JObject and gets handled accordingly. |
Hi @ArnoldV, I've now merged your changes, but to minimize the breaking changes, I've made som additional changes:
Thanks for your help on this 😉 |
@abjerner great updates, makes a lot of sense! :) |
This commit fixed the Grid Embed editor that has changed in Umbraco 8.2 (umbraco/Umbraco-CMS#4178)
You can now use the following in your razor to get the iframe rendered:
These where available already:
New: same as in the json of Umbraco for the Embed
@Model.Value.Preview
also since thes following values are now available from Umbraco you can also use: