Home >Backend Development >PHP Tutorial >织梦dede arclist标签里怎么用 if

织梦dede arclist标签里怎么用 if

WBOY
WBOYOriginal
2016-06-23 14:10:08858browse

{dede:arclist row='6' titlelen='20'  imgwidth='80' imgheight='107' addfields='body'  typeid='15' channelid='1'}
                织梦dede arclist标签里怎么用 if

                {dede:if field.shorttitle != '' }
                    查看详细
                {else}
                    敬请期待
                {/dede:if}
  {/dede:arclist}

在列表循环里,我想用if,当字段shorttitle 不为空时,显示“查看详细”,反之显示“敬请期待”。
我这里的if是错的。请问该怎么写啊,谢谢。


回复讨论(解决方案)

{dede:php}

{/dede:php}

{dede:field.shorttitle  runphp="yes"}
if(@me=='')
{
  @me=敬请期待
}
else{
    @me=查看详细
}                 
{/dede:field.shorttitle}


先试试吧

{dede:field.shorttitle  runphp="yes"}
if(@me=='')
{
  @me=敬请期待
}
else{
    @me=查看详细
}                 
{/dede:field.shorttitle}


先试试吧 谢谢你的回答,还是不行。

{dede:arclist row='6' titlelen='20'  imgwidth='80' imgheight='107' addfields='body'  typeid='15' channelid='1'}                <img  src="[field:litpic/]" / alt="织梦dede arclist标签里怎么用 if" >                [field:shorttitle runphp=yes]				$fields =  @me;				if($fields != ''){					@me = '<a href="'.$fields.'"   class="butten" target="_blank">查看详细</a>';				}else{					@me =  '<a    class="butten" target="_blank">敬请期待</a>';				}				[/field:shorttitle]   {/dede:arclist}

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn