0

Wonder if anyone else bumped into this issue using Structure & Low Search. Enabling strict URL's results in a 404 on search which {segment_2} triggers.

The 404 rule looks for the template name which won't be there as Structure doesn't work like that, so how can I tell the search module what the template name is?

Low suggested using Freebie, but before I delve into yet another add-on to patch an add-on I was hoping to find a solution here:-)

Low Search code:

{exp:low_search:results query="{segment_2}" status="not closed" disable="categories|member_data"}    
{if count == 1}    
<p class="">    
{if low_search_keywords}You searched for <strong>{low_search_keywords}</strong>{/if}    
and we have found <strong>{absolute_results}</strong> matches.    
</p>    
{/if}{/exp:low_search:results}    
</div>    
{exp:low_search:results query="{segment_2}" status="not closed" disable="categories|member_data"}    
<div class="entry">    
{if page_url != ''}    
<a href=" {page_url}"> <h4>{title}</h4></a>    
{if:else}    
<a href="{comment_url_title_auto_path}"> <h4>{title}</h4></a>    
{/if}    
<p>Found in <a href="{comment_url_title_auto_path}" class="red"> {low_search_collection_label}</a>.</p>    
<p>{low_search_excerpt}</p>    
</div>    
{paginate}    
<p>Page {current_page} of {total_pages} pages {pagination_links}</p>    
{/paginate}    
{if no_results}    
<p>    
Sorry, your query did not return any results.    
Check your spelling or try a different search term.    
</p>    
{/if}    
{/exp:low_search:results}

Running EE 2.5+ & all add-ons up-to-date

2
  • Could you not replace page_url with page_uri at least for your returned pages ? May 27, 2013 at 5:48
  • Why not make your search results page a standard template group, not managed by Structure? May 27, 2013 at 12:50

1 Answer 1

2

Unfortunately there wont really be an easier way than with Freebie. It's designed for this very purpose when you need EE to ignore certain URL segments and comes in very handy when dealing with Structure because of the way it deviates from EE's native URL handling.

In the case of both strict URL handling and Structure you definitely need to break those URL segments.

1
  • I think I have a similar issue whereby the pagination links for Low search work with the exception of returning to the 1st page of results... any idea what I might need to do with freebie to rectify such a problem? Apr 15, 2014 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.