Template talk:Visible anchor/Archive 1

text parameter
What's the point of the text parameter? Instead of, it sounds like one should write bar instead. Amirite? --Bxj (talk) 03:17, 29 October 2011 (UTC)
 * Because the visible text should be contained within the anchor.  — Edokter  ( talk ) — 08:13, 29 October 2011 (UTC)
 * Why "should"? Is there any functional or visible problem it's addressing? Seems like it's a longer and more obscure way of coding something, hence it wouldn't be used (and not needed). --Bxj (talk) 18:12, 29 October 2011 (UTC)
 * If you're going to make a text part of the anchor, it needs to be inside the span. Placing it outside may appear to work, but it would not be part of the anchor.  — Edokter  ( talk ) — 22:18, 29 October 2011 (UTC)

Where to use the ?
I have started a discussion about that issue: I think we should recommend: What should be the usage recommendation? Oliver H (talk) 16:20, 28 September 2012 (UTC)
 * Talk:C++11
 * use it for redirection to the beginning of a sub-section (e.g. in the sentence presenting a diagram/picture or a code example, or as I did for the above link)
 * do not use it in the middle of the text because the reader expects to see the section title

Edit request: inaccurate error message
The code Template:Anchor (or Anchors): too many anchors, maximum is 10. should instead read Template:Visible anchor: too many anchors, maximum is 10. I've put a space just before the span so that the error message doesn't have to butt up against the anchor text as in

Many thanks, User:GKFXtalk 18:58, 7 January 2018 (UTC).
 * Yes check.svg Done —&thinsp;JJMC89&thinsp; (T·C) 19:00, 7 January 2018 (UTC)

Improving visuals for visual anchor
Hey! I was just wondering if we have any opinions on improving the visuals of Visible anchor. Instead of just displaying the text, what about if we added parameter (display etc) that made it a bit nicer:

You can wikilink to this point in the page with with .

ItsPugle (please ping on reply) 09:09, 10 November 2020 (UTC)
 * Thoughts? Sorry if you're not interested, I just grabbed your username from the template's most recent edits. ItsPugle (please ping on reply) 09:48, 11 November 2020 (UTC)

Requested move 4 December 2020

 * The following is a closed discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. Editors desiring to contest the closing decision should consider a move review after discussing it on the closer's talk page. No further edits should be made to this discussion. 

The result of the move request was: not moved. (closed by non-admin page mover) Jerm (talk) 01:38, 11 December 2020 (UTC)

Template:Visible anchor → Template:Text anchor – Is this more concise name preferable? I cannot move the template because it is protected. JsfasdF252 (talk) 00:06, 4 December 2020 (UTC)


 * Hello again! You seem to have an unerring ability to find the pages on my watchlist. Are you aware that you could just create a redirect from “Template:Text anchor” to here without moving anything? That is the normal approach taken to having a range of names to satisfy what different editors think is logical. I would recommend against moving templates when the creation of a redirect would do. User:GKFXtalk 00:40, 4 December 2020 (UTC)
 * How about moving this template to Template:Text anchor, and redirecting Template:Visible anchor to that? I think I prefer the more concise name, but I would hate to be overly disruptive. ItsPugle (please ping on reply) 06:21, 7 December 2020 (UTC)
 * Oppose The proposed name is ambiguous. —&thinsp;JJMC89&thinsp; (T·C) 05:36, 8 December 2020 (UTC)
 * Oppose. This template is similar to Anchor, which is "invisible", so "Visible anchor" is the best name for this template. There is such a thing as "too concise", I think, which just means "less precise and more ambiguous". A shortcut redirect from the proposed target is a good idea, though.  P.I. Ellsworth   ed.  put'r there 08:52, 8 December 2020 (UTC)


 * The discussion above is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.

