Template talk:Section link

Latest comment: 15 hours ago by Trappist the monk in topic Make [[ ]] (wikilink) do the same as {section link|}!

Bugs

edit

{{see section||Soviet Union|Armenian SSR (Armenia)|label2=Armenian SSR}} displays §§ Soviet Union​ and Armenian SSR (Armenia). There are at least two bugs here. The multiple "§§" is one, and the lack of functionality for |label2= is another. I'd appreciate if this could be fixed for use at World War II by country. Thanks! {{u|Sdkb}}talk 20:21, 4 July 2022 (UTC)Reply

Do we agree that the output should be § Soviet Union​ and § Armenian SSR (Armenia)? – i.e. with a single section sign per link — GhostInTheMachine talk to me 11:26, 10 October 2022 (UTC)Reply
I believe we do. The disambiguation should be fixed by |label2=, as well. {{u|Sdkb}}talk 14:21, 11 October 2022 (UTC)Reply
  Bumping thread. Sdkbtalk 22:10, 28 May 2024 (UTC)Reply
edit

is there anyway a wikilink could be added to the § symbol pointing to Section_sign. A lot of people don't know what that symbol means, myself included until very recently. Jake Jakubowski (Talk) 05:13, 14 June 2023 (UTC)Reply

A wikilink wouldn't be appropriate I don't think, but we could maybe do hover text, like this:

{{tooltip|§|Section}}

which renders as:

§

However, this isn't accessible on mobile and I'm not sure about screen readers. — W.andrea (talk) 14:26, 17 April 2025 (UTC)Reply
edit

None of the following have "Notes" as a template parameter. It must be coming from Module:Section link

I played around with fixing this in this edit, but it still leaves an errant " § " when testing it in the sandbox. Anyone want to take this to the finish line and submit a {{TPER}}? Thanks. –Novem Linguae (talk) 04:47, 6 July 2023 (UTC)Reply

If the purpose of the module [is to create] links to sections, nicely formatted with the "§" symbol instead of the default "#", is there ever a legitimate reason for it to make up a section name that may or may not exist in the target article? Is there ever a legitimate reason to omit the section name from a template named 'section link'? I don't know of any such reasons so, for me, I would have the module emit a section name missing (or some such) error message (perhaps with an accompanying hidden category).
Trappist the monk (talk) 13:21, 6 July 2023 (UTC)Reply
That sounds good to me. –Novem Linguae (talk) 09:42, 13 July 2023 (UTC)Reply
Using the sandbox and the example from the OP:
{{Section link/sandbox|Miscellany}}{{Section link}}: required section parameter(s) missing
Trappist the monk (talk) 15:54, 1 June 2024 (UTC)Reply
edit

This template could be enhanced by adding an optional parameter for linking to a permanent revision of the section on the page. Sdkbtalk 00:25, 17 March 2024 (UTC)Reply

