Navigation

 Home Page
 twitter Twitter Feed
 ko-fi Support me on Kofi
 Series Index: A to Z|By Country|By Platform
 News Feed & Site Updates: 2019 Nov|Dec
2020 Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec
2021 Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec
2022 Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec
2023 Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec
2024 Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec
2025 Jan


BL Calendar (click image to open in new tab)
January 2025
Archive 2020|2021|2022|2023|2024|2025

Jump To
CurrentUpcomingCompleted
ShortsCancelledNot Made


 Currently Airing  (A-Z order)

Click here to expand or collapse...
Thailand Every You, Every Me (Youtube release)

 Upcoming BL Series  (Start date)

Click here to expand or collapse...
Thailand Top Form (Thu 20 Mar 2025)

 Completed Series 

Click here to expand or collapse...
Philippines Art Of Love (OFFLINE)
Philippines Beautiful Scars (Episode 4 finale OFFLINE)
Thailand Boyband (No International release)
Myanmar Healing Thingyan (OFFLINE)
Hong Kong Hehe & He (Season 3 - on hiatus)
Thailand If I Love A Boy (OFFLINE)
Philippines Indigo (OFFLINE)
Philippines Jack And Jill (OFFLINE)
Philippines Lakan (OFFLINE)
Thailand Make A Wish [Thailand] (No International release)
Thailand Missing Piece (OFFLINE)
Myanmar My
Thailand My Secret Love (OFFLINE)
Philippines Quaranthings (OFFLINE)
Thailand Roommate (Season 1 OFFLINE)
Japan Sugar Dog Life (No International release)
Thailand Venus In The Sky (Youtube release)

 One-Off BL shorts 

Click here to expand or collapse...

 Cancelled BLs (Uncompleted) 

Click here to expand or collapse...
Philippines Destined/Fated (OFFLINE)
Philippines Infinity (OFFLINE)
Philippines Kiss The Night (OFFLINE)
Philippines Overlooked Love (OFFLINE)
Thailand The Whisperer (EP10 Finale never released)
Philippines Unexpected (OFFLINE)

 Abandoned - Not Made 

Click here to expand or collapse...

Cambodia= Cambodia China= China Hong Kong= Hong Kong India= India
Japan= Japan Laos= Laos Myanmar= Myanmar The Philippines= Philippines
South Korea= South Korea Taiwan= Taiwan Thailand= Thailand Vietnam= Vietnam


edit SideBar

LinkIMap


This page describes an internal function in PmWiki's engine called LinkIMap(). The contents are not intended for those with a weak heart ;-) Admins (advanced)

Also see: PmWiki.Functions#LinkIMap, PmWiki.MakeLink

Syntax
  LinkIMap($pagename,$imap,$path,$title,$text,$fmt=NULL)

The function LinkIMap() handles links of the form scheme:path, which includes http:, https:, ftp: as well as the inter map links such as Cookbook:, PmWiki: etc.

The basic markup behind the eventual invocations of this function is as follows:

[[ <target>"<title>" | <link-text> ]]
[[ <link-text> -> <target>"<title>" ]]
https://<URI>"<title>"

The arguments to the function are as follows:

  • $pagename — a string with the name of the page context in which the link is created, this is typically simply the name of the current page. For example, $pagename could be "Group.SomePage".
  • $imap — a string denoting the scheme, i.e. the index into $LinkFunctions. For example, $imap could be "https:".
  • $path — a string with the part of the target after the scheme
  • $title — a string with the optional part after the target within quotes
  • $text — a string with the link text, from MakeLink()
  • $fmt — a string with the format string, from MakeLink()

The array $IMap is the primary array used by LinkIMap(). It says how to format a URL according to the given scheme. By default, this array is generally set as follows:

$IMap['http:'] 	    = 'http:$1';
$IMap['https:']     = 'https:$1';
$IMap['ftp:']       = 'ftp:$1';
$IMap['mailto:']    = 'mailto:$1';
        ...
$IMap['Cookbook:']  = 'https://www.pmwiki.org/wiki/Cookbook/$1';
$IMap['PmWiki:']    = 'https://www.pmwiki.org/wiki/PmWiki/$1';
$IMap['Wikipedia:'] = 'https://www.wikipedia.com/wiki/$1'; 

Note that the $1 in each case is used as a placeholder for the path component.

LinkIMap() then uses the value of $UrlLinkFmt to generate the link.

Then there is also the array $IMapLinkFmt that allows each scheme to have its own custom formatting default. The vanilla version of PmWiki doesn't use this array yet, although some cookbook recipes probably do.

Examples of custom formats to allow different styling via classes:

  • Links to http: standard url links:
    $IMapLinkFmt['http:'] =
      "<a class='httplink urllink' href='\$LinkUrl'>\$LinkText</a>";
    
  • Links to https: secure pages:
    $IMapLinkFmt['https:'] =
      "<a class='httpslink urllink' href='\$LinkUrl'>\$LinkText</a>";
    
  • Links to PmWiki: InterMap shortcut:
    $IMapLinkFmt['PmWiki:'] =
      "<a class='pmwikilink urllink' href='\$LinkUrl'>\$LinkText</a>"; 
    
  • Links to Cookbook: InterMap shortcut
    $IMapLinkFmt['Cookbook:'] =
      "<a class='cookbooklink urllink' href='\$LinkUrl'>\$LinkText</a>"; 
    

Category: PmWiki Internals

This page may have a more recent version on pmwiki.org: PmWiki:LinkIMap, and a talk page: PmWiki:LinkIMap-Talk.