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 Page Woes

May 16, 2008 2:56pm

Subscribe [2]
  • #1 / May 16, 2008 2:56pm

    andculture

    24 posts

    Ok - I’ve tried searching for this and I can’t find anything. I’m having a really odd problem with my search results.

    I’ve gone into my weblog’s path settings and I’m pointing the search results to:

    http://(domain)/index.php/(template_group)/search/

    Instead everytime I search, the form points to:

    http://(domain)/index.php/search/results/(random letter/number)/

    Here’s my simple search form code:

    {exp:search:simple_form weblog="{my_template_group}" search_in="everywhere" results_page"{my_template_group}/search/" no_results_page="{my_template_group}/search/"}
        <input type="text" name="keywords" id="keywords" value="" />
        <input type="image" value="submit" src="/assets/images/btn_go.png">
        <a href="http://{my_template_group}/search/advanced/">Advanced Search</a>
    {/exp:search:simple_form}

    What am I doing wrong?

    Mod Edit: Moved to the Technical Support forum.

  • #2 / May 16, 2008 3:36pm

    Ingmar

    29245 posts

    Do you have a link to the site in question? Normally, /search/results is the default location, yes.

  • #3 / May 16, 2008 4:11pm

    andculture

    24 posts

  • #4 / May 16, 2008 4:40pm

    Ingmar

    29245 posts

    Actually, the parameter is named result_page, no “s”.

  • #5 / May 16, 2008 4:46pm

    andculture

    24 posts

    @Ingmar, but that wouldn’t explain why my form action path continues to point to a different template group—would it? I’m just really frustrated at this point with it.

    Also no search ever seems to return any results for me even when I manually enter the correct URL path in the address bar - even when I know there are those words in the posts. Grrrrr….

  • #6 / May 16, 2008 4:58pm

    Ingmar

    29245 posts

    I just tested this minimal template sucessfully:

    {assign_variable:my_template_group="test"}
    {exp:search:simple_form weblog="default_site" search_in="everywhere" 
    result_page="{my_template_group}/search/" no_result_page="{my_template_group}/search/"}
        <input type="text" name="keywords" id="keywords" value="" />
        <input type="button" value="submit">
        <a href="/{my_template_group}/search/advanced/">Advanced Search</a>
    {/exp:search:simple_form}

    A couple of suggestions:

    1) Make sure the weblog= parameter is correct. Your are using the template group currently.
    2) Make sure that {my_template_group} is actually defined.
    3) The parameters are named result_page and no_result_page. You have misspelled them.
    4) If you hardcode the link to the advanced search form, starting with the template_group, be sure to use a slash at the start

  • #7 / May 16, 2008 5:04pm

    Ingmar

    29245 posts

    By the way, are you trying to combine both search form and results on a single template? If so, this thread might be of interest to you.

  • #8 / May 20, 2008 9:58am

    andculture

    24 posts

    @Ingmar... Thanks. Apparently I was doing it correctly at one point, I just created an {if} statement which always would return no results. Oops.

  • #9 / May 20, 2008 10:02am

    Ingmar

    29245 posts

    I see. So, all set now?

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

ExpressionEngine News!

#eecms, #events, #releases