Difference between revisions of "Template:A/doc"

From ISFDB
Jump to navigation Jump to search
(→‎Special case: Always include the LAZY version of the template usage)
Line 29: Line 29:
 
gives
 
gives
  
{{A|altName=Donald_Macpherson_(Novelist)}}
+
{{A|altName=Donald_Macpherson_(Novelist)}} (Note that the link has underscores visible)
  
 
and
 
and
Line 37: Line 37:
 
gives
 
gives
  
{{A|altName=Donald_Macpherson_(Novelist)|name=Donald Macpherson (Novelist)}}
+
{{A|altName=Donald_Macpherson_(Novelist)|name=Donald Macpherson (Novelist)}} (Note that the link now has spaces instead of underscores)
  
 
and  
 
and  
Line 45: Line 45:
 
gives
 
gives
  
{{A|altName=Donald_Macpherson_(Novelist)|name=Donald Macpherson}}
+
{{A|altName=Donald_Macpherson_(Novelist)|name=Donald Macpherson}} (Note that the link is clean and short, but you have to put more work into the template to get it.)

Revision as of 17:16, 31 August 2008


Documentation for Template:A transcluded from Template:A/doc.

Use this template to link to an author's name, almost as easy as just typing the name itself.

Important! Because of the way MediaWiki parses URLs, your author name cannot have any spaces in it! So you can use {{a|Author_Name}}, but not {{a|Author Name}}!

The template now automatically converts spaces to underscores as needed.

An optional name parameter allows the link to be dispalyed with a different text than the author name. So, for example, {{A|Elizabeth Moon}} gives the link Elizabeth Moon, while {{A|Elizabeth Moon|name=Moon}} gives the link: Moon.

Usage

{{A|Jack Vance}}

gives Jack Vance

while

{{A|Jack Vance|name=John Holbrook Vance}}

gives John Holbrook Vance

Special case

If the author's name contains any non-alphanumeric characters, such as ( or ) or ', the normal use of the template will convert these to hex codes, which will not create the correct URL. For this special case, use the special parameter altName, and a version of the name with spaces converted to underscores.

So if the author's cannonical name is "Donald Macpherson (Novelist)", then

{{A|altName=Donald_Macpherson_(Novelist)}}

gives

Donald_Macpherson_(Novelist) (Note that the link has underscores visible)

and

{{A|altName=Donald_Macpherson_(Novelist)|name=Donald Macpherson (Novelist)}}

gives

Donald Macpherson (Novelist) (Note that the link now has spaces instead of underscores)

and

{{A|altName=Donald_Macpherson_(Novelist)|name=Donald Macpherson}}

gives

Donald Macpherson (Note that the link is clean and short, but you have to put more work into the template to get it.)