首先,模闆目錄得存在搜索結果文件,即 search_index.html
其次,首頁或其他頁面(miàn)搜索框調用代碼示範如下
<form action="<yunu:url name='search'/>" method="post"> <input class="cont_text" type="text" name="key" value="" placeholder="請輸入關鍵字"> <input class="cont_btn" type="submit" name="" value=""> </form>
最後(hòu),搜索結果頁面(miàn)讀取數據
<yunu:list orderby="sort asc" keyword="$keyword"> <li> <h5> <a href="{$list.url}" title="{$list.title}">{$list.pic}</a></h5> <div style="height: 46px;">{$list.desc}</div> </li> </yunu:list>
在1.0.9版本中,需要在list處加上指定cid欄目
上一篇:雲優CMS七牛雲使用教程