模板防盗:<%if not in_sdcms then response.write("template load fail"):response.end() end if%>

--------------
seo标题:
{sdcms[webname]}{sdcms[seotitle]}
seo关键词:
{seokey}
seo描述:
{seodesc}
--------------

文件路径例如:images路径:{webroot}theme/default/images/

--------------
模板引用:
{sdcms:include("sdcms_head.asp")}
{sdcms:include("sdcms_foot.asp")}
--------------
获取单个栏目:
{sdcms.getcateurl(1)} 获得栏目1的链接
{sdcms.getcatename(1)} 栏目名称

--------------

1.首页调用单页简介的方法为:

{sdcms:rs table="sd_model_page" where="classid=1"}
{sdcms.dehtml($rs[intro])}
{/sdcms:rs}

2.首页调用单页内容的方法为:

{sdcms:rs table="sd_model_page" where="classid=1"}
{$rs[content]}
{/sdcms:rs}

--------------

调用几条内容
{sdcms:rs table="sd_content" top="4" where="classid=1" auto="j"}  条件 islock=1只显示没删除的 
<li><a href="{$rs[link]}"><img src="{$rs[pic]}">{$rs[title]}</a></li>
{/sdcms:rs}
classid=1 栏目id,top="4"调用4条
数据表sd_content其他字段:id、pic、createdate、lastupdate、style、ispic、tags、keyword、description、intro(详情)
调用详情前70个字符(过滤html){sdcms.cutstr(sdcms.nohtml($rs[intro]),70,1)}

时间格式
{sdcms.getdate($rs[createdate],"-",1)}

调取自定义字段的方法:

{sdcms:rs table="sd_content" top="20" where="classid=12" var="sdcms_dim:id" auto="j"}  //var="sdcms_dim:id"定义一个值,作为传给下个循环的条件

   {sdcms:rp table="sd_model_news" top="20" where="cid=[sdcms_dim]"} //sd_model_news 不同模型表不一样

    {$rp[新增的字段]}

  {/sdcms:rp}

{/sdcms:rs}

--------------

调用几个栏目
{sdcms:rs table="sd_category" top="10" where="ismenu=1" order="ordnum"}
<li><a href="{$rs[link]}">{$rs[catename]}</a></li>
{/sdcms:rs}

多级栏目:

{sdcms:rp table="sd_category" top="0" where="followid=[classid] and modeid>0" order="ordnum,cateid" var="sdcms_dim:sonid" auto="j"}
<div class="b{if j>1} mt10{/if} w670">
<div class="subject"><span><a href="{$rp[link]}">更多>></a></span>{$rp[catename]}</div>
<div class="p10">
<ul class="toplist">
{sdcms:rs top="10" field="id,title,style,createdate,isurl,url,classid" table="sd_content" where="islock=1 and classid in([sdcms_dim])" order="ontop desc,id desc"}
<li><span>{sdcms.getdate($rs[createdate],"-",1)}</span><a href="{$rs[link]}" title="{$rs[title]}"{if $rs[isurl]=1} target="_blank"{/if} {$rs[style]}>{sdcms.cutstr($rs[title],70,1)}</a></li>
{/sdcms:rs}
</ul>
</div>
</div>
{/sdcms:rp}

 

头部栏目nav模板:

{sdcms:rs top="0" table="sd_category" where="followid=0 and ismenu=1" order="ordnum desc,cateid" var="sdcms_rp:cateid"}
<li><a href="{$rs[link]}">{$rs[catename]}</a>
<dl>
{sdcms:rp top="0" table="sd_category" where="followid=[sdcms_rp] and ismenu=1" order="ordnum,cateid"}
<dd><a href="{$rp[link]}">{$rp[catename]}</a></dd>
{/sdcms:rp}
</dl>
</li>
{/sdcms:rs}

------------------------

判断是否有子栏目

{sdcms:rs table="sd_category" top="0" where="followid=[classid] and ismenu=1" order="ordnum desc"}

{rs:eof}
{sdcms:rp table="sd_category" top="0" where="followid=[followid] and ismenu=1" order="ordnum desc"}

<li><a href="{$rp[link]}">{$rp[catename]}</a></li>
{/sdcms:rp}
{/rs:eof}

<li><a href="{$rs[link]}">{$rs[catename]}</a></li>
{/sdcms:rs}

