01299: Allow "Results of search" message to be disabled from searchresults directive

Summary: Allow "Results of search" message to be disabled from searchresults directive
Created: 2012-10-06 16:48
Status: Open
Category: Feature
From: simon
Priority: 3

Description: Enable the request=1 or req=1 parameters on the (:searchresults:) or (:searchbox:) directives to remove the "Results of search for" message


(:pagelist request=1 req=1:)

If you don't want the message to appear, simply use (:pagelist request=1 req=1:) instead of (:searchresults:). If the documentation is not clear enough, feel free to improve it. --Petko July 23, 2015, at 04:57 AM

The searchresults directive seems to be required on the page, although the documentation makes it appear otherwise. Maybe someone who understands what is required can explain it.

For example, if I want to show search results without the text "Results of search for..." at the top and without the "...pages found..." at the bottom, it seems I need to include but comment out the searchresults directive. Is that the way it's supposed to work?

This works:

(:pagelist request=1 req=1:)

This doesn't:

(:pagelist request=1 req=1:)
When a search is performed, if the current page contains a searchresults directive, the current page is rendered, with whatever it contains above and below the searchresults. If the current page does not contain a searchresults directive, the page Site.Search is rendered instead of the current page. So your second example will indeed not work in a regular page, but it will work in Site.Search (or whatever international page name is defined like PmWikiFr.Search). --Petko July 23, 2015, at 02:38 PM

The searchresults directive is exactly the same as pagelist request=1 req=1 only uses a different output format. You can remove the lines above and below the generated list by adding this in config.php:

  $SearchResultsFmt = '$MatchList';

or in any local/Group.Page.php file. --Petko July 23, 2015, at 02:46 PM