[pmwiki-users] ExternMap?

Hans design at softflow.co.uk
Mon Jan 30 07:46:54 CST 2006


Monday, January 30, 2006, 12:26:35 PM, Christophe wrote:
>>> Is there a feature similar to InterMap that allows External links to
>>> non-wiki sites?  I know I can use [[www.example.com|my site]], but I'd
>>> rather be able to type a single word and have it automatically map to
>>> the external site instead of trying to remember to link it manually
>>> each time...

>> One doesn't exist yet... but as long as we're creating a
>> Site.InterMap page, perhaps a generic version that allows
>> one to map any word to any address is a good idea...?

> Can someone please tell me if this is already in the 2.1 betas, or when it
> is likely to be implemented ?

i am a bit puzzled about the previous answer, but can't find the
message. So excuse me if i am jumping in at the wrong end.

Intermap allows links to be mapped to non-wiki sites, in a fashion.
Inter Map links have the form MapPrefix:Page.
So i can define an intermap prefix like:

google:     http://google.com

and can use a link to it in a page like [[google:/]]
This can be a convenient way to link a site root.
The slash takes the space of the page, and it needs the : as
a separator between prefix and page. So it is not a true alias.

Another way to avoid typing of frequently occurring long urls would be
to set up a "macro-button" as part of the gui-edit buttons, which will
insert your favorite link with just a click.

Example:
$GUIButtons['favlink1'] = array(700,
'\[\[http://example.com/path/samplepage.html|Sample page\]\]', '', '',
                  '$GUIButtonDirUrlFmt/favlink.gif"$[Sample Page]"');

Replace the link url etc with your favourite, and upload a convenient
small gif image to serve as a button.

The disadvantage with this method is that the link is inserted into
the page and can't be changed later by changing just the link mapping
as is possible with an intermap file.

And a third way which works more like true aliases is to define custon
page variables for favourite links.

Example:
define in config.php:
$FavLink = '[[http:example.com/path/samplepage.htm| Sample]]';
$FmtPV['$FavLink'] = '$GLOBALS["FavLink"]';

Usage in page:  {$FavLink}
which will be replaced by the link.

Use any convenient variable name instead of $FavLink, as long as it
is not used by pmwiki or a cookbook script.


Best, 
~Hans                           






More information about the pmwiki-users mailing list