Template talk:A

Revision as of 15:32, 12 March 2011 by Uzume (talk | contribs) (→‎Broken Example)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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

See Template:A/doc for detailed documentation.



I have edited the tempalte to use background color #CCFF99 ( like this ) as a test, because it was suggested to me that links to the db ought to visually sitinct from links to other wiki pages. Any comments on what color to use, or indeed whether color should be used in tis way at all? Other formatting could be used (typeface, size, even an image) if desired, or we could return to the status quo ante. -DES Talk 23:52, 7 July 2008 (UTC)

If you are going to leave this edit... (And I don't have any issues with it - It's a decent idea), please go ahead and apply it to the other 'internal' linking templated, P and T. I was mightily confused for a day as to why some links were green and others not. then when I realized it was an internal template... I was confused why all the single letter templates didn't have a color (Either the same color or a different color). As to your color choice... One thing I have learned is that Pastels often work fine on screen, and continue to work if someone prints something out, while bold colors look better on screen, but then look horrible when printed out in b/w. Kevin 06:07, 31 August 2008 (UTC)
I have, quite frankly, been waiting for significant response, positive or negative, before extending the color. I think there has been timne enough, and I will extend the color to the other matching templates. -DES Talk 15:15, 31 August 2008 (UTC)
Go for it! It's a horrible colour, I'm surprised there hasn't been more comment. I still like the idea of links showing where they go (roughly) though. This is a Template even I use now. BLongley 20:34, 31 August 2008 (UTC)
Ok will do.

Broken Example

This template does not work when there is a ( or a ) in the authors name. Though rare, this is the documented way to disambiguate between two authors. See Author:Donald_Macpherson_(Novelist) for an example in the database. I could not get the A Template to work for me on this page so I had to resort to full html links. Thanks Kevin 06:07, 31 August 2008 (UTC)

I will look into the matter, and see what, if anything, can be done about it. it may be a limitaiton of the wiki software, i'm not yet sure. -DES Talk 15:17, 31 August 2008 (UTC)
By the way, it is permisible to have spaces in the names (titles) of wiki pages, and such spaces can be used in wiki links. -DES Talk 15:17, 31 August 2008 (UTC)
I know about spaces.. but I cut n pasted the text above (shrug). Kevin 15:40, 31 August 2008 (UTC)
Fine, as long as you know. The form above is fine. Some people have gone to great lengths to avoid spacs when not needed. It used to be that this template required manual conversion of spaces to underscores. The conversion is now done automatically. -DES Talk 15:49, 31 August 2008 (UTC)

(unindent) Yep this is a bug. The problem is with the anchorencode function, used to convert spaces to underscores. It also converts parens to numeric codes (and probably some other non-url-safe characters). To write a version that would do onlt\y what we want, the String functions Extension would need to be installed. -DES Talk 20:26, 31 August 2008 (UTC) Or i could create a vesion that worked with the parserFunctions extension (which includes #if) and some additional parameters. Hmm I think i see a way... -DES Talk 20:28, 31 August 2008 (UTC)

Fixed! -- or at least hacked around. Any authors with parens or single quotes in their cannonical names will need to use a special parameter altName in this tempalte, see the documatation page transcluded on the template page. If I had the String Functions Extension I wouldn't need the hack, but... -DES Talk 20:45, 31 August 2008 (UTC)

Thank you - I'm also filing a bug report as this should be an easy one to detect/fix in ea.cgi. For the bug report the bad links are Donald_Macpherson_(novelist) and Donald_Macpherson_(artist). Marc Kupper (talk) 21:58, 31 August 2008 (UTC)
If you undertake a fix in the code, make sure that it handles all non-alphanumeric characters, because anchorencode pueports to convert all such. Tests may be needed to determine what it actuall converts. -DES Talk 22:42, 31 August 2008 (UTC)
This is not an issue of the Python CGI code but an inappropriate use of anchorencode which is only supposed to be used for encoding fragments links into MediaWiki space. This should use urlencode which works correctly (though the URL will contain urlencoded UTF-8 for characters outside the ASCII range). Uzume 14:05, 12 March 2011 (UTC)
OK, I take that back as it seems like there are issues on the Python code side of things as well as MediaWiki's implementation of urlencode. The code uses the non-portable CGI argv which splits on + but MediaWiki's urlencode uses that to encode spaces instead of %20. The right way to do this is it to fix the code to not use argv (which will help this and improve portability, etc.) and then use MediaWiki's urlencode (which I could use now if our copy of MediaWiki was not so outdated since urlencode and PAGENAMEE were updated in later versions; already a bug filed to get MediaWiki updated). Uzume 19:32, 12 March 2011 (UTC)

altName vs altname

Could we amend this to use either altName or altname? I just spent 10 minutes trying to figure out what I was doing wrong, and it was the capitalized N I was leaving as a lowercase n. Kevin 00:58, 25 June 2009 (UTC)

I think so. I'll look into it. -DES Talk 01:36, 25 June 2009 (UTC)
Done. -DES Talk 13:58, 25 June 2009 (UTC)
Thank you so much! I'm sure It will be used by many people who don't appreciate it because they don't even realize it used to not work with the lower case 'n'. But then again, that's alone is a great compliment. The best engineering isn't noticed.. it just works. Cheers Kevin 14:43, 25 June 2009 (UTC)
Of course, any use of the altname parameter is for a rare case -- most authors don't have parens or other non-alphanumeric characters in their canonical names. If you want to see a related and tricky template, look at {{AuthorHeader}} That calls {{A}}, normally using the page name as argument. But when the author's name includes one opf the special characters, it must set the altName parameter. Optionally setting a parameter to a template being called by another template is a bit tricky. With luck, anyone who needs to use this won't notice the complexities much. ObVerse: Kipling's "The Sons of Martha". -DES Talk 14:54, 25 June 2009 (UTC)
Actually my problem was caused by comma, probably the most common of the rare characters with 600+ in the db. Thanks again, Kevin 16:15, 25 June 2009 (UTC)
I didn't know this also hit the comma, but it makes sense in hindsight. I'll mention it in the doc. -DES Talk 18:24, 25 June 2009 (UTC)