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 } }
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
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
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
is working on a reply...