<cms:template>标签的使用

[ 王毅原创,转载注明]

  <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> 标签的使用


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值