Copied to clipboard

Flag this post as spam?

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


  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Jun 04, 2015 @ 09:09
    Søren Kottal
    0

    Render content only in backend

    Is it possible to render something, only in the backend?

     

    Like "if (isInBackend) {}" or something like that?

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Jun 04, 2015 @ 09:24
    Søren Kottal
    101

     

    var isInBackend = Request.Url.ToString().Contains("GetPartialViewResultAsHtmlForEditor");

     

    via https://twitter.com/fraabye/status/606359708786675712

     

  • Søren Kottal 712 posts 4570 karma points MVP 6x c-trib
    Jun 04, 2015 @ 09:37
    Søren Kottal
    2

    Or

     Lecoati.LeBlender.Extension.Helper.IsFrontEnd()

     

    Thanks Antoine!

  • Dan Evans 631 posts 1018 karma points
    Jul 08, 2015 @ 09:10
    Dan Evans
    0

    Would this be a sensible way to apply CSS styles to editors? I've found that checking the stylesheets box in the grid datatype does not apply styles to all editors only the RTE. Or is there a better way?

    if(!Lecoati.LeBlender.Extension.Helper.IsFrontEnd()){ }

  • Dan Evans 631 posts 1018 karma points
    Jul 08, 2015 @ 09:42
    Dan Evans
    0

    If I apply CSS to one editor it applies it to all editors used:

     if(!Lecoati.LeBlender.Extension.Helper.IsFrontEnd()){
        <link media="all" rel="stylesheet" href="/css/all.css" />
        <link media="all" rel="stylesheet" href="/css/all_extras.css" />
        }
    

    However it also applies the CSS to the entire back office which is messing up the way it displays. What is the recommended route to apply styles to editors?

Please Sign in or register to post replies

Write your reply to:

Draft