栏目高亮判断条件:{if $rs[cateid]=[classid] or $rs[cateid]=[followid]} class="cur"{/if}

--------------
友情链接
{sdcms:rs top="0" table="sd_expand_link" where="islock=1" order="id desc"}
<a href="{$rs[weburl]}" target="_blank">{$rs[webname]}</a>
{/sdcms:rs}
参数:islogo=0

--------------

if判断格式
{if i mod 5=0}<li class="mid"></li>{/if}

--------------

前栏目名字
您所在的位置:<a href="{webroot}">首页</a>{sdcms.getpostion(parentid," > ")}

--------------

单篇调用内容 方法

{sdcms:rs table="sd_model_page" top="1" where="classid=[classid]"}
{sdcms.get_content_split($rs[content],htmlrule)}
{/sdcms:rs}

详情页 专用

{title} 标题
作者:{author} 来源:{comefrom} 日期:{createdate}
{content} 内容

<div class="pre">上一篇:{sdcms:rs top="1" field="id,isurl,url,title,style,classid" table="sd_content" where="islock=1 and classid=[classid] and id<[id] and isurl=0" order="id desc"}
{rs:eof}<span class="c9">没有资料</span>{/rs:eof}
<a href="{$rs[link]}" title="{$rs[title]}">{sdcms.cutstr($rs[title],70,1)}</a>
{/sdcms:rs}</div>

<div class="next">下一篇:{sdcms:rs top="1" field="id,isurl,url,title,style,classid" table="sd_content" where="islock=1 and classid=[classid] and id>[id] and isurl=0"}
{rs:eof}<span class="c9">没有资料</span>{/rs:eof}
<a href="{$rs[link]}" title="{$rs[title]}">{sdcms.cutstr($rs[title],70,1)}</a>
{/sdcms:rs}</div>

==============================
================标签详解======
==============================

{classname} 当前栏目名字
{classid} 当前栏目id(单页模型)
{cateid} 当前栏目id(其他模型)
{followid} 当前内容所属栏目的父栏目ID
{sonid} 当前内容所属栏目的所有子类
{parentid} 当前内容所属栏目的所有父类
{catepic} 当前内容所属栏目的图片Url
{id} 当前内容的ID
{title} 当前内容的标题
{seokey} 当前内容的Seo关键字
{seodesc} 当前内容的Seo描述
{intro} 内容简介
{content} 显示内容
{get_content_page} 当内容有分页时显示分页链接
{contenturl} 当前内容的url
{page} 如果有内容分页,可以显示当前页数
{author} 作者
{comefrom} 来源
{createdate} 发布日期
{lastupdate} 更新日期
{hits} 人气
{style} 标题修饰CSS
{pic} 缩略图
{ispic} 是否有缩略图,可选值:0和1,为1时表示有缩略图
{tags} 内容的标签,要显示出来,请参考默认模板方法
{url} 外链网址
{isurl} 是否为外链,可选值:0和1,为1时表示为外链
{islock} 内容的状态
{isnice} 是否为推荐内容,为1时表示推荐
{ontop} 是否为置顶内容,为1时表示置顶
{iscomment} 是否允许评论,为1时表示允许
{comments} 评论数量
{likeid} 相关内容的ID,为0时表示没有相关内容
{point} 阅读积分收费积分数

下面是内容模型中的调用方法
标签形式:{rsshow[字段名]}

将内容副表的字段名替换为上面的即可,比如表“sd_model_down”中有如下字段,version和softsize,那么我们要调用的话,这样就可以了:
{rsshow[version]}和{rsshow[softsize]}

==============================
================手机模板======
==============================
手机模板(在pc模板加入下2行代码,自动识别移动设备)
<script>var webroot="{webroot}";</script>
<script src="{webroot}lib/js/mobile.js"></script>

sdcms标签的更多相关文章

  1. a标签点击跳转失效--IE6、7的奇葩bug

    一般运用a标签包含img去实现点击图片跳转的功能,这是前端经常要用到的东西. 今天遇到个神奇的bug:如果在img上再包裹一层div,而且div设置了width和height,则图片区域点击时,无任何 ...

  2. IE6、7下html标签间存在空白符,导致渲染后占用多余空白位置的原因及解决方法

    直接上图:原因:该div包含的内容是靠后台进行print操作,输出的.如果没有输出任何内容,浏览器会默认给该空白区域添加空白符.在IE6.7下,浏览器解析渲染时,会认为空白符也是占位置的,默认其具有字 ...

  3. 百度MIP页规范详解 —— canonical标签

    百度MIP的规范要求必须添加强制性标签canonical,不然MIP校验工具会报错: 强制性标签<link rel="/^(canonical)$/"> 缺失或错误 这 ...

  4. 【CSS进阶】伪元素的妙用--单标签之美

    最近在研读 <CSS SECRET>(CSS揭秘)这本大作,对 CSS 有了更深层次的理解,折腾了下面这个项目: CSS3奇思妙想 -- Demo (请用 Chrome 浏览器打开,非常值 ...

  5. TODO:Laravel 使用blade标签布局页面

    TODO:Laravel 使用blade标签布局页面 本文主要介绍Laravel的标签使用,统一布局页面.主要用到到标签有@yield,@ stack,@extends,@section,@stop, ...

  6. 最新 去掉 Chrome 新标签页的8个缩略图

    chrome的新标签页的8个缩略图实在让人不爽,网上找了一些去掉这个略缩图的方法,其中很多已经失效.不过其中一个插件虽然按照原来的方法已经不能用了,但是稍微变通一下仍然是可以用的(本方法于2017.1 ...

  7. css-父标签中的子标签默认位置

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>& ...

  8. xpath提取多个标签下的text

    title: xpath提取多个标签下的text author: 青南 date: 2015-01-17 16:01:07 categories: [Python] tags: [xpath,Pyth ...

  9. 多个Img标签之间的间隙处理方法

    1.多个标签写在一行 <img src="/i/eg_tulip.jpg" alt="郁金香" height="100px"/> ...

随机推荐

  1. oracle连接方式、创建数据库用户、忘记数据库密码、用户锁定

    一.oracle六种连接方式 ①myEclipse中 打开myEclipse,window----show view----Other---输入DB点击DB browser 选中右键New.出现如下页 ...

  2. apache服务器启动时提示httpd: apr_sockaddr_info_get() failed for

    apache服务器启动时提示httpd: apr_sockaddr_info_get() failed for 在RedHat Linux 5 与 CentOS 5服务器上配置好apache后,启动或 ...

  3. js中的按键事件

    参考链接:http://blog.csdn.net/zhouziyu2011/article/details/53978293 <input type="text" id=& ...

  4. Android Monkey压力测试

    Monkey 是Android SDK提供的一个命令行工具, 可以简单,方便地运行在任何版本的Android模拟器和实体设备上. Monkey会发送伪随机的用户事件流,适合对app做压力测试. 1为什 ...

  5. 【原】Learning Spark (Python版) 学习笔记(二)----键值对、数据读取与保存、共享特性

    本来应该上周更新的,结果碰上五一,懒癌发作,就推迟了 = =.以后还是要按时完成任务.废话不多说,第四章-第六章主要讲了三个内容:键值对.数据读取与保存与Spark的两个共享特性(累加器和广播变量). ...

  6. 吉特仓库管理系统(开源)-如何在网页端启动WinForm 程序

    在逛淘宝或者使用QQ相关的产品的时候,比如淘宝我要联系店家点击旺旺图标的时候能够自动启动阿里旺旺进行聊天.之前很奇怪为什么网页端能够自动启动客户端程序,最近在开发吉特仓储管理系统的时候也遇到一个类似的 ...

  7. docfx预热中

    奋战了几个月,docfx终于有些像样了. 预览文档: http://aspnet.github.io/docfx/ 源代码正在准备开源中 Nuget包很快会发布 FAQ: Q: docfx是什么? A ...

  8. C 语言学习 第三次作业总结

    本次作业内容: For循环的使用 If判断语句的使用 常用数学运算表达式的使用 数学函数库中几个常见函数的使用及自我实现 将操作代码提交到coding 作业总结: For循环是C语言中一种基本的循环语 ...

  9. jQuery笔记总结

    来源于:http://blog.poetries.top/2016/10/20/review-jQuery/ http://www.jianshu.com/p/f8e3936b34c9 首先,来了解一 ...

  10. 解决:IOError: [Errno 28] No space left on device(设备空间不足)

    问题重现: 问题分析: 出现这样的问题,是磁盘空间不足,需要清理.卸载一下系统非必要软件和文件. 解决方案: 可以使用如下命令清理: #自动清理残余的依赖库 sudo apt-get autoremo ...