Template talk:Template shortcut

Expand?
Most useful templates have more than 3 shortcuts. Would it be all right to expand this to, say, 9? $$\sim$$ Lenoxus " * " 22:53, 23 May 2008 (UTC)


 * Well, that this template only handles three shortcuts is perhaps a bit little, perhaps five just like shortcut would be a good number. The reason has not been extended to handle more links was that we don't want pages to show many shortcuts, we want people to choose the best 2-3 shortcuts for a page and show only them. I guess the same is valid for template shortcut. Or perhaps even more valid since it is confusing to find a "new" template in a page or inside another template, only to later discover that it was just yet another name for some template you already knew about. So we probably should not encourage people to use the shortcuts to a template.
 * But frankly, there are better and clearer ways to show the shortcuts to a template. In spite that I am an experienced template programmer I didn't know until recently what the boxes on template documentation pages meant. But check out the documentation for . The third sentence there lists the shortcuts to that template in a much clearer way than a shortcut box would do.
 * --David Göthberg (talk) 02:07, 24 May 2008 (UTC)

Plainlist
Please sync from Template:Template shortcut/sandbox, where I've created an accessible version, using HTML list markup, styled with no bullets. — Preceding unsigned comment added by Pigsonthewing (talk • contribs) 11:17, 17 January 2012‎


 * Yes please sync from the sandbox, as requested above. The new "plainlist" functionality is present, but also now, templates are in monospace, which not only makes them larger and clearer (the current styling, identical to Shortcut, would be acceptable for WP: shortcuts in all caps but not for lowercase template code) but is appropriate for wikitext markup. — This, that, and the other (talk)
 * OK, having verified at Template:Template shortcut/testcases, Yes check.svg Done. -- Red rose64 (talk) 14:14, 7 July 2012 (UTC)

No red link bug.
If you pass a shortcut that doesn't exist, it won't become a red link, but printed as a normal link instead. So template docs may contain wrong shortcuts. Could anyone fix? --Ahora (talk) 08:18, 27 October 2012 (UTC)
 * It's not formatted as a normal link, but as an external link - the blue is subtly different (compare fact with  &#123;&#123;[ fact]&#125;&#125; ). It's an external link so that the redirect is not followed. There is no easy means to detect if an external link target exists or not, so there is no redlink mechanism. -- Red rose64 (talk) 14:42, 27 October 2012 (UTC)

You're right, but could it be possible to use #ifexist prior to making an external link, in order to make a red link when necessary? (It may, possibly, be better if it prints "typo?" too.) My first idea was to deliberately print an conspicuous error message if the page doesn't exist, but since this template is already in wide use, it'd be bad.

Thanks. Cheers. --Ahora (talk) 01:05, 29 October 2012 (UTC)
 * only works on pages within English Wikipedia. It can't even check for the existence of a page on a different Wikipedia (always returning "false") - for example
 * → The page "Paris" on English Wikipedia (see Paris)
 * → The page "Paris" on French Wikipedia (but see fr:Paris)
 * so it has no chance of working for any external link. -- Red rose64 (talk) 12:34, 29 October 2012 (UTC)

How about { {#ifexist| page name | external link with "noredirect" | ordinary link}}? --Ahora (talk) 23:51, 29 October 2012 (UTC)
 * As in,
 * That might work. -- Red rose64 (talk) 08:44, 30 October 2012 (UTC)
 * That might work. -- Red rose64 (talk) 08:44, 30 October 2012 (UTC)
 * That might work. -- Red rose64 (talk) 08:44, 30 October 2012 (UTC)

Edit request on 2 November 2012
Reason of the request: The current one always prints "blue links" (see the right demo), but it's inconvenient.

I ask to adopt my fix which supports red links, created in the sandbox. See. It also has a slight change: it's simplified a little by replacing {{{1|{{PAGENAME}}}} with. is only useful for a demo in the template page itself, Template:Template shortcut, but the documentation suffices. Accordingly, the body is put inside of  to make it look better in the template page.

A proof that it correctly works:

Thanks, dear administrator, and thanks User:Redrose64 for discussion.

--Ahora (talk) 05:56, 2 November 2012 (UTC)
 * Yellow check.svg Partly done: I've done it, but I tweaked it just a little so that it shows  if no parameters are specified. This will look better on the template page and should keep the template from breaking if any existing transclusions haven't specified the first parameter. Good work on the code, by the way - that has been bothering me for a while. — Mr. Stradivarius  (have a chat) 13:51, 2 November 2012 (UTC)

Protected edit request on 23 February 2014
Can we change the first  in the   value to some kind of  ? The idea is that things like this would line up:

&mdash;SamB (talk) 19:33, 23 February 2014 (UTC)
 * , why does it matter if they line up or not? The reason for the 0.3 top margin as far as I know is so the shortcuts will show properly when Anchor is used to navigate to a specific section of a page. — &#123;&#123;U&#124;Technical 13&#125;&#125; (t • e • c) 20:09, 23 February 2014 (UTC)
 * Well, I guess it's not too big a deal; I'm certainly less bothered by it than by what browsers do with this HTML: &mdash;SamB (talk) 00:35, 24 February 2014 (UTC)

Protected edit request on 23 June 2014
Please update to [//en.wikipedia.org/w/index.php?title=Template:Template_shortcut/sandbox&oldid=614139946 this version] of the sandbox. this will add an optional clear with syntax that matches stack. by default, clear and the shortcut box nests next to the prior floating object. however, if right or left it will clear any right/left floating elements above it, allow it to float all the way to the right/left edge of the page.

Frietjes (talk) 20:33, 23 June 2014 (UTC)
 * You seem to have introduced an additional parameter called float - is this intentional? &mdash; Martin (MSGJ · talk) 20:59, 23 June 2014 (UTC)
 * check the documentation, there is already a parameter called float. Frietjes (talk)
 * Padlock-pink-open.svg Not done: The page's protection level and/or your user rights have changed since this request was placed. You should now be able to edit the page yourself. If you still seem to be unable to, please reopen the request with further details. Jackmcbarn (talk) 23:25, 23 June 2014 (UTC)

"top" parameter, no colon
This sandbox version of the template has had the (optional) parameter top added to the table styling (primarily so that top=0 places the template flush with the beginning of e.g. a section) and the colon following "Shortcut/Shortcuts" removed (as superfluous, especially as there's nothing else in the notice other than the shortcut/shortcuts provided). If this doesn't meet with disapproval, I'll copy it to the live template a few days hence. Sardanaphalus (talk) 12:39, 29 June 2014 (UTC)
 * No concerns here, although top=0 is not really standard. How about just top=no, or use yesno? &mdash; Martin (MSGJ · talk) 13:49, 30 June 2014 (UTC)
 * top=0 follows the pattern at Template testcases notice – perhaps that should change too? Sardanaphalus (talk) 09:47, 4 July 2014 (UTC)

Proposed style adjustment
Recently,, policy shortcut, and shortcut had their styles adjusted; see Template_talk:Shortcut. I propose to similarly adjust this template. I've made the changes to this template's sandbox, see Template:Template shortcut/testcases for a comparison to the live template and to. - Evad37 &#91;talk] 01:38, 23 November 2017 (UTC)
 * ✅ - Evad37 &#91;talk] 13:15, 28 November 2017 (UTC)

Template:* does not produce proper shortcut
See what happens when Template:* is used in this template? LA (T) @ 09:38, 31 January 2018 (UTC)


 * The issue here is that the MediaWiki parser won't accept an external link whose text consists solely of an asterisk which is programmatically generated (e.g. ). It doesn't appear to exhibit this behavior when the asterisk isn't programmatically generated (e.g.  ). I've filled a bug with the development team. TheDragonFire (talk) 12:47, 10 February 2018 (UTC)

Not linking shortcuts
This template is designed to be placed into template documentation. By definition, a shortcut redirects to the main template, so a wikilink for a shortcut is pointless - it just takes people back to the template they're already looking at. So I suggest that the shortcuts in the displayed list of shortcuts should not be wikilinked. Colonies Chris (talk) 13:02, 4 November 2019 (UTC)
 * No, it can also be used in other places (eg WP:TITLECON). Also, no harm but help in the fact that a one sees a full-name template with its&mdash;well, shortcut name. -DePiep (talk) 18:12, 4 November 2019 (UTC)

Edit request to complete TfD nomination
Template:Template shortcut has been listed at Templates for discussion (nomination), but was protected so could not be tagged. Please add:

to the top of the page to complete the nomination. Thank you. JsfasdF252 (talk) 21:19, 1 February 2021 (UTC)
 * Yes check.svg Done &mdash; Martin (MSGJ · talk) 22:19, 1 February 2021 (UTC)