Template:JumpMap from World
This is the intermediate template to convert the output of the Template:World or Template:WorldS into the parameters required for Template:JumpMap.
The JumpMap requires two parameters: A sector name (unadorned) and a hex location within the sector.
Since both the World and WorldS templates produce this information in the form of (<Sector Name> <Hex Location>)
The #explode splits a string (the output of the templates in this case) into two parts and returns one of the parts.
The inner most #explode split the string on a "(", and returns the last piece. The next #explode splits the string on a ")" and returns the first piece.
At this point we have a "[[<name> Sector|<name>]] <hex>" string
In the first parameter, the #explode splits the string on a vertical pipe and returns the first piece. The #sub (substring) function then trims the first two characters and the last 7 characters, returning just the <name>. This is #urlencoded as some sector names contain characters which are not allowed in URL.
for the second parameter #explode splits on a space and returns the last value.
- ↑ "Jump Map API" and map location from Travellermap.com
- ↑ "Jump Map API" and map location from Travellermap.com