Village Pump (technical) - Mysterious Behaviour of Template:Talk Other

Mysterious Behaviour of Template:Talk Other

The template {{talk other}} takes two positional parameters, and returns the first if used on a talk page, and returns the second if used on a non-talk page. Thus,

{{talk other|This is a talk page|This is a subject page}} returns This is a subject page

when used here. However, it breaks if all or part of the second parameter is wrapped in :

{{talk other|This is a talk page|This is a }} returns

(i.e. nothing). I spotted this because I found a case of {{edit semi-protected}} being used on an article here, when searching for bad edits by this anon. It should have shown Error: Semi-protected edit requests should only be made on the talk page. and put the page into Category:Non-talk pages requesting an edit to a semi-protected page, but did neither of these. If I amend {{edit semi-protected}} to remove the class="error", it works. I've determined that if the has no attributes, it works - but as soon as it's given an attribute, whether class= id= or style=, regardless of whether the attribute has a value or not, the whole of the second positional parameter is ignored. --Redrose64 (talk) 15:41, 14 December 2012 (UTC)

Try this:
{{talk other|This is a talk page|This is a subject page}} returns This is a subject page
Otherwise the equals sign is interpreted as part of the template syntax. Jafeluv (talk) 16:15, 14 December 2012 (UTC)
Or this:
{{talk other|1=This is a talk page|2=This is a -- WOSlinker (talk) 16:23, 14 December 2012 (UTC)
Ah yes, that would do it; or even
{{talk other|This is a talk page|2=This is a }} returns This is a subject page
which is a bot more "obvious". Thank you --Redrose64 (talk) 16:25, 14 December 2012 (UTC)
All non-user pages now fixed up. Some had carried the {{edit semi-protected}} for over a year. --Redrose64 (talk) 17:59, 14 December 2012 (UTC)

Read more about this topic:  Village Pump (technical)

Famous quotes containing the words mysterious and/or behaviour:

    Abscond. To “move” in a mysterious way, commonly with the property of another.
    Ambrose Bierce (1842–1914)

    The methodological advice to interpret in a way that optimizes agreement should not be conceived as resting on a charitable assumption about human intelligence that might turn out to be false. If we cannot find a way to interpret the utterances and other behaviour of a creature as revealing a set of beliefs largely consistent and true by our standards, we have no reason to count that creature as rational, as having beliefs, or as saying anything.
    Donald Davidson (b. 1917)