Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Template talk:Infobox electronic component

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
(Redirected from Template talk:Infobox electronic component/testcases)
Latest comment: 4 days ago by Jonesey95 in topic name/title

Symbol caption

[edit]

I suggest that we add a field directly below the symbol image, so that we can easily add an explanation if something is unclear. For example, when updating the symbol area so that it would include both the US and IEC standards, I had to resort to this bulky way of adding a caption:

https://en.wikipedia.org/w/index.php?title=Resistor&oldid=592813207

{{Infobox electronic component
 | component         = Resistor
 | image             = [[File:Resistor.jpg|200px]]
 | caption           = A typical axial-lead resistor
 |type= [[Passivity (engineering)|Passive]]
 |working_principle= [[Electric resistance]]
 |invented=
 |first_produced= 
 |symbol= [[File:Resistors.svg]]
 ''1. US standard <br>2. IEC standard ''
}}

It would be better if there was a designated field for this, because resistor symbols aren't the only things with competing standards. Anonimski (talk) 16:36, 28 January 2014 (UTC)Reply

@Anonimski: I will add a |symbol_caption= field. Frietjes (talk) 16:51, 31 January 2014 (UTC)Reply
Thank you. Are you also going to update the Resistor article, or should I update the edit I did earlier? Anonimski (talk) 16:58, 31 January 2014 (UTC)Reply

name/title

[edit]

Jonesey95 — I have tested change in the sandbox as suggested. Here are the test cases and results Template:Infobox electronic component/sandbox/test1. This particular change is independent of the Wikidata property-retrieval changes. Could you take a look? im_tau (talk) 18:10, 26 August 2026 (UTC)Reply

I moved the page to Template:Infobox electronic component/testcases, where it belongs. I also fixed the format of the testcases. Please use this format and location in your future work, as it is the standard way to construct template test cases. As for the content of the testcases, I see one major problem, which is that you have introduced a new parameter |title= but placed it in Template:Infobox's |above= parameter. That is not standard and may cause confusion. – Jonesey95 (talk) 19:35, 26 August 2026 (UTC)Reply
Thank you very much for the feedback and for moving the test cases to the standard location. I’ll try to follow these conventions.
Regarding |title=, I originally added it because I found some articles where the name of the component was provided using the title parameter, so I wanted to preserve that usage as a fallback for the infobox name. Later, I changed the presentation to use |above= because I found that it looked better, particularly when Wikipedia is viewed in dark mode.
However, I understand your concern about introducing a new parameter in this way. I agree it may be better to remove {{{title}}} im_tau (talk) 19:45, 26 August 2026 (UTC)Reply
I have prepared another independent change in the sandbox: an accessibility reminder for images without an alt parameter. It shows edit notice if the Infobox has |image or |photo but hasn't |alt. It was already useful for two authors here Capacitor:revision history and here RCD:revision history Could you take a look when you have time? im_tau (talk) 20:41, 26 August 2026 (UTC)Reply
Why did you update the live template just now? You deleted |component=, breaking the display of the template at Audicom. Your edits are becoming disruptive. I am trying to help you, but editors who disrupt templates and articles in this way often face sanctions. You need to slow down and do a lot more testing. – Jonesey95 (talk) 22:41, 26 August 2026 (UTC)Reply
The message about the missing |alt= parameter at this test case is not standard and should never be deployed in any form in any template. Error messages like this should not be displayed to casual readers, only to editors while editing. And they should not use cute little hearts or thank the editors in advance. If you are looking for a way to display an error message when a parameter is omitted, look how it is done in other templates. – Jonesey95 (talk) 22:45, 26 August 2026 (UTC)Reply
Hi. I stumbled into this conversation because the template "Infobox electronic component " was originally included in Ground (electricity) and subsequently emptied, which is an action that actually "broke" the article layout and removed information. Therefore I reverted the action, and populated the infobox again (compare this version to this one). I tried to understand the rationale for the infobox having been emptied, and I guess the action of removing the data from the infobox is somehow related to this very conversation (I did not read everything above). I don't know if other articles are affected, but it might be worth checking. Best, ~2026-47214-57 (talk) 17:09, 29 August 2026 (UTC)Reply
Transformer, Circuit breaker, Diode, Recloser, Light-emitting diode, Inductor. I don't recall editing other articles im_tau (talk) 18:24, 29 August 2026 (UTC)Reply
@Im tau To see a list of your own contributions, click on your username at the top of the page, and then on 'user contributions' in the list on the right. I've just worked my way through all of your contributions and fixed most/all of the rest of the breakage.
Regarding your template edits to move the title within the bounds of the drawn box to fix what you perceived to be a visual issue in the dark theme:
  1. Firstly, it's convention, in my experience, for the title to be placed above the box. Any such change should be applied consistently to all forms of infobox, not just a few random ones, and it's the sort of change that should really be discussed first to get agreement. FYI, if such a change were agreed to, the logical thing would surely be to modify the root template:infobox itself, such that the change only need be made in one place, automatically applying to all subtypes.
  2. Secondly, having given the dark theme a quick try, I notice that with the dark theme, the title of the infobox inherits the same dark-grey background colour as the box beneath it. If the theme were tweaked to avoid any such background colour on the title, as with the light theme, then that makes it look much nicer and makes it consistent with the light theme. I think that's a much better solution, and less controversial, than moving the title into the bounds of the box. Similarly, I notice that hatnotes also have the same dark-grey background to them, which is similarly inconsistent with the light-theme (e.g. in this article, see the text at the top of the page just before the lead paragraph, and further down the page, the 'main article' and 'see also' links under various section headings). Off hand, I'm not sure where to discuss/request theme changes.
DiscreetParrot (talk) 01:07, 30 August 2026 (UTC)Reply
Also, note that per Template:Infobox/doc use of title is preferred over above for accessibility reasons. DiscreetParrot (talk) 02:20, 30 August 2026 (UTC)Reply

name

[edit]

(see name/title discussion). I still think we could use this

| above   = {{#ifeq:{{PAGENAMEBASE}}|Infobox electronic component||{{#if:{{{name|}}}|<div style="border-bottom: 1px solid #aaa; padding-bottom: 5px; margin-bottom: 2px;">{{{name}}}</div>|<div style="border-bottom: 1px solid #aaa; padding-bottom: 5px; margin-bottom: 2px;">{{PAGENAMEBASE}}</div>}}}}

it will look like here Kruzhylovsky landscape reserve or here Ancient Greek but with a horizontal line. It tries to use {name}, if there's no name it uses PAGENAME im_tau (talk) 14:13, 27 September 2026 (UTC)Reply

The /sandbox version of the template is available for editing. You can see the results at Template:Infobox electronic component/testcases. – Jonesey95 (talk) 23:55, 29 September 2026 (UTC)Reply
And please re-read the section above before making any edits. |title= is preferred to |above=. – Jonesey95 (talk) 23:57, 29 September 2026 (UTC)Reply

Deprecation of parameters

[edit]

As part of a larger effort to eliminate conflicting parameters, I will be refactoring multiple aspects of this template and deprecating a number of parameter aliases. This is also part of an effort to make things consistent across Infoboxes. As part of this cleanup, I am also going to fix parameter names that fail to conform to MOS:INFOBOXNAME. Note that this follows a long list of similar clean ups that I have done on countless other Infoboxes. The parameters I plan to replace are the following:

Deprecate Replace with
|component= |name=
|photo= |image=
|photo_caption= |caption=
|invented= |inventor=

Please chime in below with any questions, comments or concerns about this cleanup. Zackmann (Talk to me/What I been doing) 16:12, 7 September 2026 (UTC)Reply