dasBlog的模板引擎(一)-----概念解释
2006-03-29 13:01
197 查看
dasBlog有自己的一套模板引擎,最近研究了它的模版引擎的实现.
先解释一下跟它的模板引擎相关的两个概念。
Theme(主题):就是一套模版,包括所有界面。包括以下几个文件:
template:暂时不知在何处使用(可能在当前版本中并未使用)
hometemplate:首页界面
destopWebsitetmeplate:也是不知在何处使用(可能在当前版本中并未使用)
itemTemplate:单个文章显示模板
dataTemplate:以天为单位的文章列表显示模板
Macros(宏):一个模版页是由多个宏还有一些其它的HTML代码组成的。以下列举了一些宏及其作用
<%BlogStats%>:Blog状态
<%FrontPageTitleList%>:首页文章标题列表
<%PopularList(int numEntiries, int maxLength)%>:最受欢迎文章列表,可传入相应的参数
<%newtelligence.search()%>:搜索框
<%newtelligence.aspnetcontrol("themecombo.ascx")%>:主题转换的ComboBox,可以显示任何一个用户控件
从以上的几个宏,我们可以看到dasBlog的宏功能是很强大的.
以下是一个itemTemplate文件的示例:
<div class="item">
<div class="itemTitle">
<img src="images/array.gif" onclick="{if((document.getElementById('<%ItemGuid%>')).style.display=='none') {(document.getElementById('<%ItemGuid%>')).style.display='block'; this.src='images/array.gif'} else {(document.getElementById('<%ItemGuid%>')).style.display='none'; this.src='images/array_2.gif'}}" />
<%ItemTitle%></div>
<div class="itemContents">
<div class="itemBody" id="<%ItemGuid%>"><%ItemBody%></div>
<div class="categoryLinks"><%categoryLinks%></div>
<div class="itemFooter">
posted on <%when%>
<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?
d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');
void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit',
'scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();"
title="Store it to 365Key">365Key</a>
<%permalink%>
<%editButton%>
<%commentLink%>
<%trackbackLink%><br>
<%RelatedPostList%>
<%trackbackList%>
<%ReferralList%>
<%enclosure%>
</div>
</div>
</div>
先解释一下跟它的模板引擎相关的两个概念。
Theme(主题):就是一套模版,包括所有界面。包括以下几个文件:
template:暂时不知在何处使用(可能在当前版本中并未使用)
hometemplate:首页界面
destopWebsitetmeplate:也是不知在何处使用(可能在当前版本中并未使用)
itemTemplate:单个文章显示模板
dataTemplate:以天为单位的文章列表显示模板
Macros(宏):一个模版页是由多个宏还有一些其它的HTML代码组成的。以下列举了一些宏及其作用
<%BlogStats%>:Blog状态
<%FrontPageTitleList%>:首页文章标题列表
<%PopularList(int numEntiries, int maxLength)%>:最受欢迎文章列表,可传入相应的参数
<%newtelligence.search()%>:搜索框
<%newtelligence.aspnetcontrol("themecombo.ascx")%>:主题转换的ComboBox,可以显示任何一个用户控件
从以上的几个宏,我们可以看到dasBlog的宏功能是很强大的.
以下是一个itemTemplate文件的示例:
<div class="item">
<div class="itemTitle">
<img src="images/array.gif" onclick="{if((document.getElementById('<%ItemGuid%>')).style.display=='none') {(document.getElementById('<%ItemGuid%>')).style.display='block'; this.src='images/array.gif'} else {(document.getElementById('<%ItemGuid%>')).style.display='none'; this.src='images/array_2.gif'}}" />
<%ItemTitle%></div>
<div class="itemContents">
<div class="itemBody" id="<%ItemGuid%>"><%ItemBody%></div>
<div class="categoryLinks"><%categoryLinks%></div>
<div class="itemFooter">
posted on <%when%>
<a href="javascript:d=document;t=d.selection?(d.selection.type!='None'?
d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');
void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit',
'scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();"
title="Store it to 365Key">365Key</a>
<%permalink%>
<%editButton%>
<%commentLink%>
<%trackbackLink%><br>
<%RelatedPostList%>
<%trackbackList%>
<%ReferralList%>
<%enclosure%>
</div>
</div>
</div>
相关文章推荐
- 中国剩余定理概念及模板解释
- Jinja2模板(1) --基本概念,模板引擎,渲染模板
- 关于前段模板引擎
- html模板渲染引擎有什么作用
- tenjin - 号称全球最快的模板引擎
- 自定义模板引擎_3
- CodeSmith Studio中,NetTiers模板中各个选项的一些解释
- 理解模板引擎
- Mustache 模板引擎
- MySQL 黑洞引擎的使用场景解释
- 一个基于 Java 的模板引擎框架Velocity学习总结
- dedecms模板引擎介绍
- 一山容二虎,支持最新版Log4Net 的模板引擎-NVeloCity
- Webpack 3.x 尝试使用Pug(Jade)模板引擎
- 满二叉树、完全二叉树、完美二叉树等概念的解释
- JavaScript模板引擎-artTemplate
- node.js 使用ejs模板引擎时后缀换成.html
- Unreal教学(9)——虚幻引擎名词解释(Unreal Engine 4 Terminology)
- 润乾——调度引擎相关概念
- Java 之 Serializable 序列化和反序列化的概念,作用的通俗易懂的解释