@Novem Linguae and @Trappist the monk, I see you've both been active in editing this template recently. Since I don't know how to code Lua, wondering if you might be interested in helping with this?
To flesh out the proposal a bit, I envision a new |permalink= parameter that would be used to provide a revision number, and if so provided the link would go to that revision. Sdkbtalk 02:34, 29 May 2024 (UTC)Reply
Using the sandbox: links to the first post in this discussion:
[[Special:Permalink/1214107719#Permalink option]]Special:Permalink/1214107719#Permalink option
{{section link/sandbox|Template talk:Section link|Permalink option|permalink=1214107719}}Template talk:Section link § Permalink option
Only supported for uses with one section parameter; with multiple section parameters |permalink= is ignored.
Trappist the monk (talk) 15:52, 1 June 2024 (UTC)Reply
Looks good to me! Thanks for coding; I'd say feel free to implement. Sdkbtalk 05:16, 2 June 2024 (UTC)Reply
Done. I leave it to you to update the documentation.
Trappist the monk (talk) 14:39, 2 June 2024 (UTC)Reply

Wikipiping

edit

I rune into the necessity for wikipiping, e.g., the capital of Russia (hypothetical example). Can it be implemented as a parameter, e.g., {{section link|Stars in fiction|Neutron stars|pipe=life on the surface of neutron stars}}- Altenmann >talk 18:47, 18 August 2024 (UTC)Reply

Most often, hypothetical examples are meaningless. Is your other example a real-life example, or just another hypothetical?
As currently written, this template and its module do not support piping. Likely, to do so would seem to conflict with the purpose of this template which is to make a pretty rendering of an unpretty wikilink where all parts of the wikilink are visible to the reader:
[[Stars in fiction#Neutron stars]]Stars in fiction#Neutron stars
{{slink|Stars in fiction|Neutron stars}}Stars in fiction § Neutron stars
If you want a piped link, make a piped link:
[[Stars in fiction#Neutron stars|life on the surface of neutron stars]]life on the surface of neutron stars
But, such links might run afoul of WP:EASTEREGG.
Trappist the monk (talk) 19:42, 18 August 2024 (UTC)Reply
It is noit hypothetiical, and that's exactly what did in Life origination beyond planets three times, see the text "life with no sunlight" there and two more downtext. After second thought I nolonger see the advantage of using sectionlink template in such cases. Yes, I am aware of rotten Easter eggs, and I always fix them when I see them. --Altenmann >talk 23:32, 18 August 2024 (UTC)Reply
I sometimes use the template to link to related sections in the same article. This means that I want to flag to readers they're staying in the same article (with the section symbol), and need to make sure the text fits within the sentence, often requiring piping. —Femke 🐦 (talk) 07:32, 12 July 2025 (UTC)Reply

Template-protected edit request on 17 April 2025

edit

Is it possible to add an example usage in the template itself? I'm not super familiar with {{#invoke}}, but I know in other templates you can use <noinclude>, like

{{slink|{{{article|}}}<noinclude>Example article</noinclude>|{{{section|}}}<noinclude>Example section</noinclude>}}

W.andrea (talk) 14:20, 17 April 2025 (UTC) edited 17:27, 10 MayReply

  Not done There are plenty of example on the doc page, and I don't see a good reason to deviate from the default behavior of the template displaying itself with no parameters. * Pppery * it has begun... 20:13, 22 April 2025 (UTC)Reply

I don't see a good reason to deviate from the default behavior of the template displaying itself with no parameters.

People first learning about the template would be better served seeing an example of the template's intended usage rather than an error stemming from unintended usage. — W.andrea (talk) 17:24, 10 May 2025 (UTC)Reply
Cf. {{Nothanks-web}} which noincludes "Page" — W.andrea (talk) 17:58, 10 May 2025 (UTC)Reply
edit

Changes to this template+module cannot accomplish this, but: Does the default wikilink really have to make ugly links like this?

[[Albert Einstein#Scientific career]]Albert Einstein#Scientific career

... when it could instead make nicely formatted links like this template+module does?

{{section link|Albert Einstein#Scientific career}}Albert Einstein § Scientific career

Help:Cheatsheet lists both ways to "Link to a section".

I can't imagine where the link with the Article title § Section title section-link format would NOT suit better than the Article title#Section title format (though one might contemplate alternative glyphs and alternative spacings).-A876 (talk) 23:18, 27 August 2025 (UTC)Reply

  Not done – no complete and specific description of the request. Generally such requests are in the form: change X to Y.
Not clear what you mean by Changes to this template+module cannot accomplish this. Accomplish what, specifically?
Trappist the monk (talk) 23:31, 27 August 2025 (UTC)Reply
I regret making such a vague comment in this context. I withdraw it embarrassed.
(I would delete this whole section. If you would too, please do so.) (A new attempt follows.) -A876 (talk) 18:09, 28 August 2025 (UTC)Reply

Make [[ ]] (wikilink) do the same as {section link|}!

edit

Pre-apologies:

  • I know I'm [mis]using {edit template-protected} to suggest changes to some other template. I do not request any edit here; I only hope for an opinion and maybe an idea of where to [re]post.
  • I have held this idea for a while, and sadly I must let it out. Now.
  • I would comment in the place where the code for [[ ]] is maintained, but [[ ]] is not a template. I don't know where to look. It might be a fundamental non-template hard-coded in MediaWiki. For lack of a better immediate place, I boldly rudely cram it in here to introduce it.

This template-and-module ({section link|}) makes "nice" section links, like this:

{{section link|Albert Einstein#Wormholes}}Albert Einstein § Wormholes

The standard [[   ]] (wikilink) makes the same target into a ugly (or less-nice) section link, like this:

[[Albert Einstein#Wormholes]]Albert Einstein#Wormholes

Help:Cheatsheet lists both ways to add a "Link to a section". If someone wants a "nice" link, they have to code for this template instead of using the default wikilink syntax.

Maybe it's time for [[   ]] (wikilink) to do the same thing (in the above case) that {section link|} does! Because:

  • Editors who want to add a "nice" link-to-a-section (without pipe) won't have to add the code for his template.
  • Every existing link-to-a-section (without pipe) would immediately become "nice".
  • I cannot imagine where a link like Article § Section would NOT suit better than a link like Article#Section (though one might contemplate using an alternate glyph and/or different spacing). Wouldn't everyone prefer it? -A876 (talk) 18:09, 28 August 2025 (UTC)Reply
  Not done.
The [[ ]] markup is a MediaWiki primitive. If you think that MediaWiki should render a formatted unpiped section link in a way that is different from the way that unpiped section links are currently rendered, you will need to take that up with MediaWiki. I suppose that the place to do that might be at phabricator. Making that suggestion here will surely result in disappointment.
Trappist the monk (talk) 18:33, 28 August 2025 (UTC)Reply