在織夢模型里增加個字段,然后在添加文章的時候,在字段里填了欄目id進去
在前臺的內容頁,調用這個字段欄目的多個文章出來
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | {dede:field.field1 runphp=yes} global $dsql; $sql = "select arc.*,tp.typedir,tp.typename,tp.corank,tp.isdefault, tp.defaultname,tp.namerule,tp.moresite,tp.siteurl,tp.sitepath from `dede_archives` arc left join `dede_arctype` tp on arc.typeid=tp.id where tp.id in (@me) LIMIT 10"; $dsql->SetQuery($sql); $dsql->Execute('t'); $result = ''; while($row = $dsql->GetArray('t')) { $arcurl=GetOneArchive($row['id']); $pubdate = MyDate('Y-m-d H:i:s',$row['pubdate']); $result .= "<li><span>{$pubdate}</span><a href=/"{$arcurl['arcurl']}/">{$row['title']}</a></li>"; } @me = $result; {/dede:field.field1} |
field1 為字段名稱



















