mhcms整理

列表页调用栏目名称

{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[url]}
{$rs[name]}
{/loop}
下载地址调用
{strstr($shouce,’/’)}
shouce是你自己定义的字段名
偶数级别特殊样式突出显示
{if ($no+1)%2==0}class=”bg”{/if}
第一条调用样式突出显示
{mhcms $pno=$no+1;}
{if $pno==1}class=”hover”{/if}
收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

98资源 技术教程 mhcms整理 https://www.98wo.com/764/

常见问题

相关文章

评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务