Template talk:Chembox

From Wikipedia, the free encyclopedia
Latest comment: 5 May 2025 by Bernardirfan in topic The Template:Tl page has an error
Jump to navigation Jump to search

Script error: No such module "Hatnote".

<templatestyles src="Module:Message box/tmbox.css"/><templatestyles src="Talk header/styles.css" />

Script error: No such module "Check for unknown parameters".Script error: No such module "Check for deprecated parameters".

Script error: No such module "Message box". Script error: No such module "Unsubst". Script error: No such module "Banner shell".

User:MiszaBot/config

Template-protected edit request on 12 January 2025

Template:Edit template-protected Please, replace the current content of Template:Chembox image cell to the following:

| colspan="2" style="text-align:center; padding:2px;" | {{#invoke:InfoboxImage|InfoboxImage
|center=yes <!-- when center=yes, it is rendered with the <picture> html tag instead of <span> it is important so the CSS is applied correctly -->
|image={{{par_file}}}
|size={{{par_size}}}
|sizedefault=220px
|alt={{{par_alt}}}
|title={{{par_title}}}
|class={{{par_class}}}}}{{#if:{{{par_caption|}}}|<div style="text-align:center;">{{{par_caption|}}}</div>}}
|-<noinclude>{{documentation}}</noinclude>

Explanation: The current CSS styling for dark mode selects for "figure:not(...)...", so it was currently working only for some images in the Chembox. The code above makes it work nice as intended.

Diff

Testcase examples: Template:Chembox/testcases7images#Dark mode tests

Thanks! -- Arthurfragoso (talk) 22:41, 12 January 2025 (UTC)Reply

File:Yes check.svg DoneArthurfragoso (talk) 17:56, 14 January 2025 (UTC)Reply

linking "IUPAC Names" parameter to pages

I noticed the parameter "IUPAC Name" links to different pages depending on the template/page. Many link to IUPAC nomenclature of chemistry, a stub article which I think should be merged/redirected to International Union of Pure and Applied Chemistry. Some link to chemical nomenclature, which works but I feel like International Union of Pure and Applied Chemistry is better. Is there a reason for the inconsistent linking? Adding to that, if International Union of Pure and Applied Chemistry isn't the right page to link to, wouldn't IUPAC nomenclature of inorganic chemistry and IUPAC nomenclature of organic chemistry be the best options, depending on the molecule? Niodium (talk) 01:48, 4 February 2025 (UTC)Reply

Never mind, I think I misunderstood the point of the pages being linked to. Niodium (talk) 05:35, 4 February 2025 (UTC)Reply

Local-image parser bug

Template:Tl categorizes an article in Category:Chemical pages containing a local image if |ImageFile= (or similar field) is an image that is on the local wiki rather than on commons. However, Curium(III) chloride contains the local File:Curium(III) chloride.jpg but is not in the local-image category. It looks like a general bug when the filename contains a parenthesis: switching in other random enwiki images to that article sets the cat, and other chembox articles containing local images with parens does not set the cat. DMacks (talk) 16:48, 10 February 2025 (UTC)Reply

Bug is in Template:Tl, where Template:Pf doesn't like some URL-encoded strings. It's a documented WP:NCTECHNICAL#Other problematic characters limitation of that parser function. Given we can't be sure how a filename will be passed, we should probably switch to Template:Tl instead of #titleparts or maybe just Template:Tl instead of ParmPart. DMacks (talk) 16:55, 10 February 2025 (UTC)Reply

The Template:Tl page has an error

At the very beginning of the page Template:Tl writes some code:

! colspan=2 style="background: #f8eaba;color:inherit; text-align: center;" |Identifiers |-

That code should not be visible on the page. It shows there is a code error. Please someone repair the error. Bernardirfan (talk) 18:45, 5 May 2025 (UTC)Reply