Question
I often reference external sites via a
WikiWord - e.g.
PubMed
several times in a page. I would like to change TWiki to default subsequent unadorned
WikiWords like
PubMed to the last defined forced link URL, if there is one defined earlier in the page. So, even if there was a page in the current web called
PubMed it would still default to my first specified URL if I defined one earlier in the page. Otherwise I have to create a new page for
PubMed and put a link in there to avoid repeating the URL constantly - and I'm lazy :).
An alternative might be for me to use the
InterWikiPlugin and always call things
PubMed: or something like that - but that's not really what I want. I don't mind having to define the URL once the first time in a page.
Another alternative might be to have per-web
InterWikiPlugin definitions and extend
InterWiki to also look up words without a ':' and replace them with the relevant URL.
Environment
--
TimSlidel - 29 Jul 2003
Answer
Will a variable
%PUBMED% (set in
WebPreferences) help?
--
PeterMasiar - 30 Jul 2003.
Not really, I could work something out for my own use, but for others it would need to be based on an extension of the normal wikiword usage. It's not just the one pubmed example that I need to use - there are lots of references to external (non-wiki) web sites. I imagine an implementation would be something like generating a hash of wikiword-url pairs when processing a page and re-using the same url whenever the same wikiword appears (with no braces) later on (unless a special variable is set to disable this). Thanks for the suggestion.
--
TimSlidel - 01 Aug 2003
You could create a Plugin where you keep track of your list of reserved words (with links). In the
outsidePREHandler() you can scan for the reserved words and turn them into links.
--
PeterThoeny - 02 Aug 2003