search
HomeCMS TutorialDEDECMSHow to display different templates according to channel model on the Dreamweaver search results page

How to display different templates according to channel model on the Dreamweaver search results page

How to display different templates according to channel models on the Dreamweaver search results page?

The DEDECMS search results page displays different templates according to channel models

Recommended learning: DDEECMS

Ideas: Give the search box Add a judgment, for example, a template will be displayed when searching for software models, and a template will be displayed when searching for article models.

1. Add

<script language="javascript" type="text/javascript"> 
<!-- 
 function check(){ 
  if(document.formsearch.channeltype.value=="3") 
  document.formsearch.action="{dede:field name=&#39;phpurl&#39;/}/search_images.php" 
  else 
  document.formsearch.action="{dede:field name=&#39;phpurl&#39;/}/search.php" 
 } 
--> 
</script>

in the head area 2. Change the search code

<form  name="formsearch" action="" *****ubmit="check();"> 
        <div class="form"> 
           <input type="hidden" name="kwtype" value="0" /> 
           <input name="q" type="text" class="search-keyword" id="search-keyword"
 value="{dede:global name=&#39;keyword&#39; function=&#39;RemoveXSS(@me)&#39;/}" /> 
       <select name="channeltype" id="channeltype" > 
    <option value=&#39;1&#39; selected=&#39;1&#39;>新闻</option> 
        <option value=&#39;3&#39;>软件</option> 
           </select> 
          <button type="submit" class="search-submit">搜索</button> 
        </div> 
   </form>

The key point is

<select name="channeltype" id="channeltype" > 
    <option value=&#39;1&#39; selected=&#39;1&#39;>新闻</option> 
    <option value=&#39;3&#39;>软件</option> 
</select>

Search by game model set here 1 is Article model 3 is a software model

3. Copy serach.php and rename it to search_images.php

4. Open search_images.php

require_once(DEDEINC."/arc.searchview.class.php");

and change it to

require_once(DEDEINC."/arc.searchimg.class.php");

5. Copy arc.searchview.class.php and rename it arc.searchimg.class.php

6. Open arc.searchimg.class.php

Modify

$tempfile = $GLOBALS[&#39;cfg_basedir&#39;].$GLOBALS[&#39;cfg_templets_dir&#39;]."/".$GLOBALS[&#39;cfg_df_style&#39;]."/search.htm";

The core modifications for

$tempfile = $GLOBALS[&#39;cfg_basedir&#39;].$GLOBALS[&#39;cfg_templets_dir&#39;]."/".$GLOBALS[&#39;cfg_df_style&#39;]."/search_images.htm";

have been completed, and all that is left is to play freely in the search_images.htm template. In the same way, you can also search by column type and display different styles of result pages.

The above is the detailed content of How to display different templates according to channel model on the Dreamweaver search results page. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft