您的位置:HBcms宏博内容管理系统 模板设计 正文
 添加时间:2007-04-09 原文发表:2007-04-09 人气:823

本文章共2189字,分2页,当前第1页,快速翻页:
 

$web.type 是网站所有的栏目的属性数组,可使用的参数:($data_ary.all_type 变量也是同样的内容)

<{$web.type.栏目ID.id}>
<{$web.type.栏目ID.parent_id}>
<{$web.type.栏目ID.order_mark}>
<{$web.type.栏目ID.channel_id}>
<{$web.type.栏目ID.total_num}>
<{$web.type.栏目ID.num_per_page}>
<{$web.type.栏目ID.title}>
<{$web.type.栏目ID.dir}>
<{$web.type.栏目ID.tpl_index}>
<{$web.type.栏目ID.tpl_list}>
<{$web.type.栏目ID.tpl_detail}>
<{$web.type.栏目ID.tpl_single}>
<{$web.type.栏目ID.desc}>
<{$web.type.栏目ID.keyword}>
<{$web.type.栏目ID.property}>
<{$web.type.栏目ID.url}>
<{$web.type.栏目ID.title_prefix}>

循环$web.type数组,让它自动显示导航条连接的范例:


 <A HREF="/" target=_self>首页</A>
 <{foreach name=all_type item=single_type from=$web.type}>
 &nbsp;|&nbsp;<A HREF="<{$single_type.url}>" target=_self><{$single_type.title}></A> 
 <{/foreach}>

foreach 模板函数的使用方法和详细语法,请参考smarty模板手册

 

首页显示该栏目共多少篇文章:

共<{$web.type[$single_type.id].total_num}>篇文章

列表页码显示文章所属的栏目:

[<A HREF="<{$web.type[$item_info.type_id].url}>"><{$web.type[$item_info.type_id].title}></A>]

显示某栏目的下级栏目:

<{foreach name=sub_type item=item_info from=$web.type}>
<{if $item_info.parent_id == $data_ary.type_info.id}>
·<A HREF="<{$item_info.url}>"><{$item_info.title}></A> <BR>
<{/if}>
<{/foreach}>


 
本页地址

相关文章

最基本的smarty变量:$web模板变量说明和使
模板变量说明,如何制作个性模板
HBcms的Smarty模板结构介绍
模板的导入和导出功能介绍
征集模板:被采纳的模板将包含在HBcms的下一
HBcms的模板语言是自己写的吗?学了有用吗?
smarty官方文档下载
HBcms模板中如何限定标题文字长度
如何理解PHP模板引擎SMARTY
什么是Smaty?
列表页模板变量$data_ary.main_article详解
Smarty中文手册,Smarty教程
如何给首页的每个栏目增加一个图片文章
冰蓝模板如何在首页添加横幅广告
宏博cms模板里如何调用某个栏目(分类)的文
如何让首页显示网友留言/评论留言?
吐血推荐让流量暴涨的代码-把你的文章加入
导航栏自动多行显示
如何修改模板文件?怎样调试模板?
直接在hbcms模板里读取数据库的内容

相关评论


本文章所属分类:首页 模板设计