In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Editor to share with you how the dedecms search results page can display different result templates according to the channel model. I hope you will gain a lot after reading this article. Let's discuss it together.
How can the dedecms search results page display different result templates by channel model?
Dedecms has its own templates, such as picture model, article model, software model and so on. Sometimes it is necessary to add a decision to the search box for the sake of user experience, such as the template that displays the software model when searching for the software model and the template that displays the article model when searching for the article model.
The specific implementation code is as follows:
1. Join in the head area
The code is as follows:
Function check () {if (document.formsearch.channeltype.value== "1") document.formsearch.action= "{dede:field name='phpurl'/} / search.php" elsedocument.formsearch.action= "{dede:field name='phpurl'/} / search_news.php"}
two。 Change the search code
The code is as follows:
News software search
The point is that
The code is as follows:
News software
Key settings: search by model 1 is the article model 3 is the software model
3. Copy serach.php and change its name to search_images.php
4. Open search_images.php
Set
The code is as follows:
Require_once (DEDEINC. "/ arc.searchview.class.php"
Change to
The code is as follows:
Require_once (DEDEINC. "/ arc.searchimg.class.php"
5. Copy arc.searchview.class.php and change its name to arc.searchimg.class.php
6. Open arc.searchimg.class.php
Find
The code is as follows:
$tempfile = $GLOBALS ['cfg_basedir']. $GLOBALS [' cfg_templets_dir']. "/". $GLOBALS ['cfg_df_style']. "/ search.htm"
Change to
The code is as follows:
$tempfile = $GLOBALS ['cfg_basedir']. $GLOBALS [' cfg_templets_dir']. "/". $GLOBALS ['cfg_df_style']. "/ search_images.htm has finished reading this article. I believe you have some understanding of how the dedecms search results page can display different result templates according to the channel model. If you want to know more about it, welcome to follow the industry information channel. Thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.