Template-protected edit request on 7 December 2020
Just wondering if could be actioned, as there has been almost a month of WP:SILENCE. This can be actioned per the code on Template:Visible anchor/sandbox and demonstrated on Template:Visible anchor/testcases. ItsPugle (please ping on reply) 06:18, 7 December 2020 (UTC)
 * Template:Visible anchor/testcases are not correct for the sandbox. —&thinsp;JJMC89&thinsp; (T·C) 06:58, 7 December 2020 (UTC)
 * Fixed. I literally just forgot one pipe in a variable name. ItsPugle (please ping on reply) 07:37, 7 December 2020 (UTC)
 * This template is extensively used in mainspace articles. I've used it to visibly anchor part of a section header to fix broken links. I tested this in the George Claghorn article in preview, and here is what I saw:
 * Section header was == Military career ==
 * code was == Military ==, and the result was:
 * Military Chain link icon.png You can wikilink to this point in the page with with or page name.
 * Checked it also in running text. In the next section, 3rd paragraph, there is the partial sentence:
 * named by President George Washington after the Constitution of the United States of America
 * so I vanchored "President":
 * named by George Washington after the Constitution of the United States of America
 * the result was:
 * named by Chain link icon.png You can wikilink to this point in the page with with or page name. George Washington after the Constitution of the United States of America
 * The yes parameter could never be used in article space, and I'm not sure it should be used in any namespace. What am I missing? Where is the application for this "improved visual" of the Visible anchor template?  P.I. Ellsworth   ed.  put'r there 17:58, 8 December 2020 (UTC)
 * Red information icon with gradient background.svg Not done for now: please establish a consensus for this alteration before using the template.  P.I. Ellsworth    ed.  put'r there 12:40, 11 December 2020 (UTC)
 * I think this is probably too editor-specific to justify putting into articles and making visible to readers. It would be great feature as a gadget or something (perhaps putting an icon into the left-hand margin with the Vector skin). User:GKFXtalk 21:27, 11 December 2020 (UTC)

Template-protected edit request on 14 May 2021
Replace the contents of the template with Template:Visible anchor/sandbox replacing "Template:Visible anchor/sandbox/styles.css" with "Template:Visible anchor/styles.css" and move Template:Visible anchor/sandbox/styles.css to Template:Visible anchor/styles.css. The changes make it so the anchor is highlighted when it is linked to in the URL. For example when is clicked  will be highlighted. This makes it easier to find the relevant content when a redirect links to a visible anchor. – Brandon XLF  (talk) 15:21, 14 May 2021 (UTC)


 * Your suggested highlight colour, #eaf3ff, is effectively white and so is near-invisible when used to highlight a single word. Could I suggest something slightly more exciting like box-shadow:0 0 3px 1.7px rgba(50,50,50,0.3) or just a darker background color rgba(50, 50, 200, 0.15) ? User:GKFXtalk 21:44, 14 May 2021 (UTC)
 * I made it by making it a little less white. –  Brandon XLF  (talk) 00:47, 15 May 2021 (UTC)
 * ✅ * Pppery * it has begun... 14:29, 16 May 2021 (UTC)

