<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> 標籤的使用