Has someone the right code?
Watch
GitHub Core
Show your support for Zikula! Sign up at Github account and watch the Core project!
GitHub Modules
- Guite responded to »Can the Updated Version Check be Turned Off (Z 1.3)« 05:53 PM
- frw responded to »Bug in the SMTP mail transfer protocol - Port 25 - Zikula 1.2.9« 22. May
- mdee responded to »Short URL questions« 22. May
- mesteele101 responded to »Problem in Database Connection« 21. May
- Herr.Vorragend responded to »Clip Documentation and Doubt« 19. May
- mazdev responded to »zikula 1.3.3. and IE9« 19. May
- mesteele101 responded to »How to install Zikula for MSSQL ??? - Part II« 19. May
Zikula Blog
- Anatomy of Open Source Projects on Mar 07
- Continuous Review on Mar 01
- Not Invented Here on Feb 24
- How to Contribute Your Code at Github on Jan 13
- 10 Steps to Coding-Nirvana: Tips for Successful Module Writing on Nov 12
- Submitting Bug Report Tickets That Get Results on Aug 17
- Cozi Tricks #1: Syntax Highlighting on Aug 07
Login
How to add a search field in a theme?
-
- Rank: Senior
- Registered: Sep 22, 2003
- Last visit: Oct 21, 2009
- Posts: 2774
Hi gessi,
Tthe code is here, in HTML form (i.e. not echoed into the theme)... See my post on good theme writing practices here for more info:
http://forums.postnu…e=viewtopic&p=64466
Code
<FORM ACTION="modules.php" METHOD="post" STYLE="margin-bottom: 0px; margin-top: 0px;">
<INPUT TYPE="hidden" NAME="name" VALUE="Search">
<INPUT TYPE="hidden" NAME="file" VALUE="index">
<INPUT TYPE="hidden" NAME="op" VALUE="modload">
<INPUT TYPE="hidden" NAME="action" VALUE="search">
<INPUT TYPE="hidden" NAME="overview" VALUE="1">
<INPUT TYPE="hidden" NAME="active_stories" VALUE="1">
<INPUT TYPE="hidden" NAME="bool" VALUE="AND">
<INPUT TYPE="hidden" NAME="stories_cat" VALUE="">
<INPUT TYPE="hidden" NAME="stories_topics" VALUE="">
<INPUT class="pn-normal" NAME="q" TYPE="TEXT" VALUE="" SIZE="15">
<INPUT TYPE="SUBMIT" NAME="Submit" VALUE=" search ">
</FORM>
You can alter or nuke some of the "HIDDEN" values to change the behavior of the search and what modules it searches for by default...
Hope that helps!
--
Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods
Cape Cod Travel Info... -
- Rank: Senior
- Registered: Sep 22, 2003
- Last visit: Oct 21, 2009
- Posts: 2774
ADDEDNDUM to above post:
The "active_stories" dictates what module the s/e will search... The rest of the list (for default modules) is here:
Code
<input type="hidden" name="active_weblinks" value="1">
<input type="hidden" name="active_stories" value="1">
<input type="hidden" name="active_sections" value="1">
<input type="hidden" name="active_reviews" value="1">
<input type="hidden" name="active_faqs" value="1">
<input type="hidden" name="active_downloads" value="1">
<input type="hidden" name="active_users" value="1">
--
Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods
Cape Cod Travel Info...
- Moderated by:
- Support
