织梦dedecms获得文章body的三种方法

织梦dedecms获得文章body的三种方法 1. 使用SQL

{dede:sql sql='Select body from `dede_addonarticle` where aid=146'} [field:body/] {/dede:sql}  


2.使用arclist, 用idlist获取,aid 是没用的,在首页记得要获取typeid, 用addfields='body'来直接使用[field:body/]

{dede:arclist typeid='49' idlist='146' addfields='body' channelid='1' } <section class="recommend"> <header class="header"> <h2><a href=http://www.dede58.com/"[field:arcurl/]">[field:title/]</a></h2> <a href=http://www.dede58.com/"[field:arcurl/]" class="more" title="更多...">more</a> </header> <div class="content"> [field:body/] </div> </section> {/dede:arclist}  

3.混搭

{dede:arclist typeid='48' limit='0,10'} <li><time class="date">[field:id runphp='yes'] $aid = @me; $row = $GLOBALS['dsql']->GetOne("Select activitydate From `dede_addonarticle20` where aid='$aid' "); @me = "{$row['activitydate']}"; [/field:id]</time><a href=http://www.dede58.com/"[field:arcurl/]" title="查看详情">[field:title/]</a></li> {/dede:arclist}  

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/fc8c7999d44d10edfa98bb9647c23ac9.html