POST TIME:2021-05-14 14:47
本期講解【Ask 標(biāo)記】此標(biāo)記用于獲取最新的問答的主題,適用范圍:適用于非擴展模塊所有模板.
此標(biāo)簽為DEDE5新添加的標(biāo)簽,主要用來調(diào)用問答模塊的相關(guān)數(shù)據(jù)的.
一: 使用說明
二: 測試實例
注: 本例將在主頁在適當(dāng)位置添加一個區(qū)域以測試【Ask 標(biāo)記】的所以參數(shù)的使用,以下為示例代碼:
<div class="leftlist margintop"> <div class="ptitle"><a href="#">最新問答資訊</a></div> <div style="width:668px; border:1px solid #ddd; padding-bottom:3px; clear:both;"> <dl style="width:666px; margin:1px auto; overflow:hidden;"> <dl style="width:320px; margin:10px 0 0 9px; float:left; height:150px; text-align:center; line-height:20xp;"> <h1 style="font-size:15px; border-bottom:1px dashed #f60;">最新發(fā)表的問題</h1><br> {dede:ask row='5'} <dd style="float:left;">[<b><a href="[field:typeurl/]">[field:tidname/]</a></b>]<span style="padding-left:8px;"><a href="[field:url/]">[field:title/]</a></span></dd> {/dede:ask} </dl> <dl style="width:320px; margin:10px 0 0 9px; float:left; height:150px; text-align:center; line-height:20xp;"> <h1 style="font-size:15px; border-bottom:1px dashed #f60;">高分問題</h1><br> {dede:ask row='5' qtype='high'} <dd style="float:left;">[<b><a href="[field:typeurl/]">[field:tidname/]</a></b>]<span style="padding-left:8px;"><a href="[field:url/]">[field:title/]</a></span></dd> {/dede:ask} </dl> <dl style="width:320px; margin:10px 0 0 9px; float:left; height:150px; text-align:center; line-height:20xp;"> <h1 style="font-size:15px; border-bottom:1px dashed #f60;">已解決的問題</h1><br> {dede:ask row='5' qtype='ok'} <dd style="float:left;">[<b><a href="[field:typeurl/]">[field:tidname/]</a></b>]<span style="padding-left:8px;"><a href="[field:url/]">[field:title/]</a></span></dd> {/dede:ask} </dl> <dl style="width:320px; margin:10px 0 0 9px; float:left; height:150px; text-align:center; line-height:20xp;"> <h1 style="font-size:15px; border-bottom:1px dashed #f60;">推薦的問題</h1><br> {dede:ask row='5' qtype='commend'} <dd style="float:left;">[<b><a href="[field:typeurl/]">[field:tidname/]</a></b>]<span style="padding-left:8px;"><a href="[field:url/]">[field:title/]</a></span></dd> {/dede:ask} </dl> </dl> </div> </div>
然后更新主頁,即返回如下圖所示的結(jié)果: