Siteserver-stl:include包含文件:修订间差异
来自站长百科
(新页面: <span style="text-align:center; border:1px solid #000; float:right; padding:6px;"><strong>导航:</strong> 上一页</span> <div style="clear:both;"></div...) |
无编辑摘要 |
||
第2行: | 第2行: | ||
<div style="clear:both;"></div> | <div style="clear:both;"></div> | ||
'''stl:include 包含文件''' | |||
*在[[模版]]文件中包含另一个文件的内容。通常此元素在处理诸如页头、页脚、版权声明等每个页面相同的内容时使用。被 <stl:include> 元素包含的文件中可以包含其他STL 元素或实体。 | |||
'''属性列表''' | |||
下表显示所有属于此元素的属性列表。 | |||
{| cellSpacing=0 cellPadding=0 border=1 | |||
|- | |||
! 属性 | |||
! width="18%" | 可能的取值 | |||
! width="18%" | 默认值 | |||
! 简介 | |||
|- | |||
| file | |||
| | |||
| | |||
| 需要包含的文件路径 | |||
|- | |||
| isDynamic | |||
| | |||
| | |||
| 是否动态显示 | |||
|- | |||
| bgColor=#ffffcc | | |||
| bgColor=#ffffcc | true | |||
| bgColor=#ffffcc | | |||
| bgColor=#ffffcc | 动态显示 | |||
|- | |||
| bgColor=#ffffcc | | |||
| bgColor=#ffffcc | false | |||
| bgColor=#ffffcc | √ | |||
| bgColor=#ffffcc | 静态显示 | |||
|} | |||
'''注意''' | |||
*stl:include 类似于动态页面中的<%@ include file="header.jsp" %>包含。 | |||
*file是需要包含的文件名,一般以“~”或者“@”开头,代表系统根目录或站点目录下的文件,如file="@/include/head.html",也可以采用file="/include/head.html"。参见 '''STL 地址通配符'''。 | |||
*stl:include 元素能够解析包含文件中的STL 元素或实体。 | |||
'''stl:include 示例''' | |||
<pre> | |||
<p>示例一:在模版中包含页头文件<br /> | |||
下面的例子在模版中包含文件名称为“header.html”的页头文件。 | |||
<textarea id="code" name="code" class="xml"> | |||
<stl: include file="@/include/header.html"></stl: include> | |||
</textarea> | |||
</p> | |||
</pre> | |||
2010年6月3日 (四) 21:08的最新版本
导航: 上一页
stl:include 包含文件
- 在模版文件中包含另一个文件的内容。通常此元素在处理诸如页头、页脚、版权声明等每个页面相同的内容时使用。被 <stl:include> 元素包含的文件中可以包含其他STL 元素或实体。
属性列表
下表显示所有属于此元素的属性列表。
属性 | 可能的取值 | 默认值 | 简介 |
---|---|---|---|
file | 需要包含的文件路径 | ||
isDynamic | 是否动态显示 | ||
true | 动态显示 | ||
false | √ | 静态显示 |
注意
- stl:include 类似于动态页面中的<%@ include file="header.jsp" %>包含。
- file是需要包含的文件名,一般以“~”或者“@”开头,代表系统根目录或站点目录下的文件,如file="@/include/head.html",也可以采用file="/include/head.html"。参见 STL 地址通配符。
- stl:include 元素能够解析包含文件中的STL 元素或实体。
stl:include 示例
<p>示例一:在模版中包含页头文件<br /> 下面的例子在模版中包含文件名称为“header.html”的页头文件。 <textarea id="code" name="code" class="xml"> <stl: include file="@/include/header.html"></stl: include> </textarea> </p>