Template talk:Portal box placard
Appearance
This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||||||||
|
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)
- @Anomalocaris: Thank you, I will try to fix it. --Hecato (talk) 22:51, 2 December 2019 (UTC)
- 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)
- 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)
- 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)
- 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
- 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)
- Looks good to me. Thanks for your diligence. – Jonesey95 (talk) 02:41, 28 June 2021 (UTC)
- 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)