ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Search Engine Issue

August 09, 2010 7:00pm

Subscribe [6]
  • #1 / Aug 09, 2010 7:00pm

    TCSLions

    12 posts

    Original Search Code:

    <!-- SEARCH BAR         - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  -->        
     
            <div id="search_box"> 
                <form id="search_form" method="post" action="/"> 
                    <input type="text" id="s" value="Search" class="swap_value" /> 
                    <input type="image" src="images/clear.gif" width="29" height="29" id="go" alt="Search" title="Search" /> 
                </form> 
            </div>

    I am trying to plug in the correct code to make the results show on my “search/index” page.

    Been trying to follow - http://ellislab.com/expressionengine/user-guide/modules/search/index.html, but obviously it doesn’t match up perfectly.

    The website is http://www.tcslions.org/tcs - I’ve just about got all the big rocks done, but this issue. I’ve racked my brain around every tutorial I can find, I started using EE cause I was told it was designer friendly… help please.

  • #2 / Aug 10, 2010 3:41am

    John Henry Donovan

    12339 posts

    TCSLions,

    If you are using version 1 of EE you need to be using the correct documentation.

    Have you tried the Simple Search Form?

    {exp:search:simple_form channel="news"}
    
    <label for="keywords">Search:</label>
    
    <input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" /></p>
    
    <input type="submit" value="submit" class="submit" /></p>
    
    {/exp:search:simple_form}
  • #3 / Aug 10, 2010 2:09pm

    TCSLions

    12 posts

    I placed that in there and and still errors out to system created page. I’ve been able to figure everything else out up to this point.

    RB

  • #4 / Aug 10, 2010 11:45pm

    Sue Crocker

    26054 posts

    RB, have you tried putting the code John posted in a stand alone template?

    Did you set a return parameter?

    http://expressionengine.com/legacy_docs/modules/search/simple.html#par_result_page

  • #5 / Aug 11, 2010 12:49am

    TCSLions

    12 posts

    That is the other thing I’m getting confused on, I don’t wanna just search “news” I want to search the whole site.

  • #6 / Aug 11, 2010 10:16pm

    Brandon Jones

    5500 posts

    TCSLions,

    You can specify multiple weblogs to search, but let’s first get it working with one. Which weblog are you trying to search? If it is indeed “news”, try

    {exp:search:simple_form weblog="news"}
    
    <label for="keywords">Search:</label>
    
    <input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" /></p>
    
    <a href="http://{path=search/index}">Advanced Search</a>
    
    <input type="submit" value="submit" class="submit" /></p>
    
    {/exp:search:simple_form}
  • #7 / Aug 11, 2010 10:45pm

    TCSLions

    12 posts

    News is fine for now, I don’t need the advanced link. I have a custom search form up top if you can see and like I said I ultimately want to search the entire site, nothing fancy, just nice and simple.

    I just put that in and got the same result. Going to try and walk back through everything again and try see if I did something wrong.

    This is what i have (located at search/index)

    <table border="0" cellpadding="6" cellspacing="1" width="100%">
    <tr>
    <th>{lang:title}</th>
    <th>{lang:date}</th>
    <th>{lang:excerpt}</th>
    </tr>
    {exp:search:search_results switch="resultRowOne|resultRowTwo"}
    <tr class="{switch}">
    <td width="30%" valign="top"><b><a href="http://{auto_path}">{title}</a></b></td><td width="10%" valign="top">{entry_date format="%m/%d/%y"}</td>
    <td width="10%" valign="top">{entry_date format="%m/%d/%y"}</td>
    <td width="50%" valign="top">{excerpt}</td>
    {/exp:search:search_results}
    </table>
    {if paginate}
    <div class='paginate'>
    <span class='pagecount'>{page_count}</span>  {paginate}
    </div>
    
    
    
    {/if}
  • #8 / Aug 12, 2010 7:15pm

    Brandon Jones

    5500 posts

    TCSLions,

    Can you confirm the version and build of EE you’re using?

  • #9 / Aug 12, 2010 9:53pm

    TCSLions

    12 posts

    1.6.9

    Build:  20100430

  • #10 / Aug 13, 2010 6:38pm

    Brandon Jones

    5500 posts

    TCSLions,

    If you make a template called search/results and put this code in it:

    <table border="0" cellpadding="6" cellspacing="1" width="100%">
    <tr>
    <th>{lang:title}</th>
    <th>{lang:date}</th>
    <th>{lang:excerpt}</th>
    </tr>
    {exp:search:search_results switch="resultRowOne|resultRowTwo"}
    <tr class="{switch}">
    <td width="30%" valign="top"><b><a href="http://{auto_path}">{title}</a></b></td><td width="10%" valign="top">{entry_date format="%m/%d/%y"}</td>
    <td width="10%" valign="top">{entry_date format="%m/%d/%y"}</td>
    <td width="50%" valign="top">{excerpt}</td>
    {/exp:search:search_results}
    </table>
    {if paginate}
    <div class='paginate'>
    <span class='pagecount'>{page_count}</span>  {paginate}
    </div>

    Then make your search/index page just:

    {exp:search:simple_form weblog="news" result_page="search/results" }
    
    <label for="keywords">Search:</label>
    
    <input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" /></p>
    
    <a href="http://{path=search/index}">Advanced Search</a>
    
    <input type="submit" value="submit" class="submit" /></p>
    
    {/exp:search:simple_form}

    Do you get redirected to the search/results template?

  • #11 / Sep 14, 2010 2:48pm

    TCSLions

    12 posts

    It errors out to this
    http://tcslions.org/tcs/index.php?/search/results/74ba6574bc4b266a72e32d7a865b86a1/

    (sorry for delay, been swamped with outer stuff)

  • #12 / Sep 15, 2010 3:07am

    John Henry Donovan

    12339 posts

    TCSLions,

    Can I confirm that the only thing you have in the index template inside the search group is the following please

    {exp:search:simple_form weblog="news" result_page="search/results" }
    
    <label for="keywords">Search:</label>
    
    <input type="text" name="keywords" id="keywords" value="" size="18" maxlength="100" /></p>
    
    <a href="http://{path=search/index}">Advanced Search</a>
    
    <input type="submit" value="submit" class="submit" /></p>
    
    {/exp:search:simple_form}

    It looks like you put the search results code in there too?
    http://tcslions.org/tcs/index.php?/search/

  • #13 / Oct 05, 2011 4:43pm

    hadri

    18 posts

    opened new thread

  • #14 / Oct 08, 2011 11:37pm

    Dan Decker

    7338 posts

    hadri,

    I take that to mean you opened a new thread to report your issue? If so, we will be helping out there.

    Cheers,

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases