如果当前取第一条新闻的图片,如果第一条新闻没有图片,显示 默认图片

<#list cms.documents("channel=某个栏目名称,num=1, channeltype=2") as document>
<!--如果第一条新闻 有图片 -->
<#if (""!=(document.pic)) && ("null"!=(document.pic))>
取出 它的照片

<#else>
取出默认图片
</#if>
<!---->
</#list>

这个 是自己 想的,还没有用上,等到嵌模板的时候,付诸实践。

原文地址:https://www.cnblogs.com/woxiangxintj/p/4744072.html