Copied to clipboard

Flag this post as spam?

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


  • Lewis Smith 211 posts 620 karma points c-trib
    Apr 01, 2019 @ 12:50
    Lewis Smith
    0

    Rich Text not displaying with conditional statement.

    Hi,

    Umbraco version 7.13.2 assembly: 1.0.6974.19955

    I have installed this package and cant seem to get the content display with a Condition. I'm not sure where im going wrong, do i need to add some custom code to get this working?

    The conditional statement is: enter image description here

    If i go into the DOM on the frontend the content is there, its just not being triggered when the condition is true.

    I have tried using this condition with another Fieldtype (Title and description type) and it displays as expected...

    Any guidance would be greatly appreciated!

    Lewis

  • Matthew Wise 271 posts 1373 karma points MVP 5x c-trib
    Apr 01, 2019 @ 13:01
    Matthew Wise
    1

    I'll have to take a look, I have a feeling am missing a class somewhere. Hopefully I'll have a new release fixing this soon

    Matt

  • Lewis Smith 211 posts 620 karma points c-trib
    Apr 01, 2019 @ 13:22
    Lewis Smith
    101

    Hi Matthew,

    I found the issue.

    The issue was with the lack of ids on the output content, in teh FieldType.RichText.cshtml i have updated it from

    @Html.Raw(TemplateUtilities.ParseInternalLinks(value, UmbracoContext.Current.UrlProvider))
    

    to

    <div id="@Model.Id">
         @Html.Raw(TemplateUtilities.ParseInternalLinks(value, UmbracoContext.Current.UrlProvider))
    </div>
    

    Wrapping it with the ID solves all, as the JavaScript is looking for this.

    I'm sure there is a nearer way of doing this, but this solves the minor issue for me.

    If you'd like i can create a pull request of this, or please copy and paste this is to fix

    /Lewis

  • Matthew Wise 271 posts 1373 karma points MVP 5x c-trib
    Apr 01, 2019 @ 13:24
    Matthew Wise
    1

    PR would be perfect thanks Lewis!

    I can't think of a cleaner way :)

    Matt

  • 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