Entry link in search result is URL to current search, not to the entry
I have Search working across several channels. It works fine on all except one channel, where the entry link in the search result doesn't link to the found entry - it links to the current search result, ie.
http://mywebsite.com/search/results/e...
instead of http://mywebsite/segment-1/title-of-e...
This happens only to entries in the search results list for this one channel - the other channels have links that correctly point to the entry.
That is, if a search result lists 10 results, only the ones from the problem channel has the wrong URL.
So it seems the search is working, but for some reason on search results from that one channel, LS is putting in the current page URL (the search result URL) rather than the entry URL for the search result.
Here is the code from the results page:
{exp:low_search:results query="{segment_3}" status="not closed" limit="10" disable="member_data"}
{if count == 1}
<p>
{if low_search_keywords}Searched for <strong>{low_search_keywords}</strong>.{/if}
Total results: <strong>{absolute_results}</strong>.
</p>
{/if}
<div class="entry">
<h3><a href="{structure:page_url_for:{entry_id}}">{title}</a></h3>
<p>Relevance score: {low_search_score}.</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}
If I use {page_url} in the search result the same thing occurs - no change to the result.
Thanks. Greg.
Replies
Low 3 Dec 2013 07:02
You'll probably get the same effect when using the native channel:entries tag, right? If so, that would point to a non-LS related issue.
My guess is you need to check your Channel's preferences (path settings) and set the path correctly there. http://ellislab.com/expressionengine/...