玄龙CMS content标签调用指定文章数据

xuanlong content调用指定文章数据


/**
 * 参数说明:
 * aid 文章ID
 * @empty 暂无数据
 */



{xuanlong:content aid='7' @empty="[[<h1>暂无数据</h1>]]"}

     [field:id/] //ID<br>
     [field:title function="html2text(@me)"/] //调用系统函数对标题进行过滤html操作<br>
     [field:arcurl/] //地址<br>
     [field:litpic/] //缩略图<br>
     [field:description/] //描述<br>
     [field:click/] //点击<br>
     
     [field:typename/] //所属栏目<br>
     [field:typedir/] //栏目地址<br>
     [field:test1/] //当前模型自定义字段 字段名称 test1<br> 
     [field:senddate function="MyDate(@me,"Y-m-d H:i:s")"/] //发布时期 2022-09-27 11:17:13undefinedbrundefined
     [field:body/] //内容<br>
     {xuanlong:php} echo $k;{/xuanlong:php} //自增ID 0
    
--------------------------------------------------------------------<br>
    
  //标签内部 if  else if 判断
    
    {{xuanlong:if [field:id/]==3}}
         <h1>[field:id/]</h1> //我条件成立了 文章ID<br>
    {{xuanlong:elseif [field:click/]>=0}}
         [field:click/] //我条件成立了 文章点击<br>
    {{xuanlong:else/}}
        [field:title/] //条件不成立了就输出了标题<br>
    {{/xuanlong:if}}
   
   <br>
    //判断缩略图不为空则输出
    {{xuanlong:if [field:litpic/]!=''}}
        [field:litpic/]
    {{/xuanlong:if}}
    
--------------------------------------------------------------------<br>

  //标签内部调用当前文章图集 当前文章模型自定义的图集imgs
  
    {xuanlong:custom='imgs' @empty="[[<h1>暂无数据11</h1>]]"} //不存在图集就输出 暂无数据11
        {xuanlong:php} echo $k;{/xuanlong:php}  //自增ID 按图片数量 0 1 2 3 4 . . . 
        
        //图集内部 if  else if 判断
        {{xuanlong:if $k==0 || [field:id/]==3}}
            [field:id/] //我条件成立了 关联文章ID<br>
        {{xuanlong:elseif $k==1 && [field:title/]=='xuanlong pagelist显示分页样式'}}
            [field:img_txt/] //我条件成立了 图片说明<br>
        {{xuanlong:else/}}
            {xuanlong:php} echo $k+1;{/xuanlong:php} //条件不成立了就输出了当前是第几张图片<br>
        {{/xuanlong:if}}
        
        <a href="[field:arcurl/]" title="[field:img_txt/]"><img src="[field:img_src/]" width="80px" height="80px"/></a>
    {/xuanlong:custom}
    
--------------------------------------------------------------------<br>
    
   //当前文章模型自定义的图集ddd
   
    {xuanlong:custom='ddd' @empty="[[暂无数据22]]"}  /*不存在图集就输出 暂无数据22 */
        {xuanlong:php} echo $k;{/xuanlong:php}  //自增ID 按图片数量 0 1 2 3 4 . . .
        
          //if  else if 判断
        {{xuanlong:if $k==0 || [field:id/]==3}}
            [field:id/] //我条件成立了 关联文章ID<br>
        {{xuanlong:elseif $k==1 && [field:title/]=='xuanlong pagelist显示分页样式'}}
            [field:img_txt/] //我条件成立了 图片说明<br>
        {{xuanlong:else/}}
            {xuanlong:php} echo $k+1;{/xuanlong:php} //条件不成立了就输出了当前是第几张图片<br>
        {{/xuanlong:if}}
        
        <a href="[field:arcurl/]" title="[field:img_txt/]"><img src="[field:img_src/]" width="80px" height="80px"/></a>
    {/xuanlong:custom}
    
{/xuanlong:content}