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)
- All non-user pages now fixed up. Some had carried the
Read more about this topic: Village Pump (technical)
Famous quotes containing the words mysterious and/or behaviour:
“And so a mysterious creeping motion
Quickens its demonic profile, bringing tears, to these eyes at least,
Tears of excitement.”
—John Ashbery (b. 1927)
“... into the novel goes such taste as I have for rational behaviour and social portraiture. The short story, as I see it to be, allows for what is crazy about humanity: obstinacies, inordinate heroisms, immortal longings.”
—Elizabeth Bowen (18991973)