Add Inline C# Function
- Name: PageRequestReason
- Namespace: Composite.Web.Request
-
(click "Finish")
using System;
using Composite.Core.WebClient.Renderings.Page;
namespace Composite.Web.Request
{
public static class InlineMethodFunction
{
public static string PageRequestReason()
{
return PageRenderer.RenderingReason.ToString();
}
}
}
This should give you a new function Composite.Web.Request.PageRequestReason which return one of the following string values, depending on the context of a page rendering: /// Undefined (computer language for "what?? No page is being rendered now, why are you calling me??")
Undefined
/// A page was requested through a browser
PageView
/// A page is viewed from C1 Console's browser
C1ConsoleBrowserPageView
/// A page is reneder from withing an "Edit page" workflow
PreviewUnsavedChanges
/// A page is rendered to generate an image to be used for function/template visualization
ScreenshotGeneration
Hope this helps!