Incorrect display/access RTE values of a Media object
Created a new Media type today with a few Rich Text Editor fields. When attempting to access the values of these RTE fields, it either comes back blank or incorrect.
Here is a trimmed down version of the razor code:
@for (int index = 0; index < flexCtas1.Count(); index++) {
CtaFlex flexCta = flexCtas1[index];
<div>
@(flexCta.CtaTextEnglish)
</div>
}
Here's all the methods that either fail or come short of working correctly:
Direct access:
flexCta.CtaTextEnglish
Returns blank
Property value access (strongly typed): flexCta.GetPropertyValue
Returns blank
Property value access (no type):
flexCta.GetPropertyValue("CtaTextEnglish")
Returns text including html tags but no conversion of internal links, urls, etc. e.g. i see this in the rendered version: href="/{localLink:28717}"
What's the fix here? I have been developing with umbraco for several years and don't remember seeing this particular problem before.
Using Umbraco version 7.4.3 assembly: 1.0.5948.18141
Incorrect display/access RTE values of a Media object
Created a new Media type today with a few Rich Text Editor fields. When attempting to access the values of these RTE fields, it either comes back blank or incorrect.
Here is a trimmed down version of the razor code:
Here's all the methods that either fail or come short of working correctly:
Direct access: flexCta.CtaTextEnglish
Property value access (strongly typed): flexCta.GetPropertyValue
Property value access (no type): flexCta.GetPropertyValue("CtaTextEnglish")
What's the fix here? I have been developing with umbraco for several years and don't remember seeing this particular problem before.
Using Umbraco version 7.4.3 assembly: 1.0.5948.18141
Can I ask a few questions about your example:
What is the
flexCtas1
object in your code snippet above? e.g. is it anIEnumberable<CtaFlex>
?How are you populating this
flexCtas1
object?And is a
CtaFlex
a Models Builder class or a custom class you've written?It might also be useful to see your custom Media object definition (e.g. a screenshot of the media type in Settings)
CtaFlex
is the Media type created in the backoffice (i.e. Models Builder).flexCtas1
is created as follows:The only field that concerns me right now is the one that uses the Rich Text Editor field (
CtaTextEnglish
)is working on a reply...