Template talk:Disambigentry

From Team Fortress Wiki
Jump to: navigation, search

This doesn't work with sections in articles

The way the template currently handles links is by adding {{if lang}} at the very end. This, however, partially breaks the link when linking to a specific section of an article in a translated page.

Let's say I want to create a link in a /pt-br page to the Meet Your Match Update/pt-br's "Disgaea promotional items" section.

The link has to be Meet Your Match Update/pt-br#Itens promocionais de Disgaea PC.


The way the template works right now, it puts /pt-br at the very end of the link, so if I use
link=Meet Your Match Update#Itens promocionais de Disgaea PC, the template turns it into
link=Meet Your Match Update#Itens promocionais de Disgaea PC/pt-br.
Not only does this link to the EN article, it's linking to a section that doesn't exist.


If, however, I use
link=Meet Your Match Update/pt-br#Itens promocionais de Disgaea PC, then the template turns it into
link=Meet Your Match Update/pt-br#Itens promocionais de Disgaea PC/pt-br.
While this does lead to the PT-BR translation, the section is called "Itens promocionais de Disgaea PC", not "Itens promocionais de Disgaea PC/pt-br", and so the reader is taken to the top of the article instead of being taken directly to the section.


I tried removing the {{if lang}} from the template, but what it did was make link= a required field even when using just {{De|Item name}}, as the image's link would lack localization (the text would link to the same language as the current article, but the image would link to the EN version).

Right now, the only way that links work 100% right is by not linking to sections. If someone could find a way to make them work with sections (maybe add a section= option), please do it. - BrazilianNut (talk) 21:29, 29 November 2023 (UTC)

The choice here is to either make a simple template with some caveats like no section links, or it's having a very long template with many required parameters. So far, there hasn't been an actual place where the template needs a section link that can't be substituted for a redirect of some sort.
BLU Wiki Cap.png | s | GrampaSwood Praise the Sun! (talk) (contribs) 00:37, 30 November 2023 (UTC)