This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

carpentier.o52569
carpentier.o52569

Hi,

I've just installed the "siteSearch" plugin.

I've put this code in my home page (in a partial) :

<form action="{{ 'search' | page }}" method="get">
<input name="q" type="text" placeholder="What are you looking for?" autocomplete="off">
<button type="submit">Search</button>
</form>

In the partial, I've added "search results" + "include site search" + "search input" components.

Then I've created a "search.htm" with this code, as mentioned in documentation :

title = "Search results"
url = "/search"
layout = "default"
is_hidden = 0

[searchResults]
resultsPerPage = 10
showProviderBadge = 1
noResultsMessage = "Your search did not return any results."
visitPageMessage = "Visit page"
==
<h2>Search results for {{ searchResults.query }}</h2>

{% component 'searchResults' %}

I've also add to this page "search results" + "include site search" + "search input" components. Finally, I've created another page with lorem ipsum paragraph.

When I write "lorem" in my searchbar, I've the "search?q=lorem" in the url but it induces an error page (Unable to display the page).

When I rewrite in the "search.htm" page with this reduced code :

<h2>Search results for {{ searchResults.query }}</h2>

{% component 'searchResults' %}

I've no error but also no results in the page, I just see "Search results for lorem ", and I have the message "Your search returned no results."

The parameters in CMS backend are the followings :

Mark matches in search results : ON
Log queries : OFF
RainLab.Pages
    Use this provider : ON
    Provider badge : Page 

Thanks for helping me BR, Olivier

Last updated

carpentier.o52569
carpentier.o52569

Hi myself,

for noobs like me, you have this excellent tutorial that explain how to add a search bar for your site :

https://www.youtube.com/watch?v=BNXQyjlLihM

Bye

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.