Allow more anchors
is an example where there were not enough anchors available; that page has up to 14 anchors in one (the current limit is 10). I've increased the limit to 20 on the sandbox, which should hopefully be enough for the forseeable future, although maybe the limit could be eliminated with Template:For loop? &horbar;Jochem van Hees (talk) 13:00, 22 March 2022 (UTC)
 * You don't need to go that far. 14 visible anchors is about 12 too many in any case. -- Red rose64 &#x1f339; (talk) 16:23, 22 March 2022 (UTC)
 * Why? Those anchors are already there, and probably all have incoming links. Why should they be removed? &horbar;Jochem van Hees (talk) 16:27, 22 March 2022 (UTC)
 * I see no reason that you can't use (which has unlimited parameters) to supply the extra ones. So for the case with 14 anchors (do you really need that many), instead of   you could use   One of the features of  over  is that one of the anchors (the first one) is visible; but when you use the text parameter, that benefit is defeated. -- Red rose64 &#x1f339; (talk) 17:17, 22 March 2022 (UTC)
 * Insufficient consensus to implement. * Pppery * it has begun... 19:49, 22 March 2022 (UTC)
 * @Pppery: I don't quite think 6h 49m is enough time to allow people to reasonably engage with this discussion and to conclude that there is no consensus. Would you be okay for the discussion continue for a couple days or so (or at least be open for that time), and if there's no consensus by then, this is something that we can refer to WP:RFC if the OP wishes? Tim (Talk to me) 00:03, 23 March 2022 (UTC)
 * From what I understand, the edit request should not be active if there is still ongoing discussion, because otherwise it looks like there's something for template editors to do right now. It can be reactivated when there is consensus. &horbar;Jochem van Hees (talk) 00:17, 23 March 2022 (UTC)
 * Indeed, that's what I meant. I have no objection to any discussion continuing, and my not done was referring to the Edit template-protected request at the top, which is an immiedate request for attention that shouldn't languish while discussion is ongoing (but in practice it often does). * Pppery * it has begun... 00:51, 23 March 2022 (UTC)
 * That's not the only thing this template does though, it also highlights the text when it is linked to. I think that is a big benefit over just using anchor, especially on policy pages, because you can actually see where someone wants to direct your attention to. &horbar;Jochem van Hees (talk) 20:00, 22 March 2022 (UTC)
 * @Jochem van Hees, that might be something to change in anchor, then.  Qwerfjkl talk  10:49, 18 April 2022 (UTC)

Template-protected edit request on 6 August 2023
I'm requesting the addition of an optional lang parameter, in order to allow language markup to the visible anchor. The value of the lang parameter should be an ISO 639 language code, just like as used in the lang template. I have implemented the desired change in the template sandbox (, which just calls lang (with unset) if the lang parameter is defined. More complicated uses of lang-style formatting and options are beyond the scope of this change. They would require specifically using 's text parameter, and explicitly invoking the lang template with desired parameters.

The example usage would be something like:, which results in something like the following (simplified) HTML:

Compare how to achieve even just a single language–marked-up anchor without this parameter, vs. with this parameter:


 * Without


 * With
 * &emsp;—&#8239;sbb&#8239;(talk) 22:21, 6 August 2023 (UTC)


 * Sbb, so the purpose is to bypass adding lang as the displayed text? SWinxy (talk) 19:52, 12 August 2023 (UTC)
 * Yes, to just apply the language code to the to the displayed text. &emsp;—&#8239;sbb&#8239;(talk) 22:00, 12 August 2023 (UTC)
 * I guess I could understand putting the  HTML tag in the spans ourselves, but for this implementation of wrapping the text in the lang template, I don't get how it might be in the scope of this template SWinxy (talk) 22:48, 12 August 2023 (UTC)


 * . Please update the documentation page (/doc) as needed.  P.I. Ellsworth &thinsp;, ed.  put'er there 13:37, 19 August 2023 (UTC)
 * This change caused display and Linter errors when the content of the template was two asterisks. See the "Testing asterisk content" section of the testcases page. I have put some modified code in the sandbox that puts the proposed lang parameter value directly into the span tag. Does that meet the need expressed above? – Jonesey95 (talk) 15:28, 19 August 2023 (UTC)
 * It's passable as a solution, but I'd prefer if it invoked/took advantage of Module:Lang. I'm sure my original suggestion could be improved with Invoke: (although I'm not versed in that usage at all).
 * Downsides of your implementation:
 * No ISO language code error checking, as is done with
 * Doesn't parse the language code to apply the title attribute, which is visible as hover text.
 * Regarding the use-case your implementation ameliorates, in my limited debugging/testing, it seems the problem is applying the string "**" (perhaps "[*]{2,}"?) to the text parameter of the template, I believe? (Yes, very weasel-worded. I'm not strongly confident in that assertion).
 * In the John Calipari case (and similar), I'd argue that +  for the table footnotes are better implementations. On the other hand, contradicting myself, that shouldn't dictate how editors choose to markup table notes/footnotes; I'm aware of that. I'm a rusty on WP regex searches, but I'll try to get an idea of how many articles would be impacted going with my original (or functionally similar) suggestion. &emsp;—&#8239;sbb&#8239;(talk) 03:24, 29 August 2023 (UTC)