yzmcms常用标签

yzmcms常用标签

全局标签

关键字、描述和页面标题

<title>{
     $seo_title}</title>
<meta name="keywords" content="{
     $keywords}" />
<meta name="description" content="{
     $description}" />

js和css路径代码

<link href="{STATIC_URL}peiyin/css/base.css" type="text/css" rel="stylesheet"/>
<script src="{STATIC_URL}peiyin/js/jquery.min.js"></script>

引用 头部文件

 {
     m:include "index","header"} 

引用尾部文件

 {
     m:include "index","footer"} 

网站版权信息

{
     $site[site_copyright]}

网站备案号

{
     $site[site_filing]}

统计代码

{
     $site[site_code]}

获取某个栏目的名称

{
     get_category(6, 'catname')}

获取某个栏目的链接

{
     get_category(6, 'pclink')}

获取自定义变量——qq

{
     $site[qq]}

首页获取文章列表

{
     m:lists field="title,updatetime,url,color,thumb,peiyin"  catid="6"  order="id ASC" limit="12"}
				 {
     loop $data $k $v}
				  <li>
			        <a class="l anchor_img" href="{get_category(6, 'pclink')}" title="{
     $v[title]}" >
			    	      <img src="{
     $v[thumb]}"  width="95" height="95">
			    	  </a>  
			    	  
			    	  <div class="r anchor_tit">
			    	      <p class="hie">{
     $v[title]}</p>
			    		  <p>
	                <a href="javascript:void(0)" class="btn" onclick="topurl('tencent://message/?uin={
     $site[qq]}&Site=Sambow&Menu=yes')">联系客服配音</a> 
			    	    </p>
			    	  </div>
			    	  <div class="c"></div> 
			    	  <div class="audio_box">
			    		  <div class="btn-audio l" id="btn-audio-{
     $k}">
			    				<audio src="{
     $v[peiyin]}" id="mp3-btn-audio-{
     $k}"></audio>
			    		  </div>
			    		  <div class="start l starttime"></div>
			    		  <div class="jdt l">
			    			<div class="hover"></div>
			    		  </div>
			    		  <div class="start r end"></div>
			    	  </div>
			      
			      </li>		
				{
     /loop}	

首页

导航条调用一级栏目

{
     m:nav field="catid,catname,arrchildid,pclink,type" where="parentid=0" limit="20"}
{
     loop $data $v}		        
	<a {
     if isset($catid) && $v['catid']==$catid} class="current" {
     /if} href="{
     $v[pclink]}" {
     if $v['type']==2} target="_blank" {
     /if}>{
     $v[catname]}</a>	
{
     /loop}	

首页调用banner轮播图

 {
     m:banner field="title,image,url,typeid,status" limit="10"}
      {
     loop $data $v} 
      <li style="background:url({
     $v[image]}) 50% 0 no-repeat;" title="{
     $v[title]}">
        <a href="{
     $v[url]}" target="_blank"></a>
      </li>
      {
     /loop}

友情链接

<a href="{U('link/index/init')}">申请友链</a>
{
     m:link field="url,logo,name" limit="20"}
{
     loop $data $v}
<li><a href="{
     $v[url]}" target="_blank">{
     $v[name]}</a></li> 
{
     /loop} 

首页调用某个单页栏目的内容

{
     m:get sql="SELECT * FROM yzmcms_page WHERE catid=22 " limit="1"}
    {
     loop $data $v}
       {
     $v['content']}   
    {
     /loop} 

首页调用一级栏目及其二级栏目

{
     m:nav field="catid,catname,arrchildid,pclink,type" where="catid=6" limit="10"}
      {
     loop $data $v}
        <a href="{
     $v[pclink]}" class="hover" title="{
     $v[catname]}">真人配音</a>        
      <!-- 这里是二级栏目的循环,不需要的可以删除,代码开始 -->
      {
     if $v['arrchildid']!=$v['catid']} 
      {
     php $r = get_childcat($v['catid']);}
        {
     loop $r $v}
        <a href="{
     $v[pclink]}">{
     $v[catname]}</a>
        {
     /loop}   
      {
     /if}
      <!-- 这里是二级栏目的循环,不需要的可以删除,代码结束 -->
     {
     /loop} 

频道封面页(列表页同)

获取当前栏目的内容

 {
     $content}

获取当前栏目父级栏目下的所有子栏目

{
     php $arrparentid = get_category($catid, 'arrparentid');}        
		{
     if $arrparentid=='0'}
		{
     php $arrparentid=$catid;}
		{
     else}
		{
     php $res = explode(',', $arrparentid); $arrparentid=$res[1];}
		{
     /if}

		<a href="{get_category($arrparentid,'pclink')}" class="hover"  > 全部 </a>

		{
     m:nav field="catid,catname,arrchildid,pclink,type" where="parentid=$arrparentid" limit="10"}
		{
     loop $data $v}        
		        <a href="{
     $v[pclink]}"{
     if isset($catid) && $v['catid']==$catid} class="hover" {
     /if} > {
     $v[catname]}        </a>
		{
     /loop}

面包屑导航

{
     get_location($catid)}

获取当前栏目的文章列表

{
     m:lists field="title,url,thumb,catid,description" catid="$catid" limit="10" page="page"}
				  {
     loop $data $v}	
				   <div class="img_text_list">
					  <a href="{
     $v[url]}"><img src="{if !empty($v['thumb'])}{
     $v[thumb]}{else}{STATIC_URL}images/nopic.jpg{/if}" alt="{
     $v[title]}" title="{
     $v[title]}"></a>
					  <span>[{
     get_catname($v['catid'])}]</span><strong><a href="{
     $v[url]}">{
     $v[title]}</a></strong>
					  <p>{
     $v[description]}<a href="{
     $v[url]}">[详细]</a></p>
					</div>	
				  {
     /loop}

获取当前栏目的页码

{
     $pages}

栏目内联动筛选,(需要联动筛选插件-官网购买)

 {
     category_screen('sex1', $modelid, $catid)} 

联动条件下的获取当前栏目文章

{
     m:lists field="title,updatetime,url,color,flag,thumb,peiyin" catid="$catid"  order="id ASC" limit="20" where="$where" page="page"}  	 			 
		 		{
     loop $data $k $v}	  
 		        <li>
			        <a class="l anchor_img" href="tencent://message/?uin={
     $site[qq]}&Site=Sambow&Menu=yes" target="_blank">
				        <img src="{
     $v[thumb]}"  width="95" height="95">
				    </a>  
				  
				  <div class="r anchor_tit">
				      <p>{
     $v[title]}</p><p>
	                 <a class="btn" href="tencent://message/?uin={
     $site[qq]}&Site=Sambow&Menu=yes" target="_blank">联系客服配音</a> 
				  </p></div>
				  <div class="c"></div> 
				  <div class="audio_box">
					  <div class="btn-audio l" id="btn-audio-{
     $k}">
							<audio src="{
     $v[peiyin]}" id="mp3-btn-audio-{
     $k}"></audio>
					  </div>
					  <div class="start l starttime"></div>
					  <div class="jdt l">
						<div class="hover"></div>
					  </div>
					  <div class="start r end"></div>
				  </div>
			  
			  </li>
			   {
     /loop}			

内容页

文章标题

{
     $title}

来源:

{
     $copyfrom} 

更新时间:

{
     date('Y-m-d H:i:s',$updatetime)}

编辑:

{
     $nickname} 

浏览次数:

{
     $click}

文章内容:

{
     $content}

上一篇:

{
     $pre}

下一篇:

{
     $next}

你可能感兴趣的:(yzmcms,html)