Copied to clipboard

Flag this post as spam?

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


  • Ben Fidge 16 posts 60 karma points
    Sep 04, 2014 @ 10:10
    Ben Fidge
    1

    How to determine is Partial View Macro is being rendered in RTE or on page

    Hi 

    How do I determine is my Partial View Macro is being rendered inside the RTE or on a live page? I want to offer up slightly different markup when the PVM is dropped inside the RTE in the backend. So, in the MVC partial view itself I'd have something along the lines of:

    @{
    if (this.IsRunningInRte) {
    // display image
    }
    else {
    // display actual content markup
    }
    }

    Ben

     

  • Ben Fidge 16 posts 60 karma points
    Sep 10, 2014 @ 20:47
    Ben Fidge
    2

    OK found it - Testing for UmbracoContext.IsFrontEndUmbracoRequest will determine if your Partial View Macro is being rendered imn RTE in the back-office or as a front end page

Please Sign in or register to post replies

Write your reply to:

Draft