Jump to content

Template talk:Portal box placard

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

Bogus empty file option

[edit]

Hecato: Based on Template:Portal box placard/doc, it seems that when the res-width parameter is omitted, the template generates an empty image option, which is a bogus image options lint error. Special:ExpandTemplates shows that

{{Portal box placard|1=File:Catalonia 2016 Zout Fotografie (196 van 196) (32589506286) crop.jpg|caption=test caption}}

expands to

<templatestyles src="Portal box placard/styles.css"/>
<div class=box-placard>
[[File:Catalonia 2016 Zout Fotografie (196 van 196) (32589506286) crop.jpg||test caption]]
</div>

and the the empty image option just before "test caption" needs to be fixed. —Anomalocaris (talk) 22:57, 18 November 2019 (UTC)[reply]

Hecato: How did your efforts turn out? The problem seems to be escaping the pipe character for one round of parsing, so it can work as a pipe for the next round of processing. Maybe this is beyond the limits of the tools in our toolbox. Have you given up completely? —Anomalocaris (talk) 21:49, 20 April 2021 (UTC)[reply]
Jonesey95: Looks like you struggled with this also. How to make a pipe escaped for the purposes of processing within the if-logic of this template, but real for the purposes of the file markup output by this template: is there a way to do that? —Anomalocaris (talk) 00:24, 21 April 2021 (UTC)[reply]
It looks like I tried my usual method but reverted it because it didn't work for some reason. The easiest thing to do is probably to provide a default res-width, e.g. 500px, after the pipe inside the template variable, like {{{res-width|500px}}}. – Jonesey95 (talk) 01:55, 21 April 2021 (UTC)[reply]
Jonesey95: I did what you said and it didn't solve the problem, so I did something slightly different that seems to work. Take a look! —Anomalocaris (talk) 18:39, 27 June 2021 (UTC)[reply]
Looks good to me. Thanks for your diligence. – Jonesey95 (talk) 02:41, 28 June 2021 (UTC)[reply]