Question
No, not a regex question. I'm looking at
ChangeRequest which uses a
form attached to a template.
When searching on a form field, e.g. the output on
ChangeRequest,
the template topic does not appear in the search output. That's good.
In my adaptation, the template topic does get listed.
I suspect the difference is that instead of forcing people to make a
selection from dropdown lists on the form each time, I have it set to the
usual initial defaults for user convenience (and because they forget to do it).
Of course the form is embedded in the template topic in its default state,
so any search to pick up newish change requests will pick up my template too
because they have exactly the same strings in the files. If I'm right, it
could be handy to have an extra search option to exclude any "...Template"
topic name, but I don't have the perl skills to do that.
So how do people usually tackle this situation? Is it worth trying to nest
the present search inside a regex topic name search, or vice versa? Or is it
not feasible to accommodate the users to this extent (with interesting
defaults set in the fields to be searched)?
- TWiki version: Feb2003
- Perl version: 5.00x
- Web server & version: Apache
- Server OS: FreeBSD
- Web browser & version: Lynx
- Client OS: FreeBSD
--
SueBlake - 20 Jul 2003
Answer
TWiki ways:
If you use a form field like TopicClassification as the key, leave the value undefined in the template (e.g.
Select one...). You can set the value in the form that creates the topic. See
ChangeRequest for an example.
Add
%NOP% or
%NOP{ any text }% into the text of the template that serves as the key for your search. Those tags get filtered out once a topic is created based on the template. For example, if you search for
"Back to XYZ" (your key), write
"Back to %NOP%XYZ" in your template. See
TWikiFAQ for an example.
--
PeterThoeny - 20 Jul 2003