1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Search form on main page

Discussion in 'Templates, HTML, CSS, and Design Help' started by mattp008, Dec 30, 2012.

  1. mattp008 New Member

    Hi All,

    Can somebody help me with tips about how to add the search form that is in search.tpl onto the main page? ie. When a user lands at my site, they can search from the main page.

    Thanks,
    Matt

    68Classifieds - 4.2.4
  2. freeze2 Super Moderator

    This is the basic search form that you can use on any page:

    Code:
    <form method="get" action="searchresults.php">
      <input type="text" name="searchtext" value="{$smarty.get.searchtext|escape}" />
      <input type="submit" value="Search"  />
    </form>
  3. mattp008 New Member

    Thanks Freeze2,

    I wanted to replicate the whole classified search form. ie. the one that starts with a drop down pre-populated with all the categories, then the text fields & extra fields show up once a category is selected. Ive tried copy/paste the "form" from search.tpl, but it dosen't prepopulate the categories list so no other searchable fields appear.

    thanks for your help.

    Cheers,
    Matt
  4. mattp008 New Member

    Worked it out - of course, I was thinking way too complex.

    I've solved the immediate problem by renaming the "search.php" page as "index.php".....I know that I will have to repeat the procedure after an upgrade, but can anyone think of other ramifications of this?

    Cheers,
    Matt
  5. krystle New Member

    Hi All,
    Matt I am attempting to do exactly what you mentioned. I intend to have a side search bar only (I'm assuming I need that to be in the layout.tpl file?) and that the side search bar would include all the categories/ filters etc. I did exactly what you did by copying the code however it was not connected and therefore would not auto-populate. I know I need to call the $marty function but I am confused as to how and which one to do. I have attached an image file so hopefully that may help visually to see what I'm going for. The three things I need to know how to achieve are..

    1. How to place the search bar where it s featured in the attached image (right hand side)
    2. How to 'call' the $marty functions/ search fillter options outlined in the orange side bar search area (recent listings etc).
    3. How to get it on the layout.tpl file so it is on every page of the website.


    I have more questions however I think it will be easier to ask them one at a time as to not get confused.
    :)

    Any help or direction would be greatly appreciated! Cheers

    Attached Files:

Share This Page