I was just looking at
GoIsSearch, and I had a thought: perhaps many people would like to be able to customize the way the Go box behaves on their wiki. And also: TWiki has the answer to that -- plugins!
And it would be pretty simple to make a new plugin routine that would take the input from the Go box (or any other text field) and tell TWiki where to go from there. And I was thinking you wouldn't even need to make it one of those one-per-site type plugins either. Have a preference variable GO_PLUGIN; the sitewide version selects the Go plugin default for the site, but then the users can use their personal topics to choose another if the site admin installs several.
The default behaviour with no Go plugin installed would be the current
GoIsTopic behaviour.
Thoughts?
--
WalterMundt - 22 Jan 2003
I like the idea of splitting the functional part of this out into a plugin.
There have been several topics recently about features there. I don't recall the names right now but there's one on dots vs. slashes (solved with a patch by Peter that's already applied), URLs in the go box, etc. I'll look for them and replace this paragraph with the links when I find them. If someone beats me to it, please just delete this paragraph anyway.
--
GrantBow - 22 Jan 2003
I second the need for a better
GoBox, but
- I doubt we net YetAnotherVariable... My vote goes for a 'go' script in twiki/bin. Well, ok, we might add some internal configuration vars, but
- I don't think its behaviour should be highly configurable. As MattWilkie pointed out in GoIsSearch, "normal" users want no extra syntax or widely varying behaviour
The implementation could be based on
PhotonSearch using Matt's syntax.
- Bonus
- if there is a standard go script available, this should be the default target for the NonExistingTopic links!
- Why?
- The underlying go search should turn up similar topics along with the actual create link, thus reducing duplicates and inconsistent naming.
- Extra-bonus
- you can trigger searches from outside with decent URLs like http://twiki.org/cgi-bin/go/Codev/go
to list all pages named '*go*'
2c by
PeterKlausner - 23 Jan 2003
I like the idea of being able to access the "Go" box via an easy url, perhaps using a seperate "go" script for now. (Later on, I'd like to see TWiki clean things up and work via a single script...but that's later.)
But I also think that making the go box flexible and extensible is a good thing. Just because
your users find the default behavior intuitive and easy-to-use doesn't mean that that applies everywhere. I'm not saying that we should make the go box syntax complicated...just that it should be configurable to be as simple or complicated as desired for the audience of any particular TWiki installation.
Personally, I think the best and most flexible way to do that is via a combination of a default implementation (possibly with some configuration via variables) and the ability for plugins so override the default implementation if they so desire. I like the idea of something being easy for "normal" users, but I think it should be possible to redefine "normal" in terms of the target audience of a wiki. If I'm setting up a wiki for a pack of Unix/sed/Perl gurus, then I might want the Go box to do a regular expression search by default.
As an alternative to the GO_PLUGIN syntax, the plugin script could pass the "go" search text to each goOverrideHandler in turn. If the handler returns some text, then that is the page to output and processing is stopped. Alternatively, handlers can return 0 or undef, thus passing control to other handlers...if no handler takes over the request, then it is passed to the default implementation.
Benefits:
- Default, simple implementation available to everyone, with predictable/intuitive syntax.
- Configurable to do something different by default when desired - just write a plugin that always overrides.
- Easy to add alternate syntaxes, like "google:search" or "define:word" or "regex:[0-9][a-z][0-9]", without interfering with the basic behavior, in a modular and easily-configurable manner.
--
WalterMundt - 23 Jan 2003
Walter, the idea of a
go script is something I never considered before. Your approach to implementation sounds FANTASTIC to me. It would be a natural way to help split out the functions contained by the go box. This seems like a very elegant way to handle lots of features!
I would also LOVE to reconfigure the GO box for my own use since what I do 80% of the time is a topic name key word search only. Flexibility, TIMTOWDI. Sounds very TWikiesk (TWiki like) to me.
--
GrantBow - 24 Jan 2003