Fork me on GitHub

How to add a search field in a theme?  Bottom

  • How can I add a search field with a button or text into a in top of my page theme?
    Has someone the right code?
  • 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">&nbsp;
    <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...
  • 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...

This list is based on users active over the last 60 minutes.