Tags:
create new tag
, view all tags

Question

I've been having a lot of fun searching for pages based on their FORMFIELD (and other META) data. I start out with a simple HTML form and search based on the data entered in the fields.

The one thing I don't like is that the page initializes with "Search for *". I want it to come up empty.

Example:

<form action="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/%WEB%/%TOPIC%"> 
<input type="submit" value="Search" />
%TABLE{headerbg="#CCCCFF" columnwidths="50"}%
| *Search For<br />Author* | *Topic* | *Created<br />On* | *Created<br />By* | *Modified<br />On* | *Modified<br />By* | *Revision* |
|\
<select name="qBy" size="1">\
    <option selected="selectedYahoo"></option>\
     <option value="PeterThoeny">Peter Thoeny</option>\
   <option value="VickiBrown">Vicki Brown</option>\
  </select>|\
&nbsp;&nbsp;|\
&nbsp;&nbsp;|\
&nbsp;&nbsp;|\
&nbsp;&nbsp;|\
&nbsp; &nbsp; |
%SEARCH{"META:TOPICINFO.*?author\=.*?%URLPARAM{"qBy"}%" web="%INCLUDINGWEB%" regex="on" nosearch="on" nototal="off" regex="on" noheader="on" format="|<nop>%URLPARAM{"qBy"}% | [[$topic]] | $createdate | $createwikiusername | $date | $wikiusername | $rev |" }%
</form>

When I open the page, I want to see

Screensshot.jpg

perferably, quickly!

Instead, I see the list of all topics in the current web.

I've tried rearranging the .*? in the search but it spins (which implies it's trying a bad search).

I'm trying to work out the syntax using CALC... (no luck so far)

is there a simpler solution?

Environment

TWiki version: TWikiRelease04x00x05
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Search

-- VickiBrown - 07 Jul 2007

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

I found this method. Is there anything "simpler"?

%IFDEFINEDTHEN{"" }% 
%TABLE{headerbg="#CCCCFF"}%
| *Search For<br />Author* | *Topic* | *Created<br />On* | *Created<br />By* | *Modified<br />On* | *Modified<br />By* | *Revision* |
%SEARCH{"META:TOPICINFO.*?author\=.*?" web="%INCLUDINGWEB%" regex="on" nosearch="on" nototal="off" noheader="on" 
 format="|<nop> | [[$topic]] | $createdate | $createwikiusername | $date | $wikiusername | $rev |" }% 
%ELSEDEFINED%
  select a name to search by
%FIDEFINED%

-- VickiBrown - 07 Jul 2007

(I put the search example in a verbatim block since it puts load on the twiki.org server.)

-- PeterThoeny - 07 Jul 2007

You can also specify a default value for URLPARAM, such as %URLPARAM{ "qBy" default="[S]0mething_unlikey-to-find" }%

-- PeterThoeny - 07 Jul 2007

-- SvenDowideit - 18 Aug 2007

 
Change status to:

Topic attachments
I Attachment Action Size Date Who Comment
JPEGjpg Screensshot.jpg manage 22.8 K 2007-07-07 - 21:02 VickiBrown Screenshot
Topic revision: r3 - 2007-08-18 - SvenDowideit
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.