DEDE178模板网专注于织梦源码分享、织梦模板、dede模板源码、wordpress主题等网站模板,为广大站长提供完整无错的织梦源码。
用户名:
密码:
注册

织梦源码,DEDE178模板网

VIP

CMS教程

站长学院

dede:arclist、dede:list等标签中调用附加字段

编辑:DEDE178模板网 / 2018-04-13 点击数:92
dedecms织梦dede:arclist、dede:list等标签中调用附加字段 。
 
  代码如下
01 {dede:list perpage='20'
02                     <div class="f-con01"
03                         <div class="f-con01-l"
04                             <a><img src="/templets/qiba/images/con01-f.jpg"></a> 
05                         </div> 
06                         <div class="f-con01-r"
07                             <p class="a6"><a href="[field:arcurl/]"target="_blank">[field:title/]</a></p> 
08                             <p><a>[field:description/]...</a></p> 
09                             <dl> 
10                                 <dt>地址:</dt> 
11                                 <dd>[field:id runphp="yes"
12                                         $dsql = new DedeSql(false); 
13                                         $sql="SELECT qiba.address from `dede_addonqiba` as qiba where qiba.aid=@me"
14                                         $arcRow = $dsql->GetOne($sql); 
15                                         @me=''.$arcRow['address'].''
16                                     [/field:id]</dd
17                                 <dt>乘车路线:</dt> 
18                                 <dd>[field:id runphp="yes"
19                                         $dsql = new DedeSql(false); 
20                                         $sql="SELECT qiba.roadline from `dede_addonqiba` as qiba where qiba.aid=@me"
21                                         $arcRow = $dsql->GetOne($sql); 
22                                         @me=''.$arcRow['roadline'].''
23                                     [/field:id]</dd
24                             </dl> 
25                             <dl> 
26                                 <dt>电话:</dt> 
27                                 <dd>[field:id runphp="yes"
28                                         $dsql = new DedeSql(false); 
29                                         $sql="SELECT qiba.telephone from `dede_addonqiba` as qiba where qiba.aid=@me"
30                                         $arcRow = $dsql->GetOne($sql); 
31                                         @me=''.$arcRow['telephone'].''
32                                     [/field:id]</dd
33                             </dl> 
34                         </div> 
35                         <div class="f-con01-b"
36                             <div class="star"
37                                 <p>评分:</p> 
38                                 [field:id runphp="yes"
39                                         @me=rating_bar(@me,5); 
40                                     [/field:id
41                             </div> 
42                         </div> 
43                         <div class="clear"></div> 
44                     </div> 
45                     {/dede:list}
  这样已经成功地实现了我们要实现的功能了。
收缩