supesite开发关键问题解决方案记录
做项目用到了supesite,第一次接触这种cms,网上相关的教程也不多,这里记录下这几天遇到的问题,并且附上我所有的解决方案.
按照分类调用文章,解决方案如下:
<!–{block name=“spacenews” parameter=“catid/8/order/i.dateline DESC/limit/0,10/subjectlen/80/subjectdot/1/cachetime/18600/cachename/newslist/tpl/data”}–> <div class=“yqc-555 yqcft”> <h3 class=“yqc-green”> <strong>地大动态</strong> <a href=“#action/category/catid/8#” class=“more” target=”_self”>更多</a> </h3> <div class=“clear”></div> <ul class=“listitem”> <!–{loop $_SBLOCK[‘newslist’] $value}–> <li><a href=“$value[url]” target=”_blank”>$value[subject]</a><span>[#date(“Y-m-d H:i”, $value[“dateline”])#]</span></li> <!–{/loop}–> </ul> </div>
按照分类调用文章,并显示缩略图。
<!–{block name=“spacenews” parameter=“haveattach/1/showattach/1/catid/7/order/i.dateline DESC/limit/0,6/subjectlen/80/subjectdot/1/cachetime/18600/cachename/picnews/tpl/data”}–> <div class=“yqc-555 yqcrt”> <h3 class=“yqc-green”> <strong>分类名称</strong> <a href=“#action/category/catid/7#” class=“more” target=”_self”>更多</a> </h3> <!–{loop $_SBLOCK[‘picnews’] $value}–> <div class=“pic-box”>
<a href=“$value[url]“><img src=“$value[‘a_thumbpath’]” width=“120px;” height=“100px” /></a> <div class=“clear”></div> <a href=“$value[url]” title=“$value[subjectall]“>$value[subject]</a> </div> <!–{/loop}–> </div>
按照分类调用文章,并显示轮播效果
<!–{block name=“spacenews” parameter=“haveattach/2/catid/4/order/i.dateline DESC/limit/0,6/cachetime/18600/subjectlen/40/subjectdot/0/cachename/picnews/tpl/data”}–> <div id=“focus_turn”> <!–{if !empty($_SBLOCK[‘picnews’])}–> <ul id=“focus_pic”> <!–{eval $j = 0}–> <!–{loop $_SBLOCK[‘picnews’] $pkey $pvalue}–> <!–{eval $pcurrent = ($j == 0 ? ‘current’ : ‘normal’);}–> <li class=“$pcurrent”><a href=“$pvalue[url]“><img src=“$pvalue[‘a_filepath’]” alt=“” /></a></li> <!–{eval $j++}–> <!–{/loop}–> </ul> <div id=“focus_opacity”></div> <ul id=“focus_tx”> <!–{eval $i = 0}–> <!–{loop $_SBLOCK[‘picnews’] $key $value}–> <!–{eval $current = ($i == 0 ? ‘current’ : ‘normal’);}–> <li class=“$current”><a href=“$value[url]” title=“$value[subjectall]“>$value[subject]</a></li> <!–{eval $i++}–> <!–{/loop}–> </ul> <!–{/if}–> </div><!–focus_turn end–>
其他说明&调用规则
1、 name=“spacenews” 意思是规定调用资讯模块的内容 2、 grade/4/ 调用审核等级为4的内容 3、 showattach/1 是否显示图片附件1为显示 0 为不显示 3、 showdetail/1 是否显示缩略信息1为显示 0为不显示 4、 order/i.dateline 按照发布时间排序 5、 limit/0,1 0是从头一条开始 1是调用1条 6、 subjectlen/34 调用标题的字节数 7、 subjectdot/1 标题是够显示省略号1为显示 0 为不显示 8、 messagelen/80 缩略内容显示字节数 9、 messagedot/1 缩略内容是否显示省略号 10、cachetime/18600 缓存更新时间 11、cachename/headnews 调用变量的名称 12、dateline/2592000 调用的时间范围 13、catid/1,2 调用的频道限制