[Pmwiki-users] Intermaps - is there another way??
Patrick R. Michaud
pmichaud
Wed Jan 5 12:47:47 CST 2005
On Wed, Jan 05, 2005 at 01:07:17PM -0500, Neil Herber wrote:
> I have been trying to use an InterMap in my "localmap.txt" file that looks
> like this:
>
> MediaWiki http://wikipedia.sourceforge.net/
>
> What I really want to have happen is that any time someone enters
> "MediWiki" it will be automatically linked to the external URL. However,
> the markup requires a trailing colon and at least one non-blank character.
> Is there any clean way to have "hot words" like MediaWiki link to external
> URLs without any extra markup?
Try the following in config.php:
Markup('MediaWiki', '<wikilink',
'/\\bMediaWiki\\b/e',
"Keep(\"<a href='http://wikipedia.sourceforge.net'>MediaWiki</a>\",'L')");
This is demonstrated at http://www.pmwiki.org/wiki/Test/MediaWiki .
I'll add a description of this to the Cookbook.
> I would classify these items as permanent WikiWords or automatic WikiWords.
> I would prefer to manage them in an InterMap-like table, but a PmWiki page
> would be OK too (and easier to edit!).
Would an array be okay?
$WordReplacements = array(
'MediaWiki' => 'http://wikipedia.sourceforge.net',
'Neil' => '/wiki/Profiles/NeilHerber',
'Adobe' => 'http://www.adobe.com'
);
Also, one of the problems with "automatic words" is that *every*
instance of the words are converted, which can be quite annoying
if a name or phrase is repeatedly used in a page. So, there
would probably need to be a way to limit the number of automatic
conversions that take place.
Perhaps another option is to remove the non-blank character
requirement from InterMap links, but continue to use the colon
as the distinguishing markup. Thus, "MediaWiki:something" works
as before, "MediaWiki" continues to be a WikiWord (if WikiWords
are enabled), and "MediaWiki:" is an InterMap link that renders
without the colon. Similarly, "Neil" is an ordinary word,
but "Neil:" is a link to the profile page that displays as "Neil".
Pm
More information about the pmwiki-users
mailing list