Topic on Project:Support desk

Controlling how blank values are displayed in a template

3
SFLord (talkcontribs)

Mediawiki Version: 1.31.0-wmf.4 (477691b)

PHP: any

Database:

A template is used in the Kabiye wiki called Ɛyaa sɔsaa which is the Kabiye Famous Persons' template. The address of the template is and the wiki address is

The signature of a famous person should only be shown if such (a signature) exists. At present, a contributor can enter a file name for a signature, but if this value is left blank, the message [[File:|190px]] is displayed which is unsatisfactory... This is the final value that is entered.

All text on the wiki is in the Kabiye language, with the exception of some French and English words, so for example the title of the Ɛyaa sɔsaa template is Modèle:Ɛyaa sɔsaa - a mixture of French & Kabiye. The Wiki went live - (came out of the incubator) about 2 months ago.

We would value any help as to how to change the template so as to only display a signature if one has been supplied. My best guess would be that some conditional statement needs to be included in the [[File: statement and have searched the existing help entries - but with no joy...

Any suggestions would be greatly valued.

I am using a Windows 7 PC and Google Chrome Version 61.0.3163.100 to update the Kabiye wikipedia.

Clump (talkcontribs)

Your use of #if is not correct. Instead of {{#if: [[File:{{{E-nesi ñɩɣʋ}}}|190px]]}}, use {{#if:{{{E-nesi ñɩɣʋ|}}}|[[File:{{{E-nesi ñɩɣʋ}}}|190px]]}}

SFLord (talkcontribs)

Clump

Thanks for your help to resolve this problem. Of course the #if conditional statement has to test for the existence of E-nesi ñɩɣʋ and then ensure that it is displayed if a value has been given.

A subsequent issue is that the Ɛyaa sɔsaa template contains 2 statements referring to the pixcel size - the first controls the image size and is the 3rd value to be added, the second is the one which is now controlled by the conditional #if statement.

We rarely, if ever, do not supply an image for a famous person, however it is frequently the case that a signature cannot be found. If an image is supplied, but no signature and the first px value is left blank, the template will by default use the px value in the final statement, but the warning:

Warning: [null Euclid] is calling Modèle:Ɛyaa sɔsaa with more than one value for the "px" parameter. Only the last value provided will be used. When previewing the page (in this case its the page to do with Euclid...) and the message:

Pages utilisant des arguments dupliqués dans les appels de modèle

is displayed, when the page is published.

The temporary resolution is to remove the first px statement from the template for those famous person pages which have no signature. I will almost certainly remove the first px statement from the Ɛyaa sɔsaa template file, but will check with the sponsor of the Kabiye wiki first.