Need Search Help

Brian Rivet's Avatar

Brian Rivet

05 May, 2012 02:55 AM

Hi,

I'm working on a site using Structure and I'm running into an issue trying to get my search results to display.

I'm using a simple search form and I had the search page set to "pages/searchResults" with pages being the template group and searchResults being the template. When I tried to see the results I kept getting the 404 page instead. So I went over the support postings because I was thinking it might be an issue with how Structure processes the URLs. I found a post with a similar issue and I tried moving the search results page to a new group called "search". Now I don't get the 404, but I get a blank screen when it should be showing results. It's like it isn't processing the template at all. Can you guys tell me if this sounds like a Structure issue or an EE issue?

I'm running EE 2.4.0, Structure 3.2.3.

Here's the code from the template for the search form:

{exp:search:simple_form search_in="entries" results_page="search/searchResults" no_results_page="search/searchResults"}
<input name="submit" type="image" id="submit" class="searchButton" value="submit" src="/assets/images/gobutton.png">
<input name="keywords" type="text" id="keywords" class="searchField">
{/exp:search:simple_form}

And here's the results template:

{doctype}
<head>
<meta charset=UTF-8" />
<meta name="keywords" content="{defaultKeywords}">
<meta name="description" content="{defaultDesc}">
<title>LM Cases</title>

{commonHead}

</head>

<body onLoad="MM_preloadImages('/assets/images/navrollbg.png','/assets/images/subnavbg.png')">
{pageHeader}
<div id="mainContentWrapperTop">
<div id="mainContentWrapperBottom">
<div id="contentBlock">
  <h2>Search Results</h2>   

  <div class="mainContent">
<h3>Search Terms: {exp:search:keywords}</h3>
{exp:search:search_results paginate="bottom"}

{if total_results== "0"}
No results were found.    
{/if}
<div class="searchListing">
<a href="{page_url}"><h4>{title}</h4></a>
{excerpt}<br><a href="{page_url}">More...</a>
</div>    

{paginate}
    <p class="pagination">Page {current_page} of {total_pages} pages {pagination_links}</p>
{/paginate}

{/exp:search:search_results}    


  </div><!--mainContent-->

</div><!--contentBlock-->
  </div><!--mainContentWrapperBottom-->
</div><!--mainContentWrapperTop-->
{embed="embeds/.pageFooter"}
</body>
</html>

If you guys can shed any light on this I'd really appreciate it.

Thanks!

Brian

  1. Support Staff 2 Posted by Travis Schmeisser on 05 May, 2012 04:50 AM

    Travis Schmeisser's Avatar

    First pass, simplify your template. What is page_url outputting?

  2. 3 Posted by Brian Rivet on 05 May, 2012 12:04 PM

    Brian Rivet's Avatar

    Hey Travis, I found it. I wasn't Structure. I had the parameter titles misspelled.

    Thanks,

    Brian

  3. Support Staff 4 Posted by Travis Schmeisser on 05 May, 2012 06:55 PM

    Travis Schmeisser's Avatar

    No worries.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

20 May, 2013 08:51 PM
20 May, 2013 05:13 PM
20 May, 2013 12:16 PM
20 May, 2013 01:18 AM