[
王毅原创,转载注明]
<cms:template> 该标签允许您把一个JSP页面分割成多个元素,以便使用<cms:include>引入。
属性:
Name
element
Description
在将要被<cms:include>标签使用时候使用的名称.
Required
yes
标签体:
模板中的任何 HTML, JSP 或者 JSTL 代码.
示例用法:
<cms:template element="head">
<html>
<body>
This is the template head.<hr>
<!-- Main page body starts here -->
</cms:template>
<cms:template element="foot">
<!-- Main page body ends here -->
<hr>This is the template foot.
</body>
</html>
</cms:template>
=======================================
本标签对应的API调用方法如下代码:
<%@ page session="false" import="org.opencms.jsp.*" %>
<%
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);
%>
<% if (cms.template("head")){ %>
<html>
<head>
<title> <cms:property name="Title" escapeHtml="true"/> </title>
</head>
<body>
This is the template head. <p>
<% } %>
<% if (cms.template("foot")){ %>
<p> This is the template foot.
</body>
</html>
<% } %>
=======================================
2008-05-13 | <cms:template>标签的使用
2008-05-12 | 对 OpenCms 的 <cms:user> 标签的使用补充
2008-04-12 | <cms:param>标签的使用
2008-04-11 | <cms:img>标签的用法举例说明
2008-04-10 | 再谈<cms:contentaccess>标签的使用
2008-04-09 | 浅谈<cms:contentaccess>标签的使用
2008-03-21 | <cms:contentload>标签的使用
2007-12-14 | <cms:editable>标签的使用
2007-12-13 | <cms:contentshow>标签的使用
2007-12-12 | <cms:contentloop> 标签的使用
<cms:template> 该标签允许您把一个JSP页面分割成多个元素,以便使用<cms:include>引入。
属性:
Name
element
Description
在将要被<cms:include>标签使用时候使用的名称.
Required
yes
标签体:
模板中的任何 HTML, JSP 或者 JSTL 代码.
示例用法:
<cms:template element="head">
<html>
<body>
This is the template head.<hr>
<!-- Main page body starts here -->
</cms:template>
<cms:template element="foot">
<!-- Main page body ends here -->
<hr>This is the template foot.
</body>
</html>
</cms:template>
=======================================
本标签对应的API调用方法如下代码:
<%@ page session="false" import="org.opencms.jsp.*" %>
<%
CmsJspActionElement cms = new CmsJspActionElement(pageContext, request, response);
%>
<% if (cms.template("head")){ %>
<html>
<head>
<title> <cms:property name="Title" escapeHtml="true"/> </title>
</head>
<body>
This is the template head. <p>
<% } %>
<% if (cms.template("foot")){ %>
<p> This is the template foot.
</body>
</html>
<% } %>
=======================================
我的相关日志:
2008-05-13 | <cms:template>标签的使用
2008-05-12 | 对 OpenCms 的 <cms:user> 标签的使用补充
2008-04-12 | <cms:param>标签的使用
2008-04-11 | <cms:img>标签的用法举例说明
2008-04-10 | 再谈<cms:contentaccess>标签的使用
2008-04-09 | 浅谈<cms:contentaccess>标签的使用
2008-03-21 | <cms:contentload>标签的使用
2007-12-14 | <cms:editable>标签的使用
2007-12-13 | <cms:contentshow>标签的使用
2007-12-12 | <cms:contentloop> 标签的使用