PITS /
01240: add a newwin param to the searchbox markup
Summary: add a newwin param to the searchbox markup
Created: 2011-01-06 04:10
Status: Suspended
Category: Feature
From: joan-vilaseca?
Assigned:
Priority: 3
Version: latest
OS:
Description: To add a 'newwin=target' param to the searchbox syntax to change the html target of the generated search results. For example, in a new window (target="_blank").
How to:
Modify the SearchBox function in pagelist.php.
Change:
$out = FmtPageName(" class='wikisearch' action='\$PageUrl' method='post'>", $target);
and
if ($k == 'q' || $k == 'label' || $k == 'value' || $k == 'size' ) continue;
For:
$bb=$opt['newwin']; if ($bb!="") $out = FmtPageName(" class='wikisearch' action='\$PageUrl' method='get' target='$bb'>", $target); else $out = FmtPageName(" class='wikisearch' action='\$PageUrl' method='post'>", $target);
and
if ($k == 'q' || $k == 'label' || $k == 'value' || $k == 'size' || $k == 'newwwin' ) continue;
Hello. Because no one ever asked to be able to chose the window target for the search form, I feel that this feature is not required by most PmWiki users. Until it is, without modifying core files, you can either redefine the (:searchbox:) markup to use your own modified function, or create a custom search form with the elements supported by PmWiki.Forms. We could add a Cookbook recipe for this feature. --Petko January 06, 2011, at 08:48 AM