Results 1 to 4 of 4

Thread: Move search-form to a block?

  1. #1
    mphed Guest

    Default Move search-form to a block?

    Would it be possible to move the Search-function (in the header in the originla Kosmos-theme) to a block which I could place wherever I like?

  2. #2
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    No need to make it as a block. It's easier to put it in separate file. Let's call it search_box.html
    Code:
          <form method="get" action="search.php">
            <&#37;if $category_path_search_opt%>
            <input type="hidden" name="cat" value="<%$cat%>" />
            <%/if%>
            <input type="text" name="keyword" size="20" value="<%$keyword%>" />
            <select name="opt">
              <option value="0">the entire directory</option>
              <%if $category_path_search_opt%>
              <option value="1">Only in <%$category_path_search_opt%></option>
              <%/if%>
              <%if $opt eq "2"%>
              <option value="2" selected="selected">on the web</option>
              <%else%>
              <option value="2">on the web</option>
              <%/if%>
            </select>
            <input type="submit" value="Search" />
          </form>
    Then to load it in any template files, use the following command:
    Code:
    <%include file="search_box.html"%>

  3. #3
    Join Date
    Feb 2007
    Posts
    51

    Default

    It doesn´t work. I get the following error message:

    PHP Code:
    WarningSmarty errorunable to read resource"search_box.html" in /customers/domain/domain/httpd.www/lib/smarty/Smarty.class.php on line 1088 
    I have replaced my own domain in the code above with "domain". Otherwise I have done exactly as you wrote. I´m trying to include the file in the template index.html.

    Do I have to make any changes to any Smarty-file?

  4. #4
    Join Date
    Aug 2001
    Location
    Indonesia
    Posts
    3,732

    Default

    Have you created search_box.html? It must be placed in the active theme you have, by default in /themes/kosmos/search_box.html

Similar Threads

  1. Replies: 1
    Last Post: 08-20-2006, 11:21 PM
  2. Bulk move from one catagory to another
    By hdraye in forum v5.x
    Replies: 2
    Last Post: 08-08-2006, 02:52 AM
  3. Move Site
    By cjs in forum v5.x
    Replies: 7
    Last Post: 05-03-2005, 09:14 AM
  4. Replies: 19
    Last Post: 06-09-2004, 04:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •