Template talk:Tag
Archives | |
---|---|
| |
Performance problems
We get "Warning: This page contains too many expensive parser function calls." on many pages because of the if-function used in this template.
Since several pages include this template more than hundred times it needs to be kept simple!
--Phobie 15:11, 3 December 2008 (UTC)
- Yeah the auto-generated Category:Pages with too many expensive parser function calls must be a new feature of parser functions. That category had many more pages yesterday so I guess your edit yesterday remedied the situation. But the language support discussed above, is disabled now hey?
- I'm not sure whether or not the efficiency of parser functions is anything to do with the wiki outages we've been having. Guess it doesn't help though.
- -- Harry Wood 10:07, 4 December 2008 (UTC)
lists of values
Hi, can we extend the template to deal with multiple values please? e.g. my=val1;val2 to embedd 2 links to the specific feature pages? --!i! 18:56, 11 August 2010 (BST)
- +1 - needed frequently. axk 17:50, 25 November 2010 (UTC)
- +1 - same also for key=value1/value2 --Skippern 18:11, 25 November 2010 (UTC)
- Really is it needed frequently? See ^^#Performance problems^^ -- Harry Wood 18:42, 25 November 2010 (UTC)
- ohh, i read this page after i add some new features. this is now included: {{tag|motor_vehicle|agriculture|;=forestry|vl=XY|vl2=YX}} -- MasiMaster 23:39, 19 January 2012 (UTC)
I think semicolons should be used to represent the multiple values within a field, not alternative values. For that, I've seen some people (specially in proposals) using a slash. A slash also has that meaning in name=* with multiple values, such as in shared boundary features.--Fernando Trebien (talk) 13:29, 16 February 2017 (UTC)
Whitespace handling
Very long descriptive tag values such as the one on Key:description break quite horribly with white-space:pre. On a small screen, the long, unbreakable line for description= drops all the way down to after the green float, which means it ends up after the fold and breaks up the example. Not the best way of explaining how the description tag is supposed to work.
Is anyone actually bothered about collapsing whitespace in the value part of the tag? I'll assume not and make the appropriate changes. We can't use white-space:pre-wrap if we want browser compatibility, sadly.
--achadwick 13:18, 30 September 2010 (BST)
Third param wiki interpretation
The third parameter (an unlinked value) allows wikicode, so you can do things like this:
Code | Rendering | Comment |
---|---|---|
{{tag|width||''numerical value''}} |
width=numerical value | Wiki-italics are pretty common here |
It can have unintended side effects though:
Code | Rendering | Comment |
---|---|---|
{{tag|width||#}} |
width=# | # interpreted as ordered list |
{{tag|width||*}} |
width=* | * interpreted as unordered list (this style is unnecessary anyway -- just ditch the last 2 params) |
I saw this problem earlier on one page. It might not come up often enough to deal with. Mrwojo (talk) 01:52, 23 March 2013 (UTC)
- You can use <#> or [#] instead # : shop=[#]. <>|[] will mean that it is not a value, but the pattern --dr&mx (talk) 07:54, 23 March 2013 (UTC)
- Making it <*> by default is unnecessary, in my opinion. Mrwojo (talk) 19:38, 23 March 2013 (UTC)
- Same opinion here. I will revert this change. @dr&mx: Please discuss such a change on a broader base. --Andi 20:56, 23 March 2013 (UTC)
- Making it <*> by default is unnecessary, in my opinion. Mrwojo (talk) 19:38, 23 March 2013 (UTC)
You can also use
Code | Rendering |
---|---|
{{tag|width||<nowiki>#</nowiki>}} |
width=# |
--Andi 10:23, 23 March 2013 (UTC)
It looks like you can also use the above trick for tags where the value contains the | character itself, what would otherwise break the macro, e.g.
Code | Rendering |
---|---|
{{tag|psv:lanes||<nowiki>yes|no|no</nowiki>}} |
psv:lanes=yes|no|no |
--User:Aceman444 19:28, 30 Dec 2013 (UTC)
Is there any reason behind why this template doesn't work in language namespaces?
Is there any reason why translators must use Template:DE:Tag vs Template:RU:Tag instead of single Template:Tag? I have arguments against this, since this increase work for DE: RU: translators. Right now you have to make useless work after you copy&paste from en:wiki to de:wiki before you start translation. Xxzme (talk) 05:59, 22 July 2014 (UTC)
- No, you don’t, but you do need to add
kl=ru
orvl=de
if the page you’re linking to exists in your language.--Andrew (talk) 12:20, 22 July 2014 (UTC)
- Well yes,
|kl=ru|vl=ru
works fine. But I still need to specify them manually per tag. Can we modify Tag template so it will use current namespace as default value for kl and vl? I.e. for en: namespace it will use|kl=en|vl=en
, for de: namespace it will mean|kl=de|vl=de
by default, etc. Unless user overwrite kl and vl values manually, they should be used from current namespace. Xxzme (talk) 23:08, 5 August 2014 (UTC)
- Well yes,
- +1, I would prefer if this happened automatically. In fact, Template:DE:Tag does no longer exist (and a lot of existing uses were deleted) because such an automatic solution was adopted for a short time around 2008. However, there were apparently technical limitations back then, see #Supporting Language Namespaces. I wonder if that is still the case? --Tordanik 05:03, 6 August 2014 (UTC)
- Quick update: I recreated Template:DE:Tag based on Template:Tag. --Jgpacker (talk) 18:03, 24 October 2014 (UTC)
- A suggestion: use {{Langcode}} to determine the current language and
#ifexist
to check whether the page exists, avoiding introducing red links by keeping links to pages in English where necessary. This allows incoming links to be switched to a version of the page in the current language whenever it becomes available.--Andrew (talk) 06:47, 7 August 2014 (UTC)
- +1, I would prefer if this happened automatically. In fact, Template:DE:Tag does no longer exist (and a lot of existing uses were deleted) because such an automatic solution was adopted for a short time around 2008. However, there were apparently technical limitations back then, see #Supporting Language Namespaces. I wonder if that is still the case? --Tordanik 05:03, 6 August 2014 (UTC)
- That's the behaviour I would want, too. But unfortunately these
#ifexist
were apparently the reason why the functionality was removed in the past. We would really need to check whether the #ifexist limit still exists. --Tordanik 07:16, 7 August 2014 (UTC)
- That's the behaviour I would want, too. But unfortunately these
- That only affects the minority of pages that have large numbers of tag links. On those pages you make sure that enough links have the language set explicitly (which would eliminate the
#ifexist
call, as would using the template on pages in English), usually the ones that are already available in the current language where adding a new version of the page later has no benefit.--Andrew (talk) 11:45, 7 August 2014 (UTC)
- That only affects the minority of pages that have large numbers of tag links. On those pages you make sure that enough links have the language set explicitly (which would eliminate the
- Alright, sounds like a sensible approach. So with that obstacle cleared, I think you could go ahead and modify the template. --Tordanik 13:00, 7 August 2014 (UTC)
It appears there was a problem with the implementation? I would be interested in learning what went wrong. --Tordanik 07:02, 5 September 2014 (UTC)
- I thought that change was unnecessary so I reverted myself. The changes to {{TagPagename}} were intended to test the page automatically when passed an empty string as lang= (which I think {{Tag}} does by default) but something has gone wrong somewhere as the tag links in Cs:Beginners Guide 1.4.1 all still point to pages in English and I have had no time to resolve it.--Andrew (talk) 12:04, 5 September 2014 (UTC)
Whats the current state? kl,vl ist sooo cumbersome. If there is no automatic possibility, perhaps {{DE:Tag|foo}} (and other languages) should be documented?--Jojo4u (talk) 15:19, 12 July 2015 (UTC)
- It now fundamentally works; to the point where references to {{Template:JA:Tag}} have been ripped out. The one remaining problem is that repeated use of #ifexist overloads Mediawiki on pages with many uses of this template and the last ones may wrongly link to English, I am trying to alleviate this by rewriting the {{Languages}} template so that tag links get the whole ration.--Andrew (talk) 17:58, 12 July 2015 (UTC)
- Out of scope. We are tlaking about Template:Tag, not about Template:Languages (that has the same issue, but which is mitigated by the fact that it tests only about 50 languages, not more, and that template is used only once per page). Template:Tag is more complex to solve and this does not involve at all Template:Languages. — Verdy_p (talk) 22:26, 3 June 2016 (UTC)
- The documentation of this tag still recommends kl and vl. Should this be marked as optional now or ripped out?--Jojo4u (talk) 21:39, 3 June 2016 (UTC)
- The last ones do not "wrongly" link to English, because on purpose if #ifexist cannot test a page, it will return false and the English page is still used as a fallback for these Tag templates. Yes if you know that the target language exists, you can avoid #ifexist using kl/kl. — Verdy_p (talk) 22:26, 3 June 2016 (UTC)
- The documentation of this tag still recommends kl and vl. Should this be marked as optional now or ripped out?--Jojo4u (talk) 21:39, 3 June 2016 (UTC)
Replace <tt> and font-family:monospace with <code>
This applies to several templates, but this is the most popular, so I'm hoping it's seen here. (I will, with a heavy heart, use some of those templates here, hoping they're changed later.)
<code> is the standard HTML element used for inline code. It's conventionally displayed with monospace font, but it's more than that. It's a semantic element. It indicates what the text is, and that's useful for, say, accessibility technologies.
Templates on this wiki indicate code in one of two ways: the obsolete <tt> element or the inline CSS font-family:monospace. Both display the text with a monospace font, but don't carry the semantic value of <code>.
I know this isn't the most active wiki, and these templates are old, maybe from before HTML5 really took hold. But unless there's a good reason to keep them this way, I think it's time for an update. --Bripmccann (talk) 16:15, 12 April 2019 (UTC)
- I'm in full agreement that using semantically meaningful HTML elements is desirable. I wouldn't instinctively have considered OSM tags "code", but I guess they can be considered machine-readable keywords from a certain point of view. Seeing how the HTML spec even mentions file names as an example of something that can be put into <code> elements, I guess OSM tags do qualify. So as far as I'm concerned, your suggested change is fine, although I can't comment on if there historically was some particular reason to go with the current solution. --Tordanik 18:41, 16 April 2019 (UTC)
Automatically split values by semicolon
Do any of the tag value pages have semicolons in their names? If not, this template should automatically split the second parameter (the value parameter) on each semicolon instead of requiring the |; = and |;; = parameters, which are a bit unwieldy. It would be an opportunity to switch this template over to a Lua module, which could offer better performance and allow us to automatically split values on /
as well. – Minh Nguyễn 💬 06:06, 27 November 2019 (UTC)
- Well... Please name a use case for multiple values separated by a slash. --Tigerfell (Let's talk) 07:06, 28 November 2019 (UTC)
@Tigerfell: That's actually quite common on this wiki, where a page wants to say something about multiple values on a given tag. Semicolons imply a simultaneous combination of values. For example:
- Tag:amenity=pharmacy: "wheelchair=yes/no/limited"
- Tag:man_made=flagpole: "flag:type=signal/national/governmental/..."
- Proposed features/change: "change=yes/no/not_right/not_left"
Currently we have to use the unlinked third parameter, but it would be nice to automatically link the tags within it.
– Minh Nguyễn 💬 18:10, 28 November 2019 (UTC)
- The above syntax might be confusing for newer users. How do you want to make sure that the editors intended to merge different values instead of using an obscure value and clarify that the syntax above is not the one to note on the element? I think of tagging like
highway=primary/secondary
. --Tigerfell (Let's talk) 09:12, 30 November 2019 (UTC)
highway=primary/secondary
is exactly what I had in mind, as opposed to the/=foo|//=bar
syntax we would've had to use without Lua modules. I think it would only make sense to autolink slash-delimited values in parameter 2, not the currently unlinked parameter 3. Freeform keys like name=* can contain slashes in values, but that's much less likely with the structured keys that would use parameter 2. People tend to unknowingly or accidentally use parameter 2 for value lists, resulting in redlinks anyways. – Minh Nguyễn 💬 18:04, 2 December 2019 (UTC)
- No, you misunderstood me. I wrote that documenting
highway=primary/secondary
as a shortcut for writing "use eitherhighway=primary
orhighway=secondary
" might be confusing for new mappers, because they could mistake this as a valid tag for "not sure if this is primary or secondary". I can also think of a user confusing the mapping of the road infrastructure with the routes running along (some countries have an A/B/... system, there A routes are something like autobahns, B routes have meridians and straight roads and so on. So you can infer an infrastructure standard form the reference code of the route. In this context, you can find road sections with multiple numbers A1;B3009;C39090290.). --Tigerfell (Let's talk) 06:53, 6 December 2019 (UTC)
- No, you misunderstood me. I wrote that documenting
- I see. I would be in favor of marking up alternatives less ambiguously in the rendered output. For example, we could have it output something like “primary, secondary, or tertiary” automatically (localized into the current language's list format, of course). But this output format doesn't have to be related to the input format. People are apparently used to using slashes in the value parameter in order to express a series of alternatives, so this would be merely a way to be lenient in what the template accepts. – Minh Nguyễn 💬 01:51, 7 December 2019 (UTC)
- I do not want to stop you. I guess one could infer that slashes mark some sort of alternative, even without explicitly knowing the meaning in the case of tag notation. @Eteb3: Do you have an opinion about this matter. I remember talking with you about the "no knowledge rule". --Tigerfell (Let's talk) 12:20, 15 December 2019 (UTC)
Adding an additional parameter "desc" for showing the tag description string
See title, i see an use case when tags are listed at article "See also" sub sections.
Current
Description | Example wikitext | Result |
---|---|---|
A specific key/value pair | {{Tag|highway|residential}}
|
highway=residential |
Proposed new
Description | Example wikitext | Result |
---|---|---|
A specific key/value pair + description string | {{Tag|highway|residential|desc}}
|
highway=residential - Road in a residential area |
The description string should be used from the tag article page e.g. highway=residential and there from the ValueDescription
parameter "|description=Road in a residential area
".
Would that be useful? If so, any help for this implementation would be appreciated.--MalgiK (talk) 20:33, 4 February 2021 (UTC)
- Well, I think this template is pretty complicated already, but I do not want to hinder you. I would imagine that you would need to transclude the tag or key description page and remove everything except for the description. I guess that works easier with data items, because there are templates like Template:O already. --Tigerfell (Let's talk) 13:33, 7 February 2021 (UTC)
- @MalgiK: Could you describe the advantage of having a built-in parameter for the description versus expecting the description to come after the template? Tigerfell's idea of automatically fetching the description from a data item is intriguing, but performance would be a concern; besides, it seems that the gloss following the template often contains not a straightforward description but rather something to distinguish one tag from another. Another issue is that the third unnamed parameter is already used for the unlinked value. In any case, I'd recommend using Template:Tag/sandbox and Module:Tag as the basis for further improvements. – Minh Nguyễn 💬 23:28, 19 September 2021 (UTC)
Database error with HTML character entity reference to emoji
Starting with Special:Diff/1942679, Proposed features/name:Zsye has failed to load due to a database query error:
- [ed41d04dcf250dd265e0e5e8] 2021-12-01 01:50:41: Fatal exception of type "Wikimedia\Rdbms\DBQueryError"
The culprit is this invocation of {{Tag}}, which triggers the error on its own in Special:ExpandTemplates:
{{Tag|name:Zsye|'''🇺🇸'''}}
I'm not sure where exactly the error lies, because {{TagPagename}} seems to have no problem with this 🇺🇸 sequence (incorrect as it is). It's almost certainly related to this wiki's lack of support for non-BMP characters, but the wiki is normally OK with HTML character entity references.
– Minh Nguyễn 💬 01:55, 1 December 2021 (UTC)
- The issue appears to be generating links; changing | to || in the wikitext fixes it. --Andrew (talk) 20:57, 1 December 2021 (UTC)
Introducing a sep parameter
The current syntax for multiple values is quite cumbersome and only supports up to three values e.g.
{{Tag|some_tag|foo|;=bar|;;=baz}}
→ some_tag=foo;bar;baz{{Tag|some_tag|foo|;=bar|;;=baz|;;;=buz}}
→ some_tag=foo;bar;baz;buz (buz is not shown because only two values are supported)
And as noted in #Automatically split values by semicolon some auto-linking support for slash separated values would be handy for proposals.
So I think we should introduce a sep
(separator) parameter so that you could do:
{{Tag|some_tag|foo;bar;baz|sep=;}}
→ some_tag=foo;bar;baz{{Tag|some_tag|foo/bar/baz|sep=/}}
→ some_tag=foo/bar/baz{{Tag|some_tag|foo{{!}bar{{!}}baz|sep={{!}}}}
→ some_tag=foo|bar|baz
(This would require some Lua scripting but I think it should be easy to implement.) What do you think about this?
--Push-f (talk) 11:40, 21 July 2022 (UTC)
Lua rewrite
I've rewritten this template to be based on Module:Tag instead of wikitext. In general, there should be no difference to the input or output, but the new template supports an arbitrary number of key parts and values, not just three.
Some aspects of performance should also improve under the new implementation. The difference should be significant on pages that transclude this template many times. The following comparisons are somewhat pessimistic, because these pages transclude many templates such as {{TagValue}} and {{Valuelink}} that have some of the same performance problems as the current {{Tag}} implementation:
− | NewPP limit report
Cached time: | + | NewPP limit report
Cached time: 20240411224653 Cache expiry: 86400 Reduced expiry: false Complications: [show‐toc] CPU time usage: 2.175 seconds Real time usage: 4.155 seconds Preprocessor visited node count: 13349/1000000 Post‐expand include size: 85214/2097152 bytes Template argument size: 8424/2097152 bytes Highest expansion depth: 22/100 Expensive parser function count: 19/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 2745/5000000 bytes Lua time usage: 1.580/15 seconds Lua virtual size: 9355264/52428800 bytes Lua estimated memory usage: 0 bytes Number of Wikibase entities loaded: 136/250 Transclusion expansion time report (%,ms,calls,template) 100.00% 3305.565 1 -total 67.22% 2222.079 135 Template:Valuelink 22.38% 739.892 229 Template:Langcode 11.04% 364.895 47 Template:Tag/sandbox 9.15% 302.536 3 Template:Icon 9.09% 300.376 3 Template:LangSwitch 8.99% 297.257 3 Template:LangSwitch/langcode 8.40% 277.560 42 Template:LangPrefix 8.28% 273.544 8 Template:LL 4.05% 133.724 10 Template:Keylink |
− | NewPP limit report
Cached time: | + | NewPP limit report
Cached time: 20240411223520 Cache expiry: 86400 Reduced expiry: false Complications: [] CPU time usage: 1.737 seconds Real time usage: 4.133 seconds Preprocessor visited node count: 14204/1000000 Post‐expand include size: 169198/2097152 bytes Template argument size: 6660/2097152 bytes Highest expansion depth: 20/100 Expensive parser function count: 8/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 0/5000000 bytes Lua time usage: 2.320/15 seconds Lua virtual size: 8437760/52428800 bytes Lua estimated memory usage: 0 bytes Number of Wikibase entities loaded: 0/250 Transclusion expansion time report (%,ms,calls,template) 100.00% 3296.460 1 -total 74.86% 2467.741 395 Template:Tag/sandbox 12.91% 425.500 78 Template:Key 11.08% 365.331 106 Template:TagPagename 10.96% 361.142 128 Template:Langcode 4.14% 136.372 3 Template:Icon 4.04% 133.244 3 Template:LangSwitch 3.93% 129.588 3 Template:LangSwitch/langcode 2.23% 73.607 1 Template:Languages 1.93% 63.705 6 Template:IconWay |
− | NewPP limit report
Cached time: | + | NewPP limit report
Cached time: 20240411230427 Cache expiry: 86400 Reduced expiry: false Complications: [show‐toc] CPU time usage: 2.777 seconds Real time usage: 7.161 seconds Preprocessor visited node count: 13536/1000000 Post‐expand include size: 356039/2097152 bytes Template argument size: 32132/2097152 bytes Highest expansion depth: 14/100 Expensive parser function count: 0/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 0/5000000 bytes Lua time usage: 4.070/15 seconds Lua virtual size: 10625024/52428800 bytes Lua estimated memory usage: 0 bytes Number of Wikibase entities loaded: 0/250 Transclusion expansion time report (%,ms,calls,template) 100.00% 5403.758 1 -total 90.93% 4913.452 766 Template:Tag/sandbox 1.48% 79.859 64 Template:K 1.33% 71.909 6 Template:Taginfo2 1.22% 66.106 6 Template:TaginfoAJAX 1.21% 65.386 64 Template:TagKey/exists 1.17% 63.054 1 Template:Convert 1.06% 57.455 4 Template:Key 0.97% 52.177 1 Template:Out_of_date 0.92% 49.748 12 Template:Langcode |
− | NewPP limit report
Cached time: | + | NewPP limit report
Cached time: 20240411230724 Cache expiry: 86400 Reduced expiry: false Complications: [show‐toc] CPU time usage: 1.996 seconds Real time usage: 4.998 seconds Preprocessor visited node count: 17134/1000000 Post‐expand include size: 175263/2097152 bytes Template argument size: 7022/2097152 bytes Highest expansion depth: 20/100 Expensive parser function count: 1/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 20284/5000000 bytes Lua time usage: 2.940/15 seconds Lua virtual size: 7282688/52428800 bytes Lua estimated memory usage: 0 bytes Number of Wikibase entities loaded: 0/250 Transclusion expansion time report (%,ms,calls,template) 100.00% 4173.792 1 -total 78.09% 3259.484 532 Template:Tag/sandbox 13.27% 553.830 50 Template:LangSwitch 8.18% 341.343 37 Template:Main 4.02% 167.801 2 Template:Icon 3.94% 164.443 66 Template:Langcode 3.92% 163.585 2 Template:LangSwitch/langcode 3.03% 126.565 61 Template:IconWay 2.66% 110.967 5 Template:Details 2.60% 108.691 21 Template:Reflist |
− | NewPP limit report
Cached time: | + | NewPP limit report
Cached time: 20240411235924 Cache expiry: 86400 Reduced expiry: false Complications: [show‐toc] CPU time usage: 0.538 seconds Real time usage: 1.278 seconds Preprocessor visited node count: 5287/1000000 Post‐expand include size: 64201/2097152 bytes Template argument size: 2674/2097152 bytes Highest expansion depth: 20/100 Expensive parser function count: 9/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 0/5000000 bytes Lua time usage: 0.700/15 seconds Lua virtual size: 7675904/52428800 bytes Lua estimated memory usage: 0 bytes Number of Wikibase entities loaded: 0/250 Transclusion expansion time report (%,ms,calls,template) 100.00% 1073.272 1 -total 64.17% 688.667 99 Template:Tag/sandbox 14.93% 160.190 34 Template:Key 13.76% 147.734 54 Template:Langcode 11.89% 127.635 34 Template:TagPagename 8.71% 93.437 1 Template:Role 7.86% 84.316 1 Template:Icon 7.57% 81.199 1 Template:LangSwitch 7.25% 77.774 1 Template:LangSwitch/langcode 6.08% 65.218 1 Template:Languages |
The Lua module is passing a battery of tests, but more test cases are always welcome. If no showstopping issues are identified, I'd like to deploy this rewrite soon, then proceed to similar templates like {{TagValue}}, so that the operations team can identify other non-template-related bottlenecks.
– Minh Nguyễn 💬 23:11, 11 April 2024 (UTC)
- See https://github.com/openstreetmap/operations/issues/1046 for anyone confused by "operations team" phrase. Mateusz Konieczny (talk) 01:29, 12 April 2024 (UTC)
- Performance improvements are nice in general! Thanks for them! What about code readability/maintainability? Extra require dependencies? How it changed? Though given dramatic situation we likely would need to use it anyway Mateusz Konieczny (talk) 01:29, 12 April 2024 (UTC)
@Mateusz Konieczny: I may be biased, but I find Module:Tag to be much more comprehensible and maintainable than the current Template:Tag. For example, I think it would've been challenging to implement |::: = or |;;; = in the current wikitext implementation. In addition to the performance improvements, I also fixed some bugs along the way. For example, wikimedia_commons=File:Example.png now links to Wikimedia Commons instead of commons=File:Example.png. Aside from bug fixes and support for an arbitrary number of colons and semicolons, I tried to keep the behavior exactly the same.
Module:Tag does depend on Module:Languages, but most pages on the wiki already transclude {{Languages}}, which also depends on that module, so there's negligible overhead. Unlike a template, a data module such as Module:Languages/config gets loaded only once no matter how many times the page requires it.
– Minh Nguyễn 💬 04:43, 12 April 2024 (UTC)
I've proposed a Lua port of {{TagValue}} as well. – Minh Nguyễn 💬 16:51, 14 April 2024 (UTC)
And finally a port of {{TagKey}}, completing the set. – Minh Nguyễn 💬 18:40, 25 April 2024 (UTC)
- Resolved: I've deployed all three rewrites. Documentation still needs to be updated, though. – Minh Nguyễn 💬 07:11, 7 May 2024 (UTC)
Edit 2024-05-07 broke template
All tags that should be =* are now showing as =<nowiki/>* after the most recent change. Are there more fixes to come or does this just need to be reverted? -- InsertUser 12:02, 7 May 2024 (UTC)
- @Minh Nguyen: whack!. Duja (talk) 12:43, 7 May 2024 (UTC)
- @InsertUser and Duja: Fixed. Serves me right for unit testing the underlying Lua module but not the surrounding {{Tag}} template. Please ping me if you see any other fallout. Thanks! – Minh Nguyễn 💬 14:22, 7 May 2024 (UTC)
- @Minh Nguyen The DE:Tag seems to be broken now as well. Could this be related? No one has touched it in years. Nadjita (talk) 06:33, 11 May 2024 (UTC)
- @InsertUser and Duja: Fixed. Serves me right for unit testing the underlying Lua module but not the surrounding {{Tag}} template. Please ping me if you see any other fallout. Thanks! – Minh Nguyễn 💬 14:22, 7 May 2024 (UTC)
@Nadjita: Thanks for the heads-up. I've fixed {{Template:DE:Tag}} and all the other "XY:Tag" templates that were based on {{Tag}}. As far as I can tell, the German template is the only one that is very heavily used. A few of them were older, more manual implementations, which I didn't touch because they weren't broken. The breakage was caused by Module:Arguments, which apparently knows how to look at the template's caller for all the parameters. However, if it passes in some parameters, as {{Template:DE:Tag}} does, then it won't look any further up the chain to see which parameters the article passed in. I migrated these templates to use Module:Tag directly, because {{Tag}} doesn't do anything special anymore.
At this point, you can simply use {{Tag}} with |lang = de for the exact same effect; no need for {{Template:DE:Tag}}. The only localized template that has additional functionality is {{Template:FR:Tag}}, for some custom external links. We could fold those links into Module:Tag if people use them enough, but for now I'm assuming that it's a pretty obscure syntax not worth enabling for every language.
– Minh Nguyễn 💬 17:20, 11 May 2024 (UTC)
First line
The first line "removed:flag:type=national;regional;municipal;organisation" seems quite strange, no ? Yunan973 (talk) 17:18, 18 June 2024 (UTC)
- It does indeed, although it's probably harmless. Pinging Minh Nguyen aka "real programmers only test in production". Duja (talk) 12:22, 19 June 2024 (UTC)
- @Yunan973: This is just a demonstration of what the template can insert. Many templates in the Template: namespace display placeholder content like this. What it actually inserts depends on the parameters you pass into it, as documented further down on the page. – Minh Nguyễn 💬 17:08, 20 June 2024 (UTC)
- @Duja: OK, I swapped in some more obvious placeholders in Special:Diff/2726272, Special:Diff/2726273, Special:Diff/2726274. I avoided numbers because they wouldn't correspond to the parameter numbers. (The key is |1 =; the first value could be |3 =.) – Minh Nguyễn 💬 20:14, 2 July 2024 (UTC)