Copied to clipboard

Flag this post as spam?

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

  • Stephen 94 posts 254 karma points
    Sep 13, 2017 @ 23:46

    Umbraco Grid CSS Issues and Html.Raw problems

    Hi All,

    A couple of questions please.

    1. I have read about this quite a bit, and just want to see if I missed any recent developments. But it would appear that the CSS files you can include in a Grid page (setup in Data Types) are only applied to RTE content, and not to anything else on the grid page.

    I am using the off the shelf macro editor (within the row, in the grid), and the CSS is not applied to that. Is there a new and better way to do this other than applying CSS to the entire backend or doing inline css (which is what I am currently doing, but that's a maintenance nightmare)

    1. As stated above I am using the "off the shelf macro editor (within the row, in the grid)". There has been a little modding so I can also include RTE with the macro (but that's unrelated). The problem I am having is that for example this: "

      some text

      " is rendering as "<p>some text</p>" (displaying as escaped html).

    Before you all shout use Html.Raw, I did. @Html.Raw(Model.MacroParameters["oText"].ToString()) still renders as "<p>some text</p>".

    The code I am using to get round this (and it works) is: var oText = Model.MacroParameters["oText"].ToString(); .... @Html.Raw(HttpUtility.HtmlDecode(oText.ToString()))

    but I suspect I have missed something somewhere and this is overkill, can someone please advise.

    I am also commenting on this because through out all my searches I couldn't find anything Umbraco related about this (the escaped characters), not inside macros anyway.

    I am not going to be surprised if you come back to me saying I have answered my own questions, and that's not a problem. I just want to be sure I am not missing anything.



Please Sign in or register to post replies

Write your reply to: