本文档由亿联网维护
模版文件路径引用
<script src="{skins}/js/eycms.js"></script>动态文件引用
{eycms:include("../../eycms_head.asp")}常用标签
| 栏目名称 | {classname} | 栏目关键字 | {seokey} |
| 栏目描述 | {seodesc} | 优化标题 | {seotitle} |
| 栏目ID | {classid} | 栏目所有父ID | {parentid} |
| 分页数量 | {pagenum} | 栏目所有子ID | {sonid} |
| 栏目图片 | {catepic} | 栏目模型ID | {modeid} |
| 栏目最上级栏目ID | {topid} | ||
| 类别名称 | {eycms.getcatename(1)} | 类别的Url | {eycms.getcateurl(1)} |
| 过滤掉html代码,并再次截取前90个数字 | {eycms.cutstr(eycms.nohtml($rs[content]),90,1)} | ||
标题、关键词、描述
<title>{eycms.iif(eycms.strlen(seotitle)>0,seotitle,classname)}{if page>1}_第{page}页{/if}_{eycms[webname]}</title>
<meta name="Keywords" content="{seokey}" />
<meta name="Description" content="{seodesc}" />
<link href="{webroot}lib/css/base.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="{skins}/common/css/common.css">
<script>var webroot="{webroot}";var themeroot="{theme_root}";var webmode="{webmode}";</script>
<script src="{webroot}lib/js/jquery.js"></script>输出分类
{eycms:rs top="0" table="ey_category" where="followid=[rootid]" order="ordnum,cateid" var="cid:cateid"}
{eycms:rp top="0" table="ey_category" where="followid=[cid]" order="ordnum,cateid" var="sid:cateid"}
{eycms:rx top="0" table="ey_category" where="followid=[sid]" order="ordnum,cateid"}
{/eycms:rx}
{/eycms:rp}
{/eycms:rs}<ul class="topcate">
{eycms:rp table="ey_category" top="0" where="followid=[rootid]" order="ordnum,cateid"}
{rp:eof}<li class="hover"><a href="{eyyms.getcateurl(classid)}">{classname}</a></li>{/rp:eof}
<li {eycms.is_current(parentid,$rs[cateid],"class="active"")}><a href="{$rp[link]}" title="{$rp[catename]}">{$rp[catename]}</a></li>
{eycms:rs table="ey_category" top="0" where="followid=[followid]" order="ordnum,cateid"}
<li {eycms.is_current(parentid,$rs[cateid],"class="active"")}><a href="{$rs[link]}" title="{$rs[catename]}">{$rs[catename]}</a></li>
{/eycms:rs}
{/eycms:rp}
</ul>经典案例
查询全部当前分类: where="cateid in ([parentid]) or followid in ([parentid])"
查询当前下级分类: where="followid in ([parentid])"
查询当前分类(除了一级分类):followid in ([parentid]) and depth=2
输出列表
<div id="photolist">
<ul class="photolist">
{eycms:rs table="ey_model_photo" join="left join ey_content on ey_model_photo.cid=ey_content.id" where="classid in([sonid]) and islock=1" order="ontop desc,createdate desc" pagesize="{var pagenum}"}
{rs:eof}<li>没有资料</li>{/rs:eof}
<li>
<a href="{$rs[link]}" title="{$rs[title]}"><img src="{if $rs[ispic]=1}{$rs[pic]}{else}{skins}/common/images/no.gif{/if}" width="130" alt="{$rs[title]}" /></a>
<div><a href="{$rs[link]}" title="{$rs[title]}">{eycms.cutstr($rs[title],10,0)}</a></div>
<p>{eycms.cutstr(eycms.dishtml($rs[intro]),40,1)}</p>
</li>
{/eycms:rs}
</ul>
<!--分页样式-->
{dim total:total=eycms.page.totalurl}
{if total>1}
<div class="pglist">{showpage}</div>
{/if}
</div><!--文章列表开始-->
<div class="cont thumblist1">
<ul class="list clearfix">
{eycms:rs table="ey_model_news" join="left join ey_content on ey_model_news.cid=ey_content.id" where="classid in([sonid]) and islock=1" order="ontop desc,createdate desc" pagesize="{var pagenum}"}
<li class="item clearfix">
{if $rs[ispic]=1}<a class="img fl" href="{$rs[link]}" title="{$rs[title]}"><img src="{$rs[pic]}" alt="{$rs[title]}"></a>{/if}
<a class="{if $rs[ispic]=1}txt{else}txt txt2{/if} fr" href="{$rs[link]}" title="{$rs[title]}">
<h3>{eycms.cutstr($rs[title],82,1)}</h3>
<p class="desc">{eycms.cutstr(eycms.dishtml($rs[intro]),266,1)}</p>
<span><em class="time icon"></em>时间:{eycms.getdate($rs[createdate],"-",1)}</span>
<span><em class="liu icon"></em>浏览:{$rs[hits]}</span></a>
</li>
{/eycms:rs}
</ul>
<!--分页样式-->
{dim total:total=eycms.page.totalurl}
{if total>1}
<div class="pglist">{showpage}</div>
{/if}
</div>
<!--文章列表结束-->查询内容
{eycms:rs top="6" table="ey_content" where="islock=1 and classid in ([eycms.get_sonid(1)])" order="ontop desc,createdate desc" auto="i"}
{/eycms:rs}下面是单页内容输出
{eycms:rs table="ey_model_page" top="1" where="classid=[classid]"}
{eycms.get_content_split($rs[content],htmlrule)}
{/eycms:rs}
{if [get_content_page]<>""}<div class="pglist">{get_content_page}</div>{/if}查询栏目
{eycms:rs table="ey_category" top="0" where="cateid in ([eycms.get_sonid(1)])" order="ordnum,cateid" var="eycms_cateid:cateid"}
{/eycms:rs}或者: where="followid=2"
分页代码
<div class="pglist">{showpage}</div>
分页样式
.pglist {margin-top:20px;margin-bottom:40px;text-align:center!important;font-size:14px;}
.pglist a {border:1px solid #e4eaec;background:#fff;padding:10px 16px;margin: 0 4px;text-align:center;color:#76838f;}
.pglist a:hover {background:#f5f5f5}
.pglist a.NextA {border-right:1px solid #e4eaec}
.pglist .NextSpan,.pglist .PreSpan {border:1px solid #e4eaec;padding:10px 16px;background:#fff;color:#ccd5db;cursor:default}
.pglist .firstPage,.pglist .lastPage {height:28px;line-height:28px;min-width:40px}
.pglist span {border:1px solid #e4eaec;border-right:none;padding:10px 18px;text-align:center;background:#009b4c;border-color:#009b4c;color:#fff;cursor:default}
.pglist a,.pglist a:active,.pglist a:focus,.pglist a:hover {text-decoration:none}
.pglist .PageText {margin-left:10px;color:#aaa;display:none}
.pglist a:last-child{ border-right:1px solid #e4eaec}