Show result of a search on a given page

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
mrbs

Show result of a search on a given page

Post by mrbs »

Hi!

What code do I use to display the result of a search on a given site?

mrbs
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Show result of a search on a given page

Post by RonnyK »

From the help of search, through "Modules -> Search -> Help":
(optional) resultpage="null" - Page to display search results in.
This can either be a page alias or an id.
Used to allow search results to be displayed in a different template from the search form.
If you create a new page, give it a name, on the options-tab, uncheck "show in menu", to make it not visible in the menu. Call that page in the calling of search,

Code: Select all

{search submit="test" searchtext="" resultpage="pagename"}  
resultpage, sets the page to open the results in.
searchtext, sets the default text in the search-box.
submit, sets the label of the search-button.

Ronny
mrbs

Re: Show result of a search on a given page

Post by mrbs »

I know how to show the form, and when i submit, the right page is shown, but it doesn't show any search results. How do I tell where to submit the result??
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Show result of a search on a given page

Post by RonnyK »

The search-module "Search" just searches your own CMS site, for pages that DON'T have the "atrribute NotSearchable". Basically if you have specific text on a content page, the search should find it.

Ronny
mrbs

Re: Show result of a search on a given page

Post by mrbs »

Well it doesn't  ;)

You can see it in work here:

www.caupo.dk

I understand how it works - but I imagine that I have to tell the CMS where on a specific page I want the search module to display the results... Or have I misunderstood something?
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Show result of a search on a given page

Post by RonnyK »

How do you call the search-module in your template page?

You don't have to say where you want to show the results, if you don't specify a resultpage, it replaces the content of the page you where on while requesting the search.

Ronny
mrbs

Re: Show result of a search on a given page

Post by mrbs »

In the template i call the search form like this:

{search inline="true" searchtext="" resultpage="resultat" submit="Søg"}
RonnyK
Support Guru
Support Guru
Posts: 4962
Joined: Wed Oct 25, 2006 8:29 pm

Re: Show result of a search on a given page

Post by RonnyK »

Can you try what happens if you remove the "inline"-part.

Ronny
mrbs

Re: Show result of a search on a given page

Post by mrbs »

Thank you so much! That did it!

mrbs :)
Locked

Return to “CMSMS Core”