mhcms整理

原创 tonny  2019-05-13 13:20  阅读 2,448 次 评论 0 条

列表页调用栏目名称

{catname(field:catid)}

列表页分页

{mh:pagelist listsize="5"}当前是 <strong>{$page}</strong> 页{$index} {$pre} {$pagelist} {$next} {$end} 共 <strong>{$totalcount}</strong> 条 <strong>{$pageno}</strong> 页

文章描述截取指定数字调用

{sub_string(field:description,180)}

根据数量显示不同样式

{mhcms $pno=$no+1;}
{if $pno%4==0}
<li class='col-4-1 last not-animated' >
{else}
<li class='col-4-1 not-animated'>
{/if}

 

首页头部描述:{$head[description]}
首页头部关键词:{$head[keywords]}
模板路径:{$MH[tlp_path]}
首页(网站)地址:{$MH['site_url']}
网站名称(标题):{$MH['site_name']}
{$mh_catname}-{$MH['site_name']}
当前位置:{$mh_postion}
上一篇:{getpre($id,$catid,60)}
下一篇:{getnext($id,$catid,60)}
顶部栏目调用:
{mh:category  mod="1,2,4"  nav="2" type="top"}
<li><a href="{field:url}" >{field:catname}</a></li>
{/mh:category}
单页内容调用:
{mh:category catid="4"}{sub_string(strip_tags(field:content),390,'...')}<a href="http://">更多</a>
                      {/mh:category}
列表页分页:
{mh:pagelist listsize="5"}当前是 <strong>{$page}</strong> 页{$index} {$pre} {$pagelist} {$next} {$end} 共 <strong>{$totalcount}</strong> 条 <strong>{$pageno}</strong> 页
批量更改内容
Update mhcms_article SET content=replace(content,"原内容","新内容")
{$no}    mhcms循环计数器,实用:category,content,loop标签中,从0开始,如果需要从1开始,那么{mhcms $pno=$no+1;}
当前栏目突出显示
 {if $catid==$id} class="cur"{/if}
获取当前栏目的父栏目名称:{catname($parentid)}
调用栏目封面图片
{mh:category parentid="15" row="10" mod="" type="son"}
<li><a href="{field:url}"><h2>{field:catname}</h2><img src="{field:image}" style="max-height:195px;" alt="{field:catname}"></a></li>
{/mh:category}
调用指定栏目封面图片
{mh:category catid="19" row="1" mod="" type="top""}
<img class="l" src="{field:image}" style="max-height:240px; alt="{field:catname}">
{/mh:category}
调用多个栏目及栏目下文章
{mh:category parentid="19" row="10" mod="" type="son"}
<dl>
<dt><a href="{field:url}">{field:catname}</a></dt>
{mh:content catid="(field:id)" posid="0" row="10" limit="0" withthumb="0" orderby="id" orderbyway="DESC" keyword="" ismore="0"}
<dd><a href="{field:url}" title="{field:title}">{sub_string(field:title,20)}</a></dd>
{/mh:content}
</dl>
{/mh:category}
图库调用
{mhcms $pic=morefield($tuku,100);}
{loop $pic $rs}
{$rs}
{$rs[name]}
{/loop}
下载地址调用
{strstr($shouce,'/')}
shouce是你自己定义的字段名
偶数级别特殊样式突出显示
{if ($no+1)%2==0}class="bg"{/if}
第一条调用样式突出显示
{mhcms $pno=$no+1;}
{if $pno==1}class="hover"{/if}
本文地址:https://www.92q.net/764.html
关注我们:请关注一下我们的微信公众号:扫描二维码塔铃的公众号
版权声明:本文为原创文章,版权归 tonny 所有,欢迎分享本文,转载请保留出处!

发表评论


表情