jumbotcms参考

//******************************首页************************************//
//全局参数
<title><jcms:site.name/> – <jcms:site.page.description/></title>
<jcms:site.page.keywords/>
<jcms:site.page.description/>
<jcms:site.author/>
{site.Dir}
${cutstring(field.summary,100)}
${cdatestring(field.adddate,”yy-MM-dd”)}
<!–#include virtual=”/_data/shtm/left.htm” –>

//多级栏目分类
<jcms:classtree channelid=”5″ classid=”0″>
<#foreach collection=”${tree.subchild}” var=”class0″ index=”i”>
${i}
<a href=”${class0.link}”> ${class0.name}</a>
<#if test=”${notequals(class0.subchild.count, 0)}”>
<#foreach collection=”${class0.subchild}” var=”class1″ index=”j”>
<A href=”${class1.link}”>${class1.name}</A>
<#/foreach>
<#/if>
<#/foreach>
</jcms:classtree>

//类别的循环,特别注意selectid,可以多选
<jcms:classloop channelid=”5″ selectids=”1″>
<A href=”{$ClassLink}”>Products</A>
</jcms:classloop>
                 
<jcms:classloop channelid=”1″ classid=”3″>
<A href=”{$ClassLink}”>Company News</A>
</jcms:classloop>

//频道循环,channelloop内可包含其他标签
<jcms:channelloop repeatnum=”6″ orderfield=”pid” ordertype=”asc”>
<jcms:contentloop channelid=”{$ChannelId}” classid=”0″ repeatnum=”8″ fields=”[title],[tcolor],[adddate]”>
{$ChannelName}<a href=”{$ChannelLink}”>更多 &raquo;</a></span></dt>
<#foreach content>
${cdatestring(field.adddate,”yy-MM-dd”)}  $_{url}  $_{title} style=”color:${field.tcolor} ${field.title}<#/foreach>
</jcms:contentloop>
</jcms:channelloop>

        
 //内容显示                              
<jcms:contentloop channelid=”1″ repeatnum=”5″ fields=”[img],[title]”>
 <#foreach collection=”${contents}” var=”field” index=”i”>
{site.Dir}
<A href=”$_{url}”>$_{title}</A>
<#/foreach>
</jcms:contentloop>
                           

//内容显示高级标签                           
<jcms:contentloop channelid=”5″ repeatnum=”12″ isimg=”1″ fields=”[title],[img],[isimg]”>
<#foreach collection=”${contents}” var=”field” index=”i” >
$_{url}
<#if test=”${equals(i,4) or equals(i,8)}”>
</TR>
<#/if>  
<#/foreach>
</jcms:contentloop>
     
                 
//****************************列表页***************************//
//列表页全局标签
<jcms:site.page.title/>  <jcms:site.page.keywords/>   <jcms:site.page.description/>  <jcms:site.author/>
{site.Dir}  <jcms:site.page.basehref/>   {$ClassName}   
 
 
//列表的内容列表
{$jcms:class(title,price0,points,isimg,img,adddate)}
<#foreach content>

$_{url}      $_{title}     $_{img}    ${field.title}
${cutstring(field.title,40)}   ${floatstring(field.price0,”{0:C2}”)}     ${floatstring(field.points,”{0:C2}”)}

<#if test=”${equals(i,4) or equals(i,8) or equals(i,12) or equals(i,16) or equals(i,20)}”></tr><#/if>
<#/foreach>

<#/foreach>
{$/jcms:class}

//列表页的分页
<div> {$_getPageBar()} </div>
 
//********************详情页***************************//
//详情页的全局参数
<jcms:site.page.title/>  <jcms:site.page.keywords/>  <jcms:site.page.description/>
<jcms:site.author/>  {site.Dir}   <jcms:site.page.basehref/>

//详情页的的动态内容显示 特别注意wherestr
<jcms:contentloop channelid=”{$ChannelId}” classid=”0″ repeatnum=”10″ fields=”title,tcolor” wherestr=”id<={$_id}”>

<#foreach content>
<li><a href=”$_{url}” title=”$_{title}” style=”color:${field.tcolor}”>${field.title}</a></li>
<#/foreach>

</jcms:contentloop>

//高级参数 islike:相关产品; istop:置顶; wherestr过滤参数”id小于{$_id}”与”id<={$_id}” 均可,tcolor字体样式
<jcms:contentloop channelid=”{$ChannelId}” classid=”0″ repeatnum=”10″ fields=”title,tcolor” wherestr=”id小于{$_id}” islike=”1″ istop=”1″ keywords=”{$_tags}”>
<ul>
<#foreach content>
<li><a href=”$_{url}” title=”$_{title}” style=”color:${field.tcolor}”>${field.title}</a></li>
<#/foreach>
</ul>
</jcms:contentloop>
//搜索条 
<script type=”text/javascript”>document.write(_jcms_SearchBar());</script>

//位置导航
<jcms:site.page.nav/> {$ChannelItemName}

//内容页常用参数
{$ClassName}   {$_title}   {$_img}   {$_content}

//购物车表单
<form id=”frm_buy” action=”” method=”post” target=”_blank”>
<div> <img src=”{$_img}” width=”282″ height=”206″ alt=”{$_title}” /></div>
<ul><li><span>会员价:</span> <span>{$Points}</span>元</li>
 <li><span>市场价:</span> <span>{$Price0}</span>元</li>
 <li><span>更新时间:</span> {$_adddate}</li>
 <li><span>厂商/作者:</span> {$_author}</li>
 <li><span>浏览次数:</span> {$_viewnum}</li>
 <li><span>购买数量:</span>
    <input type=”text” id=”txtBuyCount” name=”txtBuyCount” value=”1″ /> 件<br /><span id=”tipBuyCount” style=”     width:120px;”> </span></li>
</ul>
 <div>
    <input type=”hidden” name=”txtChannelId” value=”{$ChannelId}” />
    <input type=”hidden” name=”txtProductId” value=”{$_id}” />
    <input type=”hidden” name=”txtProductName” value=”{$_title}” />
 <input type=”button” value=”” id=”btnBuy” onclick=”sub(‘buy’);” />
 <input type=”button” value=”” id=”btnCart” onclick=”sub(‘cart’);”  />
 </div>
</form>
                   

<!–#include virtual=”/_data/shtm/share.htm” –>
<a href=”{site.Dir}review/default.aspx?ccid={$ChannelId}&ctype={$ChannelType}&id={$_id}”>发表评论</a>
<a href=”javascript:addFavorite({$ChannelId},'{$ChannelType}’,{$_id});” title=”本站会员收藏”>本站收藏</a>
{$_getNeightor()}

 

 

 

 

此条目发表在jumbotcms参考分类目录。将固定链接加入收藏夹。

发表评论

邮箱地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>