Show TOC

templateLocate this document in the navigation structure

Use

Indicates the start and end of the layout.

Variables

  • epPageVariables : Enables you to get information about the current client, and whether the layout is being used in design time or runtime.

    The variable has the following two methods:

    • epPageVariables.getRunMode() : Returns either RunMode.RUN_TIME or RunMode.DESIGN_TIME

    • epPageVariables.getUserAgent() : Returns an object of type IUserAgent , which enables you to find out about the client, such as the browser type and version.

      For more information, see User Agent Service .

    The scope of epPageVariables is from the beginning of the template tag to the end of the JSP page.

Example

The following creates a layout with one container that calls the epPageVariables methods to determine whether the layout is displayed at runtime and whether the browser is Internet Explorer, and executes code accordingly.

            <%@ taglib uri="LayoutTagLibrary" prefix="lyt" %>
 
<%@ page import="com.sapportals.portal.useragent.IUserAgent" %>
<%@ page import="com.sapportals.portal.useragent.IUserAgentConstants" %>
<%@ page import="com.sapportals.portal.pb.layout.taglib.variabledef.RunMode" %>
 
<lyt:template>
<%
//Resolve page RunMode
RunMode pageRunMode = epPageVariables.getRunMode();

//Resolve page UserAgent
IUserAgent pageUserAgent = epPageVariables.getUserAgent();
String pageUserAgentType = pageUserAgent.getType();

if(pageRunMode == RunMode.RUN_TIME) {

    ...

}

if(pageUserAgentType.equals(IUserAgentConstants.UA_TYPE_MSIE)) {

    ...

}
%>
    <lyt:container id="the_container_id" />
</lyt:template>