Difference between revisions of "Template:RegName"

From BattleMaster Wiki
Jump to navigation Jump to search
m (Hmm... gotta go, I don't know if this works or not....)
 
m (more changes)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>[http://battlemaster.org/stable/RegionDetails.php?Name={{{1}}} {{{1}}}]</includeonly><noinclude>
+
<includeonly>[http://battlemaster.org/{{:Template:Regname/{{{1}}}}}&Name={{{2}}} {{{2}}}]</includeonly><noinclude>
 
__NOTOC__
 
__NOTOC__
 
== Usage ==
 
== Usage ==
 
'''All parameters, horizontal format'''
 
'''All parameters, horizontal format'''
<pre>{{RegName|Region Name}}</pre>
+
<pre>{{RegName|Island Abbreviation|Region Name}}</pre>
 +
* '''Island Abbreviation''' is the abbreviation of the island name, as listed in [[Template:Reglink]].
 
* '''Region Name''' is the exact name of the region. You must include all spaces, punctuation, and accented characters exactly as used in the game.
 
* '''Region Name''' is the exact name of the region. You must include all spaces, punctuation, and accented characters exactly as used in the game.
  
Line 12: Line 13:
 
This template isn't all that useful for a few reasons:
 
This template isn't all that useful for a few reasons:
 
# You can log into BattleMaster using either http://www.battlemaster.org or http://battlemaster.org. If you log into the URL ''without'' the "www", and then try to follow a link ''with'' the "www", the link will fail, and vice versa. As a result, the link created by a template using one form of the URL will ''always'' fail for people that use the other form of the URL.
 
# You can log into BattleMaster using either http://www.battlemaster.org or http://battlemaster.org. If you log into the URL ''without'' the "www", and then try to follow a link ''with'' the "www", the link will fail, and vice versa. As a result, the link created by a template using one form of the URL will ''always'' fail for people that use the other form of the URL.
# The link will only work if the link is for the last island you logged in to. If it is not, then you will get an error message. i.e. if you are logged in to the East Island and you follow a link to a region on Beluaterra, you will get "Error: can't find region data."
+
# The link will only work if you have logged in to the game, and played at least one character. It does not matter what island the character is on, or what island the link points to.
# Special characters: If the region name uses special characters, such as "Ünterstrom", then it may not be possible to get the link to work due to the way browsers encode such characters. I haven't been able to get them to work at all. (This may only apply to a few regions on Dwilight. I don't think the other islands have region names with accented characters.)
+
# Region names with spaces are not properly handled. There is a function in MediaWiki called [http://meta.wikimedia.org/wiki/Help:Parser_function parser functions] that should be able to handle this, but the urlencode parser functions don't seem to work at all. This is odd, because other parser functions, such as <nowiki>{{lc:}}, {{uc:}}, and {{localurl:}}</nowiki> seem to work just fine.
 +
# Special characters: If the region name uses special characters, such as "Ünterstrom", then it may not be possible to get the link to work due to the way browsers encode such characters. I haven't been able to get them to work at all. (This may only apply to a few regions on Dwilight. I don't think the other islands have region names with accented characters.) The urlencode parser funciton would probably take care of this, too.
  
If these are ever fixed (maybe for War 2.0) then this template could actually be useful. Until then, it's really just an academic exercise. Even fixing #1 would make this template moderately useful.
+
If these are ever fixed (maybe for War 2.0), or can be worked around somehow) then this template could actually be useful. Until then, it's really just an academic exercise. Even fixing #1 would make this template moderately useful.
  
 
==Example==
 
==Example==
* <nowiki>Atamara: {{RegName|Siver}}</nowiki> = {{RegName|Mnt Sinclair}}
+
* <nowiki>Atamara: {{RegName|AT|Siver}}</nowiki> = {{RegName|AT|Siver}}
* <nowiki>Beluaterra: {{RegName|Eno}}</nowiki> = {{RegName|Eno}}
+
* <nowiki>Beluaterra: {{RegName||BT|Eno}}</nowiki> = {{RegName|BT|Eno}}
* <nowiki>Colonies: {{RegName|Naan Forest}}</nowiki> = {{RegName|Naan Forest}}
+
* <nowiki>Dwilight: {{RegName|DW|Madina}}</nowiki> = {{RegName|DW|Madina}}
* <nowiki>Dwilight: {{RegName|Madina}}</nowiki> = {{RegName|Madina}}
+
* <nowiki>East Island: {{RegName|EC|Perdan}}</nowiki> = {{RegName|EC|Perdan}}
* <nowiki>East Island: {{RegName|Perdan}}</nowiki> = {{RegName|Perdan}}
+
* <nowiki>Far East: {{RegName|FEI|Anacan}}</nowiki> = {{RegName|FEI|Anacan}}
* <nowiki>Far East: {{RegName|Anacan}}</nowiki> = {{RegName|Anacan}}
+
* <nowiki>Colonies: {{RegName|CO|Naan Forest}}</nowiki> = {{RegName|CO|Naan Forest}} ''(shows the problem with spaces)''
 +
* <nowiki>Colonies: {{RegName|CO|Naan%20Forest}}</nowiki> = {{RegName|CO|Naan%20Forest}} ''(shows the ugly hack to make it work)''
 +
* <nowiki>Dwilight: {{RegName|DW|Ünterstrom}}</nowiki> = {{RegName|DW|Ünterstrom}} ''(shows the problem with accented charact3ers)''
  
 
[[Category:Utility Templates]]
 
[[Category:Utility Templates]]
 
</noinclude>
 
</noinclude>

Latest revision as of 18:35, 25 November 2008


Usage

All parameters, horizontal format

{{RegName|Island Abbreviation|Region Name}}
  • Island Abbreviation is the abbreviation of the island name, as listed in Template:Reglink.
  • Region Name is the exact name of the region. You must include all spaces, punctuation, and accented characters exactly as used in the game.

Description

This template will allow you to easily link a region name to the IG region page for that region.

Limitations

This template isn't all that useful for a few reasons:

  1. You can log into BattleMaster using either http://www.battlemaster.org or http://battlemaster.org. If you log into the URL without the "www", and then try to follow a link with the "www", the link will fail, and vice versa. As a result, the link created by a template using one form of the URL will always fail for people that use the other form of the URL.
  2. The link will only work if you have logged in to the game, and played at least one character. It does not matter what island the character is on, or what island the link points to.
  3. Region names with spaces are not properly handled. There is a function in MediaWiki called parser functions that should be able to handle this, but the urlencode parser functions don't seem to work at all. This is odd, because other parser functions, such as {{lc:}}, {{uc:}}, and {{localurl:}} seem to work just fine.
  4. Special characters: If the region name uses special characters, such as "Ünterstrom", then it may not be possible to get the link to work due to the way browsers encode such characters. I haven't been able to get them to work at all. (This may only apply to a few regions on Dwilight. I don't think the other islands have region names with accented characters.) The urlencode parser funciton would probably take care of this, too.

If these are ever fixed (maybe for War 2.0), or can be worked around somehow) then this template could actually be useful. Until then, it's really just an academic exercise. Even fixing #1 would make this template moderately useful.

Example

  • Atamara: {{RegName|AT|Siver}} = Siver
  • Beluaterra: {{RegName||BT|Eno}} = Eno
  • Dwilight: {{RegName|DW|Madina}} = Madina
  • East Island: {{RegName|EC|Perdan}} = Perdan
  • Far East: {{RegName|FEI|Anacan}} = Anacan
  • Colonies: {{RegName|CO|Naan Forest}} = Forest Naan Forest (shows the problem with spaces)
  • Colonies: {{RegName|CO|Naan%20Forest}} = Naan%20Forest (shows the ugly hack to make it work)
  • Dwilight: {{RegName|DW|Ünterstrom}} = Ünterstrom (shows the problem with accented charact3ers)