Template talk:Template shortcut

From Wikipedia, the free encyclopedia
Jump to: navigation, search


Most useful templates have more than 3 shortcuts. Would it be all right to expand this to, say, 9? 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 {{shortcut}} 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 {{template shortcut}} 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)


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 (talkcontribs) 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, Done. --Redrose64 (talk) 14:14, 7 July 2012 (UTC)

No red link bug.[edit]

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 {{fact}}). 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. --Redrose64 (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)

{{#ifexist:}} 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" {{#ifexist: Paris|exists|does not exist}} on English Wikipedia → The page "Paris" exists on English Wikipedia (see Paris)
  • The page "Paris" {{#ifexist: fr:Paris|exists|does not exist}} on French Wikipedia → The page "Paris" does not exist on French Wikipedia (but see fr:Paris)
so it has no chance of working for any external link. --Redrose64 (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. --Redrose64 (talk) 08:44, 30 October 2012 (UTC)

Edit request on 2 November 2012[edit]

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 this diff. It also has a slight change: it's simplified a little by replacing {{{1|{{PAGENAME}}}} with {{{1}}}. {{PAGENAME}} 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 <includeonly>...</includeonly> 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)

Partly done: I've done it, but I tweaked it just a little so that it shows {{PAGENAME}} 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[edit]

Can we change the first 0.3em in the margin: value to some kind of 0? The idea is that things like this would line up:

SamB (talk) 19:33, 23 February 2014 (UTC)

SamB, 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. — {{U|Technical 13}} (tec) 20:09, 23 February 2014 (UTC)
@Technical 13: 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:
<input type="checkbox" /><label>Foo</label>
SamB (talk) 00:35, 24 February 2014 (UTC)

Protected edit request on 23 June 2014[edit]

Please update to 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 |clear=right or |clear=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? — 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[edit]

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}}? — Martin (MSGJ · talk) 13:49, 30 June 2014 (UTC)

Proposed style adjustment[edit]

Recently, {{tl]shortcut}}, {{policy shortcut}}, and {{shortcut}} had their styles adjusted; see Template_talk:Shortcut#Visual_redesign_proposal. 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 {{shortcut}}. - Evad37 [talk] 01:38, 23 November 2017 (UTC)

 Done - Evad37 [talk] 13:15, 28 November 2017 (UTC)

Template:* does not produce proper shortcut[edit]

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

@Lady Aleena: 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. [{{fullurl:Template:*|redirect=no}} {{#if:true|*}}]). It doesn't appear to exhibit this behavior when the asterisk isn't programmatically generated (e.g. [{{fullurl:Template:*|redirect=no}} *]). I've filled a bug with the development team. TheDragonFire (talk) 12:47, 10 February 2018 (UTC)