主頁 > 網(wǎng)站建設(shè) > 建站知識(shí) > 織夢(mèng)(dedecms)怎么實(shí)現(xiàn)下拉搜索指定欄目功能?

織夢(mèng)(dedecms)怎么實(shí)現(xiàn)下拉搜索指定欄目功能?

POST TIME:2017-11-13 00:14

織夢(mèng)(dedecms)怎么實(shí)現(xiàn)下拉搜索特定欄目功能?在企業(yè)站展示產(chǎn)品的時(shí)候由于產(chǎn)品分類之類之多,需要對(duì)欄目類別進(jìn)行選項(xiàng)搜索是最好的選擇!不僅可以節(jié)省代碼的繁瑣同時(shí)也便于用戶的使用!那么織夢(mèng)標(biāo)簽代碼中怎么實(shí)現(xiàn)這個(gè)功能呢?

今天跟版網(wǎng)就來和大家說說織夢(mèng)(dedecms)怎么實(shí)現(xiàn)下拉搜索特定欄目功能?
在這里要想實(shí)現(xiàn)對(duì)欄目下拉搜索功能,還是少不了channelartlist標(biāo)簽,不我們就再來挖掘下該標(biāo)簽的另一個(gè)功能!

<form action="{dede:field name='phpurl'/}/search.php" name="formsearch">
<div class="form">
<input type="hidden" name="kwtype" value="0" />
<input name="keyword" type="text" class="search-keyword" id="search-keyword" />
<select name="typeid" class="search-option" id="typeid">
<option value='0' selected='1' class="search-xl">全部欄目</option>
{dede:channelartlist typeid='top' } {dede:type} <option value='[field:id/]'>[field:typename/]</option>{/dede:type}
{dede:channel type='son' noself='yes'} <option value='[field:id/]'>-[field:typename/]</option> {/dede:channel}{/dede:channelartlist}</select>
<button type="submit" class="search-submit">站內(nèi)搜索</button>
</div>
</form>
指定欄目:
<form action="{dede:global.cfg_cmsurl/}/plus/search.php" method="get" id="globalsearchform">
<div class="globalsearchform">
<input name="q" type="text" class="input" id="globalsearchform_key" name="key" value="輸入關(guān)鍵詞搜索產(chǎn)品..." onfocus="if(this.value=='輸入關(guān)鍵詞搜索產(chǎn)品...'){this.value='';}" onblur="if(this.value==''){this.value='輸入關(guān)鍵詞搜索產(chǎn)品...';}">
</div>
<div class="globalsearchformselect">
<select name="typeid" class="search-option" id="typeid">
{dede:channelartlist typeid='9,10'}{dede:type}
<option value='[field:id/]'>[field:typename/]</option>{/dede:type}
{dede:channel type='son' noself='yes'}<option value='[field:id/]'>-[field:typename/]</option>{/dede:channel}
{/dede:channelartlist}
</select>
</div>
<div class="globalsearchform1">
<input type="image" class="imgbutton" src="{dede:global.cfg_templets_skin/}/images/searchr.png" id="button" name="imageField">
</div>
</form>


收縮
  • 微信客服
  • 微信二維碼
  • 電話咨詢

  • 400-